Browse code

* s3cmd, run-test.py, TODO, NEWS: Added --dry-run and --exclude/--include for [setacl].

git-svn-id: https://s3tools.svn.sourceforge.net/svnroot/s3tools/s3cmd/trunk@391 830e0280-6d2a-0410-9c65-932aecc39d9d

Michal Ludvig authored on 2009/05/27 23:08:05
Showing 4 changed files
... ...
@@ -1,6 +1,8 @@
1 1
 2009-05-28  Michal Ludvig  <michal@logix.cz>
2 2
 
3 3
 	* s3cmd, run-test.py, TODO, NEWS: Added --dry-run
4
+	  and --exclude/--include for [setacl].
5
+	* s3cmd, run-test.py, TODO, NEWS: Added --dry-run
4 6
 	  and --exclude/--include for [del].
5 7
 
6 8
 2009-05-28  Michal Ludvig  <michal@logix.cz>
... ...
@@ -7,7 +7,7 @@ s3cmd 1.0.0
7 7
   pre-processing. Good for fixing unreadable buckets.
8 8
 * Added --recursive support for [cp] and [mv], including
9 9
   multiple-source arguments, --include/--exclude, --dry-run, etc.
10
-* Added --exclude/--include and --dry-run for [del].
10
+* Added --exclude/--include and --dry-run for [del], [setacl].
11 11
 
12 12
 s3cmd 0.9.9   -   2009-02-17
13 13
 ===========
... ...
@@ -4,8 +4,7 @@ TODO list for s3cmd project
4 4
 - For 0.9.9.x
5 5
   - Make 'sync s3://bkt/some-filename local/other-filename' work
6 6
     (at the moment it'll always download).
7
-  - Enable --exclude for [setacl], [ls].
8
-  - Enable --dry-run for [setacl], reject for all others.
7
+  - Enable --exclude for [ls].
9 8
   - Allow change /tmp to somewhere else
10 9
   - With --guess-mime use 'magic' module if available.
11 10
   - Support --preserve for [put] and [get]. Update manpage.
... ...
@@ -1073,7 +1073,21 @@ def cmd_setacl(args):
1073 1073
 	set_to_acl = cfg.acl_public and "Public" or "Private"
1074 1074
 
1075 1075
 	remote_list = fetch_remote_list(args)
1076
+	remote_list, exclude_list = _filelist_filter_exclude_include(remote_list)
1077
+
1076 1078
 	remote_count = len(remote_list)
1079
+
1080
+	info(u"Summary: %d remote files to update" % remote_count)
1081
+
1082
+	if cfg.dry_run:
1083
+		for key in exclude_list:
1084
+			output(u"exclude: %s" % unicodise(key))
1085
+		for key in remote_list:
1086
+			output(u"setacl: %s" % remote_list[key]['object_uri_str'])
1087
+
1088
+		warning(u"Exitting now because of --dry-run")
1089
+		return
1090
+
1077 1091
 	seq = 0
1078 1092
 	for key in remote_list:
1079 1093
 		seq += 1