diff options
-rw-r--r-- | lib/backup-files.c | 24 | ||||
-rw-r--r-- | po/de.po | 22 | ||||
-rw-r--r-- | po/fr.po | 22 | ||||
-rw-r--r-- | po/ja.po | 22 | ||||
-rw-r--r-- | po/quilt.pot | 22 | ||||
-rw-r--r-- | quilt.changes | 7 | ||||
-rw-r--r-- | quilt/pop.in | 14 | ||||
-rw-r--r-- | quilt/scripts/patchfns.in | 20 |
8 files changed, 77 insertions, 76 deletions
diff --git a/lib/backup-files.c b/lib/backup-files.c index c7c716d..fe40a8a 100644 --- a/lib/backup-files.c +++ b/lib/backup-files.c @@ -1,7 +1,7 @@ /* File: backup-files.c - Copyright (C) 2003, 2004, 2005, 2006 + Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Andreas Gruenbacher <agruen@suse.de>, SuSE Labs This program is free software; you can redistribute it and/or @@ -68,6 +68,7 @@ enum { what_noop, what_backup, what_restore, what_remove }; const char *opt_prefix="", *opt_suffix="", *opt_file; int opt_silent, opt_what=what_noop; int opt_nolinks, opt_touch; +int opt_keep_backup; #define LINE_LENGTH 1024 @@ -75,7 +76,7 @@ int opt_nolinks, opt_touch; static void usage(void) { - printf("Usage: %s [-B prefix] [-z suffix] [-f {file|-}] [-s] [-b|-r|-x] [-t] [-L] {file|-} ...\n" + printf("Usage: %s [-B prefix] [-z suffix] [-f {file|-}] [-sktL] [-b|-r|-x] {file|-} ...\n" "\n" "\tCreate hard linked backup copies of a list of files\n" "\tread from standard input.\n" @@ -83,6 +84,7 @@ usage(void) "\t-b\tCreate backup\n" "\t-r\tRestore the backup\n" "\t-x\tRemove backup files and empty parent directories\n" + "\t-k\tWhen doing a restore, keep the backup files\n" "\t-B\tPath name prefix for backup files\n" "\t-z\tPath name suffix for backup files\n" "\t-s\tSilent operation; only print error messages\n" @@ -353,8 +355,10 @@ process_file(const char *file) perror(file); goto fail; } - unlink(backup); - remove_parents(backup); + if (!opt_keep_backup) { + unlink(backup); + remove_parents(backup); + } } else { if (!opt_silent) printf("Restoring %s\n", file); @@ -368,8 +372,10 @@ process_file(const char *file) if (opt_nolinks && ensure_nolinks(file)) goto fail; } - unlink(backup); - remove_parents(backup); + if (!opt_keep_backup) { + unlink(backup); + remove_parents(backup); + } if (opt_touch) (void) utime(file, NULL); else { @@ -487,7 +493,7 @@ main(int argc, char *argv[]) progname = argv[0]; - while ((opt = getopt(argc, argv, "brxB:z:f:shLt")) != -1) { + while ((opt = getopt(argc, argv, "brkxB:z:f:shLt")) != -1) { switch(opt) { case 'b': opt_what = what_backup; @@ -497,6 +503,10 @@ main(int argc, char *argv[]) opt_what = what_restore; break; + case 'k': + opt_keep_backup = 1; + break; + case 'x': opt_what = what_remove; break; @@ -962,41 +962,41 @@ msgstr "" "\n" "-v\tViele Meldungen ausgeben.\n" -#: quilt/pop.in:98 quilt/scripts/patchfns.in:894 +#: quilt/pop.in:100 quilt/scripts/patchfns.in:889 msgid "Failed to copy files to temporary directory\\n" msgstr "Konnte Dateien nicht in temporäres Verzeichnis kopieren\\n" -#: quilt/pop.in:122 quilt/scripts/patchfns.in:917 +#: quilt/pop.in:116 quilt/scripts/patchfns.in:907 msgid "Failed to patch temporary files\\n" msgstr "Konnte temporäre Dateien nicht patchen\\n" -#: quilt/pop.in:140 +#: quilt/pop.in:134 msgid "Patch %s does not remove cleanly (refresh it or enforce with -f)\\n" msgstr "" "Patch %s kann nicht entfernt werden (Patch aktualisieren oder entfernen " "erzwingen mit -f)\\n" -#: quilt/pop.in:165 +#: quilt/pop.in:159 msgid "Patch %s appears to be empty, removing\\n" msgstr "Patch %s scheint leer zu sein; wird entfernt\\n" -#: quilt/pop.in:170 +#: quilt/pop.in:164 msgid "Removing patch %s\\n" msgstr "Entferne patch %s\\n" -#: quilt/pop.in:241 +#: quilt/pop.in:235 msgid "Patch %s needs to be refreshed first.\\n" msgstr "Patch %s muss zuerst aktualisiert werden (Refresh).\\n" -#: quilt/pop.in:251 +#: quilt/pop.in:245 msgid "No patch removed\\n" msgstr "Kein Patch entfernt\\n" -#: quilt/pop.in:267 quilt/scripts/patchfns.in:508 +#: quilt/pop.in:261 quilt/scripts/patchfns.in:508 msgid "No patches applied\\n" msgstr "Keine Patches angewandt\\n" -#: quilt/pop.in:274 quilt/push.in:369 +#: quilt/pop.in:268 quilt/push.in:369 msgid "Now at patch %s\\n" msgstr "Jetzt in Patch %s\\n" @@ -1370,7 +1370,7 @@ msgstr "series-Datei vollständig angewandt, endet in Patch %s\\n" msgid "Patch %s does not exist\\n" msgstr "Patch %s existiert nicht\\n" -#: quilt/scripts/patchfns.in:950 +#: quilt/scripts/patchfns.in:940 msgid "" "The quilt meta-data in this tree has version %s, but this version of quilt " "can only handle meta-data formats up to and including version %s. Please pop " @@ -1383,7 +1383,7 @@ msgstr "" "quilt alle Patches mit der Version von quilt, die zur Erstellung des " "Arbeitsverzeichnisses verwendet wurde.\\n" -#: quilt/scripts/patchfns.in:1037 +#: quilt/scripts/patchfns.in:1027 msgid "" "The working tree was created by an older version of quilt. Please run 'quilt " "upgrade'.\\n" @@ -965,41 +965,41 @@ msgstr "" "\n" "-v\tOpre verbeusement.\n" -#: quilt/pop.in:98 quilt/scripts/patchfns.in:894 +#: quilt/pop.in:100 quilt/scripts/patchfns.in:889 msgid "Failed to copy files to temporary directory\\n" msgstr "Impossible de copier les fichiers dans le rpertoire temporaire\\n" -#: quilt/pop.in:122 quilt/scripts/patchfns.in:917 +#: quilt/pop.in:116 quilt/scripts/patchfns.in:907 msgid "Failed to patch temporary files\\n" msgstr "Impossible de patcher les fichiers temporaires\\n" -#: quilt/pop.in:140 +#: quilt/pop.in:134 msgid "Patch %s does not remove cleanly (refresh it or enforce with -f)\\n" msgstr "" "Le patch %s ne se retire pas proprement (rafraichissez le, ou forcez avec -f)" "\\n" -#: quilt/pop.in:165 +#: quilt/pop.in:159 msgid "Patch %s appears to be empty, removing\\n" msgstr "Le patch %s semble vide, enlev\\n" -#: quilt/pop.in:170 +#: quilt/pop.in:164 msgid "Removing patch %s\\n" msgstr "Retrait de %s\\n" -#: quilt/pop.in:241 +#: quilt/pop.in:235 msgid "Patch %s needs to be refreshed first.\\n" msgstr "Le patch %s doit tre rafraichi au pralable.\\n" -#: quilt/pop.in:251 +#: quilt/pop.in:245 msgid "No patch removed\\n" msgstr "Aucun patch retir\\n" -#: quilt/pop.in:267 quilt/scripts/patchfns.in:508 +#: quilt/pop.in:261 quilt/scripts/patchfns.in:508 msgid "No patches applied\\n" msgstr "Aucun patch n'est appliqu\\n" -#: quilt/pop.in:274 quilt/push.in:369 +#: quilt/pop.in:268 quilt/push.in:369 msgid "Now at patch %s\\n" msgstr "Le patch %s est maintenant au sommet\\n" @@ -1383,7 +1383,7 @@ msgstr "La srie est compltement applique. Le dernier patch est %s.\\n" msgid "Patch %s does not exist\\n" msgstr "Le patch %s n'existe pas\\n" -#: quilt/scripts/patchfns.in:950 +#: quilt/scripts/patchfns.in:940 msgid "" "The quilt meta-data in this tree has version %s, but this version of quilt " "can only handle meta-data formats up to and including version %s. Please pop " @@ -1395,7 +1395,7 @@ msgstr "" "format %s (inclus). Veuillez retirer vos patches avec la version \n" "utilise pour les appliquer avant d'installer une version plus ancienne.\\n" -#: quilt/scripts/patchfns.in:1037 +#: quilt/scripts/patchfns.in:1027 msgid "" "The working tree was created by an older version of quilt. Please run 'quilt " "upgrade'.\\n" @@ -930,41 +930,41 @@ msgstr "" "\n" "-v\t詳細に表示。\n" -#: quilt/pop.in:98 quilt/scripts/patchfns.in:894 +#: quilt/pop.in:100 quilt/scripts/patchfns.in:889 msgid "Failed to copy files to temporary directory\\n" msgstr "テンポラリディレクトリへのファイルコピーに失敗しました\\n" -#: quilt/pop.in:122 quilt/scripts/patchfns.in:917 +#: quilt/pop.in:116 quilt/scripts/patchfns.in:907 msgid "Failed to patch temporary files\\n" msgstr "テンポラリファイルへのパッチ適用に失敗しました\\n" -#: quilt/pop.in:140 +#: quilt/pop.in:134 msgid "Patch %s does not remove cleanly (refresh it or enforce with -f)\\n" msgstr "" "パッチ %s を、正常にはずすことができません (リフレッシュするか -fを付\n" "けてはずしてください)\\n" -#: quilt/pop.in:165 +#: quilt/pop.in:159 msgid "Patch %s appears to be empty, removing\\n" msgstr "パッチ %s は、空のようです。はずします\\n" -#: quilt/pop.in:170 +#: quilt/pop.in:164 msgid "Removing patch %s\\n" msgstr "パッチ %s をはずします\\n" -#: quilt/pop.in:241 +#: quilt/pop.in:235 msgid "Patch %s needs to be refreshed first.\\n" msgstr "最初に、パッチ %s のリフレッシュが必要です。\\n" -#: quilt/pop.in:251 +#: quilt/pop.in:245 msgid "No patch removed\\n" msgstr "適用されているパッチはありません\\n" -#: quilt/pop.in:267 quilt/scripts/patchfns.in:508 +#: quilt/pop.in:261 quilt/scripts/patchfns.in:508 msgid "No patches applied\\n" msgstr "適用されているパッチはありません\\n" -#: quilt/pop.in:274 quilt/push.in:369 +#: quilt/pop.in:268 quilt/push.in:369 msgid "Now at patch %s\\n" msgstr "現在位置はパッチ %s です\\n" @@ -1341,7 +1341,7 @@ msgstr "" msgid "Patch %s does not exist\\n" msgstr "パッチ %s が存在しません\\n" -#: quilt/scripts/patchfns.in:950 +#: quilt/scripts/patchfns.in:940 msgid "" "The quilt meta-data in this tree has version %s, but this version of quilt " "can only handle meta-data formats up to and including version %s. Please pop " @@ -1353,7 +1353,7 @@ msgstr "" "ていません。ダウングレードする前に、pushしたバージョンの quiltを使って、\n" "すべてのパッチを pop してください。\\n" -#: quilt/scripts/patchfns.in:1037 +#: quilt/scripts/patchfns.in:1027 msgid "" "The working tree was created by an older version of quilt. Please run 'quilt " "upgrade'.\\n" diff --git a/po/quilt.pot b/po/quilt.pot index 3aed9d3..691d873 100644 --- a/po/quilt.pot +++ b/po/quilt.pot @@ -637,39 +637,39 @@ msgid "" "-v\tVerbose operation.\n" msgstr "" -#: quilt/pop.in:98 quilt/scripts/patchfns.in:894 +#: quilt/pop.in:100 quilt/scripts/patchfns.in:889 msgid "Failed to copy files to temporary directory\\n" msgstr "" -#: quilt/pop.in:122 quilt/scripts/patchfns.in:917 +#: quilt/pop.in:116 quilt/scripts/patchfns.in:907 msgid "Failed to patch temporary files\\n" msgstr "" -#: quilt/pop.in:140 +#: quilt/pop.in:134 msgid "Patch %s does not remove cleanly (refresh it or enforce with -f)\\n" msgstr "" -#: quilt/pop.in:165 +#: quilt/pop.in:159 msgid "Patch %s appears to be empty, removing\\n" msgstr "" -#: quilt/pop.in:170 +#: quilt/pop.in:164 msgid "Removing patch %s\\n" msgstr "" -#: quilt/pop.in:241 +#: quilt/pop.in:235 msgid "Patch %s needs to be refreshed first.\\n" msgstr "" -#: quilt/pop.in:251 +#: quilt/pop.in:245 msgid "No patch removed\\n" msgstr "" -#: quilt/pop.in:267 quilt/scripts/patchfns.in:508 +#: quilt/pop.in:261 quilt/scripts/patchfns.in:508 msgid "No patches applied\\n" msgstr "" -#: quilt/pop.in:274 quilt/push.in:369 +#: quilt/pop.in:268 quilt/push.in:369 msgid "Now at patch %s\\n" msgstr "" @@ -939,7 +939,7 @@ msgstr "" msgid "Patch %s does not exist\\n" msgstr "" -#: quilt/scripts/patchfns.in:950 +#: quilt/scripts/patchfns.in:940 msgid "" "The quilt meta-data in this tree has version %s, but this version of quilt " "can only handle meta-data formats up to and including version %s. Please pop " @@ -947,7 +947,7 @@ msgid "" "downgrading.\\n" msgstr "" -#: quilt/scripts/patchfns.in:1037 +#: quilt/scripts/patchfns.in:1027 msgid "" "The working tree was created by an older version of quilt. Please run 'quilt " "upgrade'.\\n" diff --git a/quilt.changes b/quilt.changes index 8f9ad4b..b11bcff 100644 --- a/quilt.changes +++ b/quilt.changes @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Tue May 20 09:30:33 CEST 2008 - agruen@suse.de + +- Stop using cp -l: it doesn't fall back to doing a regular copy + when hardlinks are not supported; on some types of filesystems + like AFS and in some situtions, this is annoying. + +------------------------------------------------------------------- Wed Mar 26 00:11:27 CET 2008 - agruen@suse.de - Assume patches are in unified format by default when applying diff --git a/quilt/pop.in b/quilt/pop.in index 42e35d9..cd01e56 100644 --- a/quilt/pop.in +++ b/quilt/pop.in @@ -92,21 +92,15 @@ check_for_pending_changes() if [ -d $QUILT_PC/$patch ] then - if ! rmdir $workdir || # note that this is racey... - ! cp -rl $QUILT_PC/$patch $workdir + local prefix=$QUILT_PC/$patch/ + [ ${prefix:0:1} == / ] || prefix=$PWD/$prefix + if ! ( cd $workdir && \ + $QUILT_LIB/backup-files -B $prefix -rks - ) then printf $"Failed to copy files to temporary directory\n" >&2 rm -rf $workdir return 1 fi - - # Now we may have some zero-size files that have no - # permissions (which represent files that the patch - # creates). Those may have been created in the meantime, - # but patch would refuse to touch them: We must remove - # them here. - find $workdir -type f -size 0 -exec rm -f '{}' ';' - fi if [ -s $patch_file ] diff --git a/quilt/scripts/patchfns.in b/quilt/scripts/patchfns.in index f6407b4..cd27ec9 100644 --- a/quilt/scripts/patchfns.in +++ b/quilt/scripts/patchfns.in @@ -874,31 +874,21 @@ first_modified_by() apply_patch_temporarily() { - local workdir=$1 patch=$2 patch_file patch_args files + local workdir=$1 patch=$2 patch_file patch_args patch_file=$(patch_file_name "$patch") patch_args=$(patch_args "$patch") shift 2 - if [ $# -gt 0 ] - then - files=( "$@" ) - else - files=( $(files_in_patch "$patch") ) - fi - if [ ${#files[@]} -gt 0 ] \ - && ! ( cd $QUILT_PC/$patch && - cp -l --parents "${files[@]}" $workdir/ ) + local prefix=$QUILT_PC/$patch/ + [ ${prefix:0:1} == / ] || prefix=$PWD/$prefix + if ! ( cd $workdir && \ + $QUILT_LIB/backup-files -B $prefix -rks ${@:--} ) then printf $"Failed to copy files to temporary directory\n" >&2 return 1 fi - # Now we may have some zero-size files that have no permissions - # (which represent files that the patch creates). Those may have - # been created in the meantime, but patch would refuse to touch - # them: We must remove them here. - find $workdir -type f -size 0 -exec rm -f '{}' ';' if [ -s $patch_file ] then |