don't preserve any attributes by default

This commit is contained in:
Jingbei Li 2016-12-08 18:51:08 +08:00 committed by Matteo Cypriani
parent bdc1df9b6f
commit 45905e8f35
1 changed files with 11 additions and 8 deletions

19
gcp
View File

@ -556,7 +556,7 @@ class GCP():
parser.add_argument("-f", "--force", action="store_true", default=False,
help=_("force overwriting of existing files"))
parser.add_argument("--preserve", action="store", default='mode,ownership,timestamps',
parser.add_argument("--preserve", action="store", default='',
help=_("preserve the specified attributes"))
parser.add_argument("-L", "--dereference", action="store_true", default=False,
@ -614,14 +614,17 @@ class GCP():
if options.verbose:
logging.getLogger().setLevel(logging.DEBUG)
preserve = set(options.preserve.split(','))
if not preserve.issubset(const_PRESERVE):
error (_("Invalide --preserve value\nvalid values are:"))
for value in const_PRESERVE:
error('- %s' % value)
exit(1)
if len(options.preserve):
preserve = set(options.preserve.split(','))
if not preserve.issubset(const_PRESERVE):
error (_("Invalide --preserve value\nvalid values are:"))
for value in const_PRESERVE:
error('- %s' % value)
exit(1)
else:
options.preserve = preserve
else:
options.preserve = preserve
options.preserve=set()
self.__sourcesSaving(options, args)