# HG changeset patch # User Goffi # Date 1307213744 -7200 # Node ID dda2195dc9f41a5ea8e77c04ba4da0b62de1b473 # Parent 97384a79043dd09f27a7e7a8cf62a6b59e9f9db8 Symbolic link skipping diff -r 97384a79043d -r dda2195dc9f4 gcp --- a/gcp Sat Jun 04 20:32:50 2011 +0200 +++ b/gcp Sat Jun 04 20:55:44 2011 +0200 @@ -266,6 +266,9 @@ try: for filename in os.listdir(dirpath): filepath = os.path.join(dirpath,filename) + if os.path.islink(filepath) and not options.dereference: + debug ("Skippink symbolic dir: %s" % filepath.decode('utf-8','replace')) + continue if os.path.isdir(filepath): full_dest_path = os.path.join(dest_path,filename) self.__appendDirToList(filepath, full_dest_path, options) @@ -550,6 +553,12 @@ parser.add_option("--preserve", action="store", default='mode,ownership,timestamps', help=_("preserve the specified attributes")) + parser.add_option("-L", "--dereference", action="store_true", default=False, + help=_("always follow symbolic links in sources")) + + parser.add_option("-P", "--no-dereference", action="store_false", dest='dereference', + help=_("never follow symbolic links in sources")) + #parser.add_option("--no-unicode-fix", action="store_false", dest='unicode_fix', default=True, # help=_("don't fix name encoding errors")) #TODO