Handle --preserve=all
This commit is contained in:
parent
2e0e8ba994
commit
b83d37a5e9
16
fr.po
16
fr.po
|
@ -197,8 +197,11 @@ msgid "force overwriting of existing files"
|
|||
msgstr "force le remplacement des fichiers déjà existants"
|
||||
|
||||
#: gcp:545
|
||||
msgid "preserve the specified attributes"
|
||||
msgstr "garde les attributs spécifiés"
|
||||
#, python-format
|
||||
msgid "preserve the specified attributes; accepted values:\
|
||||
'all', or one or more amongst %s"
|
||||
msgstr "garde les attributs spécifiés; valeurs acceptées : 'all' ou\
|
||||
un ou plusieurs éléments parmi %s"
|
||||
|
||||
#: gcp:551
|
||||
msgid "don't fix filesystem name incompatibily"
|
||||
|
@ -245,12 +248,9 @@ msgid "Progress bar is not available, deactivating"
|
|||
msgstr "La barre de progression n'est pas disponible, désactivation"
|
||||
|
||||
#: gcp:595
|
||||
msgid ""
|
||||
"Invalid --preserve value\n"
|
||||
"valid values are:"
|
||||
msgstr ""
|
||||
"La valeur de «--preserve» est invalide\n"
|
||||
"Les valeurs valides sont:"
|
||||
#, python-format
|
||||
msgid "Invalid --preserve value '%s'"
|
||||
msgstr "Valeur de --preserve invalide « %s »"
|
||||
|
||||
#: gcp:616
|
||||
#, python-format
|
||||
|
|
29
gcp
29
gcp
|
@ -566,7 +566,8 @@ class GCP():
|
|||
)
|
||||
parser.add_argument("--preserve",
|
||||
action="store", default='',
|
||||
help=_("preserve the specified attributes")
|
||||
help=_("preserve the specified attributes; accepted values:\
|
||||
'all', or one or more amongst %s") % str(const_PRESERVE)
|
||||
)
|
||||
parser.add_argument("-L", "--dereference",
|
||||
action="store_true", default=False,
|
||||
|
@ -646,22 +647,26 @@ class GCP():
|
|||
if options.no_fs_fix:
|
||||
options.fs_fix = 'no'
|
||||
|
||||
preserve = set()
|
||||
|
||||
if options.p:
|
||||
if not options.preserve:
|
||||
options.preserve = const_PRESERVE_p
|
||||
else:
|
||||
options.preserve += ',' + const_PRESERVE_p
|
||||
preserve.update(const_PRESERVE_p.split(','))
|
||||
|
||||
if options.preserve:
|
||||
preserve = set(options.preserve.split(','))
|
||||
if not preserve.issubset(const_PRESERVE):
|
||||
error (_("Invalid --preserve value\nvalid values are:"))
|
||||
for value in const_PRESERVE:
|
||||
error('- %s' % value)
|
||||
preserve.update(options.preserve.split(','))
|
||||
preserve_all = False
|
||||
for value in preserve:
|
||||
if value == 'all':
|
||||
preserve_all = True
|
||||
continue
|
||||
if value not in const_PRESERVE:
|
||||
error (_("Invalid --preserve value '%s'") % value)
|
||||
exit(1)
|
||||
if preserve_all:
|
||||
preserve.remove('all')
|
||||
preserve.update(const_PRESERVE)
|
||||
|
||||
options.preserve = preserve
|
||||
else:
|
||||
options.preserve = set()
|
||||
|
||||
self.__sourcesSaving(options, args)
|
||||
|
||||
|
|
9
gcp.po
9
gcp.po
|
@ -120,7 +120,9 @@ msgid "force overwriting of existing files"
|
|||
msgstr ""
|
||||
|
||||
#: gcp:321
|
||||
msgid "preserve the specified attributes"
|
||||
#, python-format
|
||||
msgid "preserve the specified attributes; accepted values:\
|
||||
'all', or one or more amongst %s"
|
||||
msgstr ""
|
||||
|
||||
#: gcp:324
|
||||
|
@ -140,9 +142,8 @@ msgid "Progress bar is not available, deactivating"
|
|||
msgstr ""
|
||||
|
||||
#: gcp:345
|
||||
msgid ""
|
||||
"Invalid --preserve value\n"
|
||||
"valid values are:"
|
||||
#, python-format
|
||||
msgid "Invalid --preserve value '%s'"
|
||||
msgstr ""
|
||||
|
||||
#: gcp:354
|
||||
|
|
Loading…
Reference in New Issue