Compare commits

..

No commits in common. "07f53e4109947d0e149b27f41c2a93198409d80d" and "28e8089316ac0aa082f522cbbfb7e90c986fdce4" have entirely different histories.

10 changed files with 292 additions and 375 deletions

View File

@ -1,11 +1,10 @@
gcp 0.2.0 (2018-10-14, Matteo Cypriani): gcp 0.2.0 (UNRELEASED, Matteo Cypriani):
- actually switch to Python3 - actually switch to Python3
- cp compatibibility: - cp compatibibility:
+ don't preserve any attributes by default (Jingbei Li) + don't preserve any attributes by default (Jingbei Li)
+ added -p switch (same as --preserve=mode,ownership,timestamps) + added -p switch (same as --preserve=mode,ownership,timestamps)
+ added -R switch (same as --recursive) + added -R switch (same as --recursive)
- new --fix-filenames option - new --fs-fix option
- reworked packaging
gcp 0.1.4.dev1 (unreleased, Jingbei Li): gcp 0.1.4.dev1 (unreleased, Jingbei Li):
- main Python3 migration work - main Python3 migration work

View File

@ -1,8 +1,7 @@
gcp gcp
=== ===
gcp is a user-friendly file copier written in Python. Its name used to stand gcp (Goffi's cp) is a file copier.
for "Goffi's CoPier", but was changed into a recursive acronym: Gcp CoPier.
License License
@ -52,17 +51,16 @@ Installing
The Python way The Python way
-------------- --------------
First, install the following packages on your system (these Debian packages pip3 install gcp
names, they may be different on other distros/systems):
Note that you should have the following packages installed so that pip can
complete the installation (Debian packages names, but you get the idea):
- libdbus-1-dev - libdbus-1-dev
- libdbus-glib-1-dev - libdbus-glib-1-dev
- libgirepository1.0-dev - libgirepository1.0-dev
- libcairo2-dev - libcairo2-dev
- python3-cairo-dev - python3-cairo-dev
Then install gcp with pip:
pip3 install gcp
On Debian-based systems On Debian-based systems
----------------------- -----------------------
@ -147,9 +145,9 @@ Big thanks to contributors and package maintainers.
Contributors Contributors
============ ============
* Original author: Jérôme Poisson a.k.a. Goffi <goffi@goffi.org> 2010-2011. * Original author: Jérôme Poisson aka Goffi <goffi@goffi.org> 2010-2011.
* Thomas Preud'homme <robotux@celest.fr> 2011: manpage, stat resolution fix. * Thomas Preud'homme <robotux@celest.fr> 2011: manpage, stat resolution fix.
* Jingbei Li a.k.a. petronny 2016: conversion to Python3. * Jingbei Li aka petronny 2016: conversion to Python3.
* Matteo Cypriani <mcy@lm7.fr> 2018: `--fs-fix` option, Python3 fixes. * Matteo Cypriani <mcy@lm7.fr> 2018: `--fs-fix` option, Python3 fixes.

189
fr.po
View File

@ -1,40 +1,36 @@
# gcp -- French translation file # gcp -- French translation file
#
# Copyright: # Copyright:
# 2010 Jérôme Poisson (Goffi) <goffi@goffi.org> # 2010 Jérôme Poisson (Goffi) <goffi@goffi.org>
# 2018 Matteo Cypriani <mcy@lm7.fr> # 2018 Matteo Cypriani <mcy@lm7.fr>
#
# This file is distributed under the same license as the gcp package. # This file is distributed under the same license as the gcp package.
# #, fuzzy
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 0.2.0\n" "Project-Id-Version: 0.2.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-09-30 18:05+0800\n" "POT-Creation-Date: 2010-09-30 18:05+0800\n"
"PO-Revision-Date: 2018-10-14 20:56+0200\n" "PO-Revision-Date: 2018-04-22 20:35+0200\n"
"Last-Translator: Matteo Cypriani <mcy@lm7.fr>\n" "Last-Translator: Matteo Cypriani <mcy@lm7.fr>\n"
"Language: fr\n" "Language: French\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Language-Team: \n"
"X-Generator: Poedit 2.2\n"
#: gcp:46 #: gcp:45
msgid "Error during import" msgid "Error during import"
msgstr "Erreur pendant l'import de bibliothèques" msgstr "Erreur pendant l'import de bibliothèques"
#: gcp:47 #: gcp:46
msgid "Please check dependecies:" msgid "Please check dependecies:"
msgstr "Merci de vérifier les dépendances :" msgstr "Merci de vérifier les dépendances :"
#: gcp:54 #: gcp:52
msgid "ProgressBar not available, please download it at https://pypi.org/" msgid "ProgressBar not available, please download it at https://pypi.org/"
msgstr "" msgstr ""
"ProgressBar n'est pas disponible, merci de le télécharger depuishttps://pypi." "ProgressBar n'est pas disponible, merci de le télécharger depuis"
"org/" "https://pypi.org/"
#: gcp:55 #: gcp:3
msgid "" msgid ""
"Progress bar deactivated\n" "Progress bar deactivated\n"
"--\n" "--\n"
@ -42,245 +38,238 @@ msgstr ""
"Barre de progression désactivée\n" "Barre de progression désactivée\n"
"--\n" "--\n"
#: gcp:90 #: gcp:88
msgid "Init DbusObject..." msgid "Init DbusObject..."
msgstr "Initialisation de DbusObject..." msgstr "Initialisation de «DbusObject»"
#: gcp:111 #: gcp:109
msgid "INTERNAL ERROR: invalid arguments" msgid "INTERNAL ERROR: invalid arguments"
msgstr "ERREUR INTERNE : arguments invalides" msgstr "ERREUR INTERNE : arguments invalides"
#: gcp:116 #: gcp:114
msgid "INTERNAL ERROR: invalid source_dir" msgid "INTERNAL ERROR: invalid source_dir"
msgstr "ERREUR INTERNE : chemin source invalide" msgstr "ERREUR INTERNE : chemin source invalide"
#: gcp:171 #: gcp:169
msgid "/!\\ THE FOLLOWING FILES WERE *NOT* SUCCESSFULY COPIED:" msgid "/!\\ THE FOLLOWING FILES WERE *NOT* SUCCESSFULY COPIED:"
msgstr "/!\\ LES FICHIERS SUIVANTS N'ONT *PAS* ÉTÉ COPIÉS :" msgstr "/!\\ LES FICHIERS SUIVANTS N'ONT *PAS* ÉTÉ COPIÉS :"
#: gcp:177 #: gcp:175
msgid "The following files were copied, but some errors happened:" msgid "The following files were copied, but some errors happened:"
msgstr "Les fichiers suivant ont été copiés, mais des erreurs sont survenues :" msgstr ""
"Les fichiers suivant ont été copiés, mais quelques erreurs sont survenues :"
#: gcp:183 #: gcp:181
#, python-format #, python-format
msgid "Please check journal: %s" msgid "Please check journal: %s"
msgstr "Merci de vérifier le journal : %s" msgstr "Merci de vérifier le journal : %s"
#: gcp:205 #: gcp:203
msgid "gcp launched" msgid "gcp launched"
msgstr "gcp lancé" msgstr "gcp lancé"
#: gcp:213 #: gcp:211
msgid "Init DBus..." msgid "Init DBus..."
msgstr "Initialisation de DBus..." msgstr "Initialisation de Dbus..."
#: gcp:244 #: gcp:241
msgid "Can't read mounts table" msgid "Can't read mounts table"
msgstr "Impossible de lire la table des montages" msgstr "Impossible de lire la table des montages"
#: gcp:251 #: gcp:248
#, python-format #, python-format
msgid "Adding to copy list: %(path)s ==> %(dest_path)s (%(fs_type)s)" msgid "Adding to copy list: %(path)s ==> %(dest_path)s (%(fs_type)s)"
msgstr "Ajout à la liste des copies : %(path)s ==> %(dest_path)s (%(fs_type)s)" msgstr "Ajout à la liste des copies : %(path)s ==> %(dest_path)s (%(fs_type)s)"
#: gcp:258 #: gcp:253
#, python-format #, python-format
msgid "Can't copy %(path)s: %(exception)s" msgid "Can't copy %(path)s: %(exception)s"
msgstr "Impossible de copier %(path)s : %(exception)s" msgstr "Impossible de copier %(path)s : %(exception)s"
#: gcp:286 #: gcp:280
#, python-format #, python-format
msgid "Can't append %(path)s to copy list: %(exception)s" msgid "Can't append %(path)s to copy list: %(exception)s"
msgstr "" msgstr ""
"Impossible d'ajouter %(path)s à la liste des fichiers à copier : " "Impossible d'ajouter %(path)s à la liste des fichiers à copier : %(exception)s"
"%(exception)s"
#: gcp:289 #: gcp:283
#, python-format #, python-format
msgid "Can't access %(dirpath)s: %(exception)s" msgid "Can't access %(dirpath)s: %(exception)s"
msgstr "Impossible d'accéder à %(dirpath)s : %(exception)s" msgstr "Impossible d'accéder à %(dirpath)s : %(exception)s"
#: gcp:301 #: gcp:295
#, python-format #, python-format
msgid "Invalid dest_path: %s" msgid "Invalid dest_path: %s"
msgstr "Chemin de destination invalide : %s" msgstr "Chemin de destination invalide : %s"
#: gcp:306 #: gcp:300
#, python-format #, python-format
msgid "The path given in arg doesn't exist or is not accessible: %s" msgid "The path given in arg doesn't exist or is not accessible: %s"
msgstr "Le chemin donné en argument n'existe pas ou n'est pas accessible : %s" msgstr "Le chemin donné en argument n'existe pas ou n'est pas accessible : %s"
#: gcp:310 #: gcp:304
#, python-format #, python-format
msgid "omitting directory \"%s\"" msgid "omitting directory \"%s\""
msgstr "répertoire \"%s\" ignoré" msgstr "Répertoire \"%s\" ignoré"
#: gcp:348 #: gcp:329
#, python-format #, python-format
msgid "File [%s] already exists, skipping it!" msgid "File [%s] already exists, skipping it!"
msgstr "Le fichier [%s] existe déjà, je le saute !" msgstr "Le fichier [%s] existe déjà, je le saute !"
#: gcp:368 #: gcp:347
#, python-format #, python-format
msgid "COPYING %(source)s ==> %(dest)s" msgid "COPYING %(source)s ==> %(dest)s"
msgstr "COPIE %(source)s ==> %(dest)s" msgstr "COPIE %(source)s ==> %(dest)s"
#: gcp:462 #: gcp:447
#, python-format #, python-format
msgid "%.2f PiB" msgid "%.2f PiB"
msgstr "%.2f Pio" msgstr "%.2f Pio"
#: gcp:464 #: gcp:449
#, python-format #, python-format
msgid "%.2f TiB" msgid "%.2f TiB"
msgstr "%.2f Tio" msgstr "%.2f Tio"
#: gcp:466 #: gcp:451
#, python-format #, python-format
msgid "%.2f GiB" msgid "%.2f GiB"
msgstr "%.2f Gio" msgstr "%.2f Gio"
#: gcp:468 #: gcp:453
#, python-format #, python-format
msgid "%.2f MiB" msgid "%.2f MiB"
msgstr "%.2f Mio" msgstr "%.2f Mio"
#: gcp:470 #: gcp:455
#, python-format #, python-format
msgid "%.2f KiB" msgid "%.2f KiB"
msgstr "%.2f Kio" msgstr "%.2f Kio"
#: gcp:471 #: gcp:457
#, python-format #, python-format
msgid "%i B" msgid "%i B"
msgstr "%i o" msgstr "%i o"
#: gcp:479 gcp:485 #: gcp:465 gcp:470
#, python-format #, python-format
msgid "Copying %s" msgid "Copying %s"
msgstr "Copie de %s" msgstr "Copie de %s"
#: gcp:515 gcp:548 #: gcp:497 gcp:530
msgid "" msgid ""
"No saved sources with this name, check existing names with --sources-list" "No saved sources with this name, check existing names with --sources-list"
msgstr "" msgstr ""
"Aucune sauvegarde de fichiers sources avec ce nom, veuillez vérifier les " "Aucune sauvegarde de fichiers sources avec ce nom, veuillez vérifier les "
"listes existantes avec --sources-list" "listes existantes avec --sources-list"
#: gcp:525 #: gcp:507
msgid "Saved sources:" msgid "Saved sources:"
msgstr "Liste de sources sauvées :" msgstr "Liste de sources sauvées :"
#: gcp:539 #: gcp:521
msgid "" msgid ""
"There is already a saved sources with this name, skipping --sources-save" "There is already a saved sources with this name, skipping --sources-save"
msgstr "Il y a déjà une liste de sources avec ce nom, --sources-save ignoré" msgstr "Il y a déjà une liste de sources avec ce nom, --sources-save ignoré"
#: gcp:578 #: gcp:557
msgid "copy directories recursively"
msgstr "copier les répertoire récursivement"
#: gcp:561
msgid "force overwriting of existing files" msgid "force overwriting of existing files"
msgstr "forcer le remplacement des fichiers déjà existants" msgstr "forcer le remplacement des fichiers déjà existants"
#: gcp:582 #: gcp:565
msgid "always follow symbolic links in sources"
msgstr "toujours suivre les liens symboliques"
#: gcp:586
msgid "never follow symbolic links in sources"
msgstr "ne pas suivre les liens symboliques"
#: gcp:590
#, python-format #, python-format
msgid "same as --preserve=%s" msgid "same as --preserve=%s"
msgstr "raccourci pour --preserve=%s" msgstr "raccourci pour --preserve=%s"
#: gcp:594 #: gcp:569
#, python-format #, python-format
msgid "" msgid ""
"preserve specified attributes; accepted values: 'all', or " "preserve specified attributes; accepted values: 'all', or one or more "
"one or more amongst %s" "amongst %s"
msgstr "" msgstr ""
"préserver les attributs spécifiés; valeurs acceptées : 'all' ou un ou " "préserver les attributs spécifiés; valeurs acceptées : "
"plusieurs éléments parmi %s" "'all' ou un ou plusieurs éléments parmi %s"
#: gcp:599 #: gcp:574
msgid "copy directories recursively" msgid "always follow symbolic links in sources"
msgstr "copier les répertoire récursivement"
#: gcp:603
msgid "display what is being done"
msgstr "afficher les opérations effectuées"
#: gcp:614
msgid ""
"fix file names incompatible with the destination file "
"system (default: auto)"
msgstr "" msgstr ""
"corriger les noms de fichiers incompatibles avec le système de fichiers "
"cible (défaut : auto)"
#: gcp:619 #: gcp:578
msgid "" msgid "never follow symbolic links in sources"
"[DEPRECATED] same as --fix-filename=no (overrides --fix-"
"filenames)"
msgstr "" msgstr ""
"[OBSOLÈTE] identique à --fix-filenames=no (--fix-filenames sera ignoré)"
#: gcp:624 #: gcp:586
msgid "fix filesystem name incompatibily (default: auto)"
msgstr ""
#: gcp:590
msgid "same as --fs-fix=no (overrides --fs-fix)"
msgstr "raccourci pour --fs-fix=no (--fs-fix sera ignoré)"
#: gcp:594
msgid "disable progress bar" msgid "disable progress bar"
msgstr "désactiver la barre de progression" msgstr "désactiver la barre de progression"
#: gcp:631 #: gcp:598
msgid "save sources arguments" msgid "Show what is currently done"
msgstr "afficher les opérations effectuées"
#: gcp:607
msgid "Save source arguments"
msgstr "sauvegarder la liste des fichiers source" msgstr "sauvegarder la liste des fichiers source"
#: gcp:635 #: gcp:611
msgid "save sources arguments and replace memory if it already exists" msgid "Save source arguments and replace memory if it already exists"
msgstr "" msgstr ""
"sauvegarder la liste des fichiers source et la remplacer si elle existe déjà" "sauvegarder la liste des fichiers source et la remplacer si elle existe déjà"
#: gcp:639 #: gcp:615
msgid "load sources arguments" msgid "Load source arguments"
msgstr "réutiliser les fichiers source à copier" msgstr "réutiliser les fichiers source à copier"
#: gcp:643 #: gcp:619
msgid "delete saved sources list" msgid "delete saved sources"
msgstr "supprimer la liste des fichiers source" msgstr "supprimer la liste des fichiers source"
#: gcp:647 #: gcp:623
msgid "list names of saved sources" msgid "List names of saved sources"
msgstr "afficher les noms des listes de fichiers source" msgstr "afficher les noms des listes de fichiers source"
#: gcp:651 #: gcp:627
msgid "list names of saved sources and files in it" msgid "List names of saved sources and files in it"
msgstr "" msgstr ""
"afficher les noms des listes de fichiers sources, en incluant les fichiers " "afficher les noms des listes de fichiers sources, en incluant les fichiers "
"qu'elles contiennent" "qu'elles contiennent"
#: gcp:663 #: gcp:639
msgid "Progress bar is not available, deactivating" msgid "Progress bar is not available, deactivating"
msgstr "La barre de progression n'est pas disponible, désactivation" msgstr "La barre de progression n'est pas disponible, désactivation"
#: gcp:687 #: gcp:663
#, python-format #, python-format
msgid "Invalid --preserve value '%s'" msgid "Invalid --preserve value '%s'"
msgstr "Valeur de --preserve invalide « %s »" msgstr "Valeur de --preserve invalide « %s »"
#: gcp:714 #: gcp:690
#, python-format #, python-format
msgid "There is already one instance of %s running, pluging to it" msgid "There is already one instance of %s running, pluging to it"
msgstr "Il y a déjà une instance de %s lancée, je m'y connecte" msgstr "Il y a déjà une instance de %s lancée, je m'y connecte"
#: gcp:720 #: gcp:696
msgid "Wrong number of arguments" msgid "Wrong number of arguments"
msgstr "Nombre d'arguments invalide" msgstr "Nombre d'arguments invalide"
#: gcp:722 #: gcp:698
#, python-format #, python-format
msgid "adding args to gcp: %s" msgid "adding args to gcp: %s"
msgstr "ajout des arguments à gcp : %s" msgstr "ajout des arguments à gcp : %s"
#: gcp:731 #: gcp:707
msgid "User interruption: good bye" msgid "User interruption: good bye"
msgstr "Interruption par l'utilisateur : au revoir" msgstr "Interruption par l'utilisateur : au revoir"

106
gcp
View File

@ -1,7 +1,7 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
""" """
gcp: Gcp CoPier gcp: Goffi's CoPier
Copyright (c) 2010, 2011 Jérôme Poisson <goffi@goffi.org> Copyright (c) 2010, 2011 Jérôme Poisson <goffi@goffi.org>
(c) 2011 Thomas Preud'homme <robotux@celest.fr> (c) 2011 Thomas Preud'homme <robotux@celest.fr>
(c) 2016 Jingbei Li <i@jingbei.li> (c) 2016 Jingbei Li <i@jingbei.li>
@ -55,7 +55,7 @@ except ImportError as e:
info (_('Progress bar deactivated\n--\n')) info (_('Progress bar deactivated\n--\n'))
pbar_available=False pbar_available=False
NAME = "gcp (Gcp CoPier)" NAME = "gcp (Goffi's copier)"
NAME_SHORT = "gcp" NAME_SHORT = "gcp"
VERSION = '0.2.0' VERSION = '0.2.0'
@ -264,7 +264,7 @@ class GCP():
@param path: absolute path of dir @param path: absolute path of dir
@param options: options as return by optparse""" @param options: options as return by optparse"""
#We first check that the dest path exists, and create it if needed #We first check that the dest path exists, and create it if needed
dest_path = self.__fix_filenames(dest_path, options, no_journal=True) dest_path = self.__filename_fix(dest_path, options, no_journal=True)
if not os.path.exists(dest_path): if not os.path.exists(dest_path):
debug ("Creating directory %s" % dest_path) debug ("Creating directory %s" % dest_path)
os.makedirs(dest_path) #TODO: check permissions os.makedirs(dest_path) #TODO: check permissions
@ -340,10 +340,10 @@ class GCP():
filename = os.path.basename(source_file) filename = os.path.basename(source_file)
assert(filename) assert(filename)
if options.dest_file: if options.dest_file:
dest_file = self.__fix_filenames(options.dest_file, options) dest_file = self.__filename_fix(options.dest_file, options)
else: else:
dest_file = self.__fix_filenames(os.path.join(dest_path, filename), dest_file = self.__filename_fix(os.path.join(dest_path, filename),
options) options)
if os.path.exists(dest_file) and not options.force: if os.path.exists(dest_file) and not options.force:
warning (_("File [%s] already exists, skipping it!") % dest_file) warning (_("File [%s] already exists, skipping it!") % dest_file)
self.journal.copyFailed() self.journal.copyFailed()
@ -417,7 +417,7 @@ class GCP():
except KeyboardInterrupt: except KeyboardInterrupt:
self._userInterruption() self._userInterruption()
def __fix_filenames(self, filename, options, no_journal=False): def __filename_fix(self, filename, options, no_journal=False):
"""Fix filenames incompatibilities/mistake according to options """Fix filenames incompatibilities/mistake according to options
@param filename: full path to the file @param filename: full path to the file
@param options: options as parsed on command line @param options: options as parsed on command line
@ -425,7 +425,7 @@ class GCP():
@return: fixed filename""" @return: fixed filename"""
fixed_filename = filename fixed_filename = filename
if options.fix_filenames == 'force' or (options.fix_filenames == 'auto' and self.getFsType(filename) == 'vfat'): if options.fs_fix == 'force' or (options.fs_fix == 'auto' and self.getFsType(filename) == 'vfat'):
fixed_filename = filename.replace('\\','_')\ fixed_filename = filename.replace('\\','_')\
.replace(':',';')\ .replace(':',';')\
.replace('*','+')\ .replace('*','+')\
@ -561,6 +561,8 @@ class GCP():
_usage=""" _usage="""
%(prog)s [options] FILE DEST %(prog)s [options] FILE DEST
%(prog)s [options] FILE1 [FILE2 ...] DEST-DIR %(prog)s [options] FILE1 [FILE2 ...] DEST-DIR
%(prog)s --help for options list
""" """
for idx in range(len(full_args)): for idx in range(len(full_args)):
full_args[idx] = full_args[idx].encode('utf-8') full_args[idx] = full_args[idx].encode('utf-8')
@ -568,87 +570,79 @@ class GCP():
parser = ArgumentParser(usage=_usage, parser = ArgumentParser(usage=_usage,
formatter_class=RawDescriptionHelpFormatter) formatter_class=RawDescriptionHelpFormatter)
parser.add_argument("-V", "--version", parser.add_argument("-r", "-R", "--recursive",
action="version", version=ABOUT
)
group_cplike = parser.add_argument_group("cp-like options")
group_cplike.add_argument("-f", "--force",
action="store_true", default=False,
help=_("force overwriting of existing files")
)
group_cplike.add_argument("-L", "--dereference",
action="store_true", default=False,
help=_("always follow symbolic links in sources")
)
group_cplike.add_argument("-P", "--no-dereference",
action="store_false", dest='dereference',
help=_("never follow symbolic links in sources")
)
group_cplike.add_argument("-p",
action="store_true", default=False,
help=_("same as --preserve=%s" % const_PRESERVE_p)
)
group_cplike.add_argument("--preserve",
action="store", default='',
help=_("preserve specified attributes; accepted values: \
'all', or one or more amongst %s") % str(const_PRESERVE)
)
group_cplike.add_argument("-r", "-R", "--recursive",
action="store_true", default=False, action="store_true", default=False,
help=_("copy directories recursively") help=_("copy directories recursively")
) )
group_cplike.add_argument("-v", "--verbose", parser.add_argument("-f", "--force",
action="store_true", default=False, action="store_true", default=False,
help=_("display what is being done") help=_("force overwriting of existing files")
)
parser.add_argument("-p",
action="store_true", default=False,
help=_("same as --preserve=%s" % const_PRESERVE_p)
)
parser.add_argument("--preserve",
action="store", default='',
help=_("preserve specified attributes; accepted values: \
'all', or one or more amongst %s") % str(const_PRESERVE)
)
parser.add_argument("-L", "--dereference",
action="store_true", default=False,
help=_("always follow symbolic links in sources")
)
parser.add_argument("-P", "--no-dereference",
action="store_false", dest='dereference',
help=_("never follow symbolic links in sources")
) )
parser.add_argument_group(group_cplike)
group_gcpspecific = parser.add_argument_group("gcp-specific options")
#parser.add_argument("--no-unicode-fix", #parser.add_argument("--no-unicode-fix",
# action="store_false", dest='unicode_fix', default=True, # action="store_false", dest='unicode_fix', default=True,
# help=_("don't fix name encoding errors") #TODO # help=_("don't fix name encoding errors") #TODO
#) #)
group_gcpspecific.add_argument("--fix-filenames", parser.add_argument("--fs-fix",
choices = const_FS_FIX, dest='fix_filenames', default='auto', choices = const_FS_FIX, dest='fs_fix', default='auto',
help=_("fix file names incompatible with the destination \ help=_("fix filesystem name incompatibily (default: auto)")
file system (default: auto)")
) )
group_gcpspecific.add_argument("--no-fs-fix", parser.add_argument("--no-fs-fix",
action="store_true", dest='no_fs_fix', default=False, action="store_true", dest='no_fs_fix', default=False,
help=_("[DEPRECATED] same as --fix-filename=no (overrides \ help=_("same as --fs-fix=no (overrides --fs-fix)")
--fix-filenames)")
) )
group_gcpspecific.add_argument("--no-progress", parser.add_argument("--no-progress",
action="store_false", dest="progress", default=True, action="store_false", dest="progress", default=True,
help=_("disable progress bar") help=_("disable progress bar")
) )
parser.add_argument_group(group_gcpspecific) parser.add_argument("-v", "--verbose",
action="store_true", default=False,
help=_("Show what is currently done")
)
parser.add_argument("-V", "--version",
action="version", version=ABOUT
)
group_saving = parser.add_argument_group("sources saving") group_saving = parser.add_argument_group("sources saving")
group_saving.add_argument("--sources-save", group_saving.add_argument("--sources-save",
action="store", action="store",
help=_("save sources arguments") help=_("Save source arguments")
) )
group_saving.add_argument("--sources-replace", group_saving.add_argument("--sources-replace",
action="store", action="store",
help=_("save sources arguments and replace memory if it already exists") help=_("Save source arguments and replace memory if it already exists")
) )
group_saving.add_argument("--sources-load", group_saving.add_argument("--sources-load",
action="store", action="store",
help=_("load sources arguments") help=_("Load source arguments")
) )
group_saving.add_argument("--sources-del", group_saving.add_argument("--sources-del",
action="store", action="store",
help=_("delete saved sources list") help=_("delete saved sources")
) )
group_saving.add_argument("--sources-list", group_saving.add_argument("--sources-list",
action="store_true", default=False, action="store_true", default=False,
help=_("list names of saved sources") help=_("List names of saved sources")
) )
group_saving.add_argument("--sources-full-list", group_saving.add_argument("--sources-full-list",
action="store_true", default=False, action="store_true", default=False,
help=_("list names of saved sources and files in it") help=_("List names of saved sources and files in it")
) )
parser.add_argument_group(group_saving) parser.add_argument_group(group_saving)
@ -669,7 +663,7 @@ class GCP():
logging.getLogger().setLevel(logging.DEBUG) logging.getLogger().setLevel(logging.DEBUG)
if options.no_fs_fix: if options.no_fs_fix:
options.fix_filenames = 'no' options.fs_fix = 'no'
preserve = set() preserve = set()

159
gcp.1
View File

@ -2,7 +2,7 @@
.\" First parameter, NAME, should be all caps .\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1) .\" other parameters are allowed: see man(7), man(1)
.TH GCP 1 "October 14, 2018" .TH GCP 1 "June 04, 2011"
.\" Please adjust this date whenever revising the manpage. .\" Please adjust this date whenever revising the manpage.
.\" .\"
.\" Some roff macros, for reference: .\" Some roff macros, for reference:
@ -15,9 +15,6 @@
.\" .br insert line break .\" .br insert line break
.\" .sp <n> insert n+1 empty lines .\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7) .\" for manpage-specific macros, see man(7)
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
.\" respectively.
.SH NAME .SH NAME
gcp \- Advanced command-line file copier gcp \- Advanced command-line file copier
.SH SYNOPSIS .SH SYNOPSIS
@ -31,109 +28,77 @@ gcp \- Advanced command-line file copier
.RI [ FILE2 ... ] .RI [ FILE2 ... ]
.I DEST-DIR .I DEST-DIR
.SH DESCRIPTION .SH DESCRIPTION
\fBgcp\fP is a file copier, loosely inspired by cp, but with high level This manual page documents briefly the
functionalities like: .B gcp
.IP \(bu 2 command.
transfer progression indication .PP
.IP \(bu .\" TeX users may be more comfortable with the \fB<whatever>\fP and
continuous copying when there is an issue: it skips the problematic file and .\" \fI<whatever>\fP escape sequences to invode bold face and italics,
goes on .\" respectively.
.IP \(bu \fBgcp\fP is a file copier, loosely inspired by cp, but with high level functionalities like:
copy status logging: which files were effectively copied \- transfer progression indication
.IP \(bu \- continuous copying when there is an issue: it skips the problematic file and goes on
name mangling to handle target filesystem limitations (e.g. removing \- copy status logging: which files were effectively copied
incompatible chars like "?" or "*" on FAT filesystems) \- name mangling to handle target filesystem limitations (e.g. removing incompatible chars like "?" or "*" on vfat)
.IP \(bu \- forced copy serialization: new files to copy are added to a global queue to avoid hard drive head seeks
forced copy serialization: new files to copy are added to a global queue to \- transfer list management: gcp can save a list of files to copy and reuse it later
avoid hard drive head seeks \- approximate option compatibility with cp (approximate because the behaviour is not exactly the same, see below)
.IP \(bu
transfer list management: gcp can save a list of files to copy and reuse it
later
.IP \(bu
approximate option compatibility with cp (approximate because the behaviour is
not exactly the same, see below)
.SH OPTIONS .SH OPTIONS
These programs follow the usual GNU command line syntax, with long These programs follow the usual GNU command line syntax, with long
options starting with two dashes (`-'). options starting with two dashes (`-').
By default, calling gcp is equivalent to calling gcp \-\-preserve=mode,ownership,timestamps.
.PP .PP
A summary of options is included below. A summary of options is included below.
.SS General options .SS "General options"
.TP
.B \-\-version
Show version of program and exit.
.TP .TP
.B \-h, \-\-help .B \-h, \-\-help
Show summary of options. Show summary of options.
.TP .TP
.B \-V, \-\-version .B \-r, \-R, \-\-recursive
Show program version and copyright information and exit. Copy directories recursively.
.SS cp-like options .TP
.B \-L, \-\-dereference
always follow symbolic links in sources
.TP
.B \-P, \-\-no\-dereference
never follow symbolic links in sources
.TP .TP
.B \-f, \-\-force .B \-f, \-\-force
Overwrite existing files. Overwrite existing files.
.TP .TP
.B \-L, \-\-dereference
Always follow symbolic links in sources.
.TP
.B \-P, \-\-no\-dereference
Never follow symbolic links in sources.
.TP
.B \-p .B \-p
Same as \fB\-\-preserve=mode,ownership,timestamps\fP Same as \-\-preserve=mode,ownership,timestamps
.TP .TP
.B \-\-preserve=<\fIattributes\fP> .B \-\-preserve=PRESERVE
Preserve specified attributes. Attributes can be \fImode\fP, \fIownership\fP Keep specified attributes. Attributes can be mode, ownership and timestamps.
and \fItimestamps\fP. When several attributes are passed, they need to be separated by commas. Note
When several attributes are passed, they need to be separated by commas. that timestamps preservation has some limits, see section LIMITATIONS.
Please note that timestamps preservation has some limits, see section
\fILIMITATIONS\fP.
.TP .TP
.B \-r, \-R, \-\-recursive .B \-\-no\-fs\-fix
Copy directories recursively. Don't fix file system naming incompatibilities.
.TP
.B \-v, \-\-verbose
Display what is being done.
.SS gcp-specific options
.TP
.B \-\-fix\-filenames=<\fIforce\fP|\fIauto\fP|\fIno\fP>
gcp has the ability to modify the destination file name if the target file
system would not accept the original file name.
Offending characters will be replaced with similar-looking ones.
.IP
This option accept the following values:
.RS
.TP
\fIauto\fP (default)
gcp will attempt to be smart, i.e. detect incompatibilities and fix them as-needed.
.TP
\fIforce\fP
Always fix file names that could cause problems on any known filesystem or OS.
This is useful e.g. with NTFS, see \fINOTE ON NTFS\fP below.
.TP
\fIno\fP
Renaming is disabled entirely.
.RE
.IP
Currently, gcp is only aware of FAT incompatibilities:
\'\\\', \':\', \'*\', \'?\', \'"\', \'<\', \'>\' and \'|\'.
.TP
.B \-\-no\-fs\-fix (DEPRECATED)
Same as \fB\-\-fix\-filenames=no\fP.
This option will be removed in a future release.
.TP .TP
.B \-\-no\-progress .B \-\-no\-progress
Disable progress bar. Disable progress bar.
.SS Sources saving
.TP .TP
.B \-\-sources\-save=\fISOURCES\fP .B \-v, \-\-verbose
Save the list of source files in a list named \fISOURCES\fP. Display what is being done.
.SS "Sources saving"
.TP .TP
.B \-\-sources\-replace=\fISOURCES\fP .B \-\-sources\-save=SOURCES_SAVE
Save the list of source files in a list named \fISOURCES\fP; Save the list of source files in a list named SOURCES_SAVE.
the file is overwritten it already exists.
.TP .TP
.B \-\-sources\-load=\fISOURCES\fP .B \-\-sources\-replace=SOURCES_REPLACE
Use the list of source files named \fISOURCES\fP. Save the list of source files in a list named SOURCES_REPLACE and
replace it if it already exists.
.TP .TP
.B \-\-sources\-del=\fISOURCES\fP .B \-\-sources\-load=SOURCES_LOAD
Delete the list of source files named \fISOURCES\fP. Reuse the list of source file named SOURCES_LOAD.
.TP
.B \-\-sources\-del=SOURCES_DEL
Delete the list of source files named SOURCES_DEL.
.TP .TP
.B \-\-sources\-list .B \-\-sources\-list
List the names of source file lists. List the names of source file lists.
@ -143,33 +108,21 @@ List the names of source file lists, including their content.
.SH EXIT STATUS .SH EXIT STATUS
The exit status can be: The exit status can be:
.IP \[bu] 2 .IP \[bu] 2
\fB0\fP if files have been copied correctly or if another instance of gcp is \fB0\fP if files have been copied correctly or if another instance of gcp is already running and will do the copy.
already running and will do the copy.
.IP \[bu] .IP \[bu]
\fB1\fP if at least one file has not been copied, or if something went wrong. \fB1\fP if at least one file has not been copied, or if something went wrong.
.IP \[bu] .IP \[bu]
\fB2\fP if all files have been copied but with some issues \fB2\fP if all files have been copied but with some issues
.SH LIMITATIONS .SH LIMITATIONS
Timestamps preservation with \fB\-\-preserve\fP option is limited by the Timestamps preservation with \-\-preserve option is limited by the os python
\fIos\fP Python module on POSIX systems. Currently, Python only returns module on POSIX systems. Currently, python only returns timestamps in float
timestamps in float format, which is a smaller precision than what POSIX format, which is a smaller precision than what POSIX provides. Progress on this
provides. Progress on this issue can be seen at issue can be seen at http://bugs.python.org/issue11457.
http://bugs.python.org/issue11457.
.PP
The \fB\-\-preserve\fP option cannot currently be used without an attribute
list (\fBgcp \-\-preserve foo bar\fP will behave as \fBgcp \-\-preserve=foo
bar\fP). Use the \fB\-p\fP switch instead.
.SH NOTE ON NTFS
NTFS will not enforce the same file name limitations than FAT, but files that
would not be accepted on a FAT filesystem will still cause problems on Windows.
Hence, it is recommended to use \-\-fix-filenames=force when copying to NTFS
(when Windows compatibility is desired, anyway).
.SH SEE ALSO .SH SEE ALSO
.BR cp (1). .BR cp (1).
.br .br
.SH AUTHOR .SH AUTHOR
gcp was written by Jérôme Poisson <goffi@goffi.org>. gcp was written by Jérôme Poisson <goffi@goffi.org>.
It is currently maintained by Matteo Cypriani <mcy@lm7.fr>.
.PP .PP
This manual page was initially written by Thomas Preud'homme This manual page was written by Thomas Preud'homme <robotux@celest.fr>,
<robotux@celest.fr> for the Debian project (and may be used by others). for the Debian project (and may be used by others).

View File

@ -1,265 +1,262 @@
# gcp -- translation template # SOME DESCRIPTIVE TITLE.
# # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the gcp package. # This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# #
#, fuzzy #, fuzzy
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 0.2.0\n" "Project-Id-Version: 0.2.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-10-14 20:51+0200\n" "POT-Creation-Date: 2018-04-22 20:09+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"Language: en\n" "Language: English\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: gcp:46 #: gcp:45
msgid "Error during import" msgid "Error during import"
msgstr "" msgstr ""
#: gcp:47 #: gcp:46
msgid "Please check dependecies:" msgid "Please check dependecies:"
msgstr "" msgstr ""
#: gcp:54 #: gcp:52
msgid "ProgressBar not available, please download it at https://pypi.org/" msgid "ProgressBar not available, please download it at https://pypi.org/"
msgstr "" msgstr ""
#: gcp:55 #: gcp:3
msgid "" msgid ""
"Progress bar deactivated\n" "Progress bar deactivated\n"
"--\n" "--\n"
msgstr "" msgstr ""
#: gcp:90 #: gcp:88
msgid "Init DbusObject..." msgid "Init DbusObject..."
msgstr "" msgstr ""
#: gcp:111 #: gcp:109
msgid "INTERNAL ERROR: invalid arguments" msgid "INTERNAL ERROR: invalid arguments"
msgstr "" msgstr ""
#: gcp:116 #: gcp:114
msgid "INTERNAL ERROR: invalid source_dir" msgid "INTERNAL ERROR: invalid source_dir"
msgstr "" msgstr ""
#: gcp:171 #: gcp:169
msgid "/!\\ THE FOLLOWING FILES WERE *NOT* SUCCESSFULY COPIED:" msgid "/!\\ THE FOLLOWING FILES WERE *NOT* SUCCESSFULY COPIED:"
msgstr "" msgstr ""
#: gcp:177 #: gcp:175
msgid "The following files were copied, but some errors happened:" msgid "The following files were copied, but some errors happened:"
msgstr "" msgstr ""
#: gcp:183 #: gcp:181
#, python-format #, python-format
msgid "Please check journal: %s" msgid "Please check journal: %s"
msgstr "" msgstr ""
#: gcp:205 #: gcp:203
msgid "gcp launched" msgid "gcp launched"
msgstr "" msgstr ""
#: gcp:213 #: gcp:211
msgid "Init DBus..." msgid "Init DBus..."
msgstr "" msgstr ""
#: gcp:244 #: gcp:241
msgid "Can't read mounts table" msgid "Can't read mounts table"
msgstr "" msgstr ""
#: gcp:251 #: gcp:248
#, python-format #, python-format
msgid "Adding to copy list: %(path)s ==> %(dest_path)s (%(fs_type)s)" msgid "Adding to copy list: %(path)s ==> %(dest_path)s (%(fs_type)s)"
msgstr "" msgstr ""
#: gcp:258 #: gcp:253
#, python-format #, python-format
msgid "Can't copy %(path)s: %(exception)s" msgid "Can't copy %(path)s: %(exception)s"
msgstr "" msgstr ""
#: gcp:286 #: gcp:280
#, python-format #, python-format
msgid "Can't append %(path)s to copy list: %(exception)s" msgid "Can't append %(path)s to copy list: %(exception)s"
msgstr "" msgstr ""
#: gcp:289 #: gcp:283
#, python-format #, python-format
msgid "Can't access %(dirpath)s: %(exception)s" msgid "Can't access %(dirpath)s: %(exception)s"
msgstr "" msgstr ""
#: gcp:301 #: gcp:295
#, python-format #, python-format
msgid "Invalid dest_path: %s" msgid "Invalid dest_path: %s"
msgstr "" msgstr ""
#: gcp:306 #: gcp:300
#, python-format #, python-format
msgid "The path given in arg doesn't exist or is not accessible: %s" msgid "The path given in arg doesn't exist or is not accessible: %s"
msgstr "" msgstr ""
#: gcp:310 #: gcp:304
#, python-format #, python-format
msgid "omitting directory \"%s\"" msgid "omitting directory \"%s\""
msgstr "" msgstr ""
#: gcp:348 #: gcp:329
#, python-format #, python-format
msgid "File [%s] already exists, skipping it!" msgid "File [%s] already exists, skipping it!"
msgstr "" msgstr ""
#: gcp:368 #: gcp:347
#, python-format #, python-format
msgid "COPYING %(source)s ==> %(dest)s" msgid "COPYING %(source)s ==> %(dest)s"
msgstr "" msgstr ""
#: gcp:462 #: gcp:447
#, python-format #, python-format
msgid "%.2f PiB" msgid "%.2f PiB"
msgstr "" msgstr ""
#: gcp:464 #: gcp:449
#, python-format #, python-format
msgid "%.2f TiB" msgid "%.2f TiB"
msgstr "" msgstr ""
#: gcp:466 #: gcp:451
#, python-format #, python-format
msgid "%.2f GiB" msgid "%.2f GiB"
msgstr "" msgstr ""
#: gcp:468 #: gcp:453
#, python-format #, python-format
msgid "%.2f MiB" msgid "%.2f MiB"
msgstr "" msgstr ""
#: gcp:470 #: gcp:455
#, python-format #, python-format
msgid "%.2f KiB" msgid "%.2f KiB"
msgstr "" msgstr ""
#: gcp:471 #: gcp:457
#, python-format #, python-format
msgid "%i B" msgid "%i B"
msgstr "" msgstr ""
#: gcp:479 gcp:485 #: gcp:465 gcp:470
#, python-format #, python-format
msgid "Copying %s" msgid "Copying %s"
msgstr "" msgstr ""
#: gcp:515 gcp:548 #: gcp:497 gcp:530
msgid "" msgid ""
"No saved sources with this name, check existing names with --sources-list" "No saved sources with this name, check existing names with --sources-list"
msgstr "" msgstr ""
#: gcp:525 #: gcp:507
msgid "Saved sources:" msgid "Saved sources:"
msgstr "" msgstr ""
#: gcp:539 #: gcp:521
msgid "" msgid ""
"There is already a saved sources with this name, skipping --sources-save" "There is already a saved sources with this name, skipping --sources-save"
msgstr "" msgstr ""
#: gcp:578 #: gcp:557
msgid "copy directories recursively"
msgstr ""
#: gcp:561
msgid "force overwriting of existing files" msgid "force overwriting of existing files"
msgstr "" msgstr ""
#: gcp:582 #: gcp:565
msgid "always follow symbolic links in sources"
msgstr ""
#: gcp:586
msgid "never follow symbolic links in sources"
msgstr ""
#: gcp:590
#, python-format #, python-format
msgid "same as --preserve=%s" msgid "same as --preserve=%s"
msgstr "" msgstr ""
#: gcp:594 #: gcp:569
#, python-format #, python-format
msgid "" msgid ""
"preserve specified attributes; accepted values: 'all', or " "preserve specified attributes; accepted values: 'all', or one or more "
"one or more amongst %s" "amongst %s"
msgstr "" msgstr ""
#: gcp:599 #: gcp:574
msgid "copy directories recursively" msgid "always follow symbolic links in sources"
msgstr "" msgstr ""
#: gcp:603 #: gcp:578
msgid "display what is being done" msgid "never follow symbolic links in sources"
msgstr "" msgstr ""
#: gcp:614 #: gcp:586
msgid "" msgid "fix filesystem name incompatibily (default: auto)"
"fix file names incompatible with the destination file "
"system (default: auto)"
msgstr "" msgstr ""
#: gcp:619 #: gcp:590
msgid "" msgid "same as --fs-fix=no (overrides --fs-fix)"
"[DEPRECATED] same as --fix-filename=no (overrides --fix-"
"filenames)"
msgstr "" msgstr ""
#: gcp:624 #: gcp:594
msgid "disable progress bar" msgid "disable progress bar"
msgstr "" msgstr ""
#: gcp:631 #: gcp:598
msgid "save sources arguments" msgid "Show what is currently done"
msgstr "" msgstr ""
#: gcp:635 #: gcp:607
msgid "save sources arguments and replace memory if it already exists" msgid "Save source arguments"
msgstr ""
#: gcp:611
msgid "Save source arguments and replace memory if it already exists"
msgstr ""
#: gcp:615
msgid "Load source arguments"
msgstr ""
#: gcp:619
msgid "delete saved sources"
msgstr ""
#: gcp:623
msgid "List names of saved sources"
msgstr ""
#: gcp:627
msgid "List names of saved sources and files in it"
msgstr "" msgstr ""
#: gcp:639 #: gcp:639
msgid "load sources arguments"
msgstr ""
#: gcp:643
msgid "delete saved sources list"
msgstr ""
#: gcp:647
msgid "list names of saved sources"
msgstr ""
#: gcp:651
msgid "list names of saved sources and files in it"
msgstr ""
#: gcp:663
msgid "Progress bar is not available, deactivating" msgid "Progress bar is not available, deactivating"
msgstr "" msgstr ""
#: gcp:687 #: gcp:663
#, python-format #, python-format
msgid "Invalid --preserve value '%s'" msgid "Invalid --preserve value '%s'"
msgstr "" msgstr ""
#: gcp:714 #: gcp:690
#, python-format #, python-format
msgid "There is already one instance of %s running, pluging to it" msgid "There is already one instance of %s running, pluging to it"
msgstr "" msgstr ""
#: gcp:720 #: gcp:696
msgid "Wrong number of arguments" msgid "Wrong number of arguments"
msgstr "" msgstr ""
#: gcp:722 #: gcp:698
#, python-format #, python-format
msgid "adding args to gcp: %s" msgid "adding args to gcp: %s"
msgstr "" msgstr ""
#: gcp:731 #: gcp:707
msgid "User interruption: good bye" msgid "User interruption: good bye"
msgstr "" msgstr ""

Binary file not shown.

View File

@ -41,9 +41,9 @@ setuptools.setup(
# 'console_scripts': ['gcp=gcp:main'], # 'console_scripts': ['gcp=gcp:main'],
# }, # },
data_files=[ data_files=[
('man/man1', ["gcp.1"]),
('share/locale/fr/LC_MESSAGES', ['i18n/fr/LC_MESSAGES/gcp.mo']), ('share/locale/fr/LC_MESSAGES', ['i18n/fr/LC_MESSAGES/gcp.mo']),
('share/doc/%s' % name, ['CHANGELOG', 'LICENSE', 'README.md']), ('share/man/man1', ["gcp.1"]),
('share/doc/%s' % name, ['CHANGELOG', 'LICENSE.txt', 'README.md']),
], ],
install_requires=['PyGObject', 'dbus-python'], install_requires=['PyGObject', 'dbus-python'],
python_requires='>=3', python_requires='>=3',

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
""" """
gcp: Gcp CoPier -- unit tests gcp: Goffi's CoPier -- unit tests
Copyright (c) 2010, 2011 Jérôme Poisson <goffi@goffi.org> Copyright (c) 2010, 2011 Jérôme Poisson <goffi@goffi.org>
Copyright (c) 2018 Matteo Cypriani <mcy@lm7.fr> Copyright (c) 2018 Matteo Cypriani <mcy@lm7.fr>
@ -239,19 +239,6 @@ class TestCopyCases(unittest.TestCase):
check_after = dirCheck('.') check_after = dirCheck('.')
self.assertEqual(check_before, check_after) self.assertEqual(check_before, check_after)
def test_fix_filenames(self):
"""Checks the --fix-filenames option.
"""
source = 'wi||fat<like>this:"file*name"?'
fixed_name = 'wi!!fat[like]this;\'file+name\'_'
makeRandomFile(source, S10K)
source_sha = sha1sum(source)
mkdir('dest_dir')
ret = system(GCP + " --fix-filenames=force '" + source + "' dest_dir")
self.assertNotEqual(ret, 0)
dest = join('dest_dir', fixed_name)
dest_sha = sha1sum(dest)
self.assertEqual(source_sha, dest_sha)
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()