--- quilt-0.33.orig/Makefile.in +++ quilt-0.33/Makefile.in @@ -57,7 +57,7 @@ QUILT_IN := add applied delete diff edit files fold fork graph grep \ import new next patches pop previous push refresh remove \ - series setup snapshot top unapplied + series setup snapshot top unapplied upgrade QUILT_SRC := $(QUILT_IN:%=%.in) QUILT := $(QUILT_IN) --- quilt-0.33.orig/quilt/upgrade.in +++ quilt-0.33/quilt/upgrade.in @@ -0,0 +1,132 @@ +#! @BASH@ + +# This script is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# See the COPYING and AUTHORS files for more details. + +quilt_no_version_check=yes +# Read in library functions +if [ "$(type -t patch_file_name)" != function ] +then + if ! [ -r @SCRIPTS@/patchfns ] + then + echo "Cannot read library @SCRIPTS@/patchfns" >&2 + exit 1 + fi + . @SCRIPTS@/patchfns +fi + +no_update_needed() +{ + echo $"Your tree already use the format v$DB_VERSION." + exit 0 +} + +usage() +{ + echo $"Usage: quilt upgrade" + if [ x$1 = x-h ] + then + echo $" +Upgrades the meta-data contained in a working tree from an old version of +quilt to the current one. You only have to use this command when an upgraded +version of the quilt program breaks on your tree with a message like: +" + echo -n " " + # split above message to save work to translators + echo $"Your tree was created by an older version of quilt. Please use 'quilt upgrade'." + exit 0 + else + exit 1 + fi +} + +options=`getopt -o h -- "$@"` + +if [ $? -ne 0 ] +then + usage +fi + +eval set -- "$options" + +while true +do + case "$1" in + -h) + usage -h ;; + --) + shift + break ;; + esac +done + +if [ $# -gt 1 ] +then + usage +fi + +[ -e $QUILT_PC ] || no_update_needed + +if [ -e $QUILT_PC/.version ] +then + if [ $DB_VERSION = "$(< $QUILT_PC/.version)" ] + then + no_update_needed + fi + if [ $DB_VERSION -lt "$(< $QUILT_PC/.version)" ] + then + echo $"Your tree was created by a version of quilt more recent than this one. +Upward compatibility is not possible, please pop all the patches using the +version used to push them before downgrading." >&2 + exit 1 + fi +fi + +echo -n $"Trying to convert the meta-data to format v$DB_VERSION... " + +# Previously we have stripped standard patch extensions (.dif .diff +# .patch .gz .bz2) of patch names; we have used the mangled names in +# .pc/applied-patches, .pc/$patch/, but not in the series file. + +for patch in $(applied_patches) +do + proper_name="$(grep -E -e '^'"$(quote_re $patch)"'(|\.patch|\.diff?)(|\.gz|\.bz2)([ \t]|$)' $SERIES)" + proper_name=${proper_name#$QUILT_PATCHES/} + proper_name=${proper_name// /} + if [ -z "$proper_name" ] + then + failed=1 + break + fi + + if [ "$patch" != "$proper_name" -a -d $QUILT_PC/$patch ] \ + && grep -q "^$(quote_bre $patch)\$" \ + $QUILT_PC/applied-patches + then + mv $QUILT_PC/$patch $QUILT_PC/$proper_name \ + || failed=1 + rename_in_db $patch $proper_name \ + || failed=1 + [ -z "$failed" ] || break + fi +done + +if [ -n "$failed" ] +then + echo $"failed !" + echo $" +Please pop all the patches using the quilt version used to push them before +upgrade, or remove the $QUILT_PC directory and start your patches from scratch. Sorry." >&2 + exit 1 +else + echo $"successful." + echo + echo $DB_VERSION > $QUILT_PC/.version +fi +### Local Variables: +### mode: shell-script +### End: +# vim:filetype=sh --- quilt-0.33.orig/scripts/patchfns.in +++ quilt-0.33/scripts/patchfns.in @@ -11,6 +11,7 @@ export LANG=POSIX export TEXTDOMAIN=quilt export QUILT_PATCHES QUILT_PC SUBDIR SERIES DB +DB_VERSION=1 : ${QUILT_PATCHES:=patches} : ${QUILT_PC:=.pc} @@ -20,55 +21,6 @@ source "$QUILTRC" fi -# -# If the working directory does not contain a $QUILT_PATCHES directory, -# quilt searches for its base directory up the directory tree. If no -# $QUILT_PATCHES directory exists, the quilt operations that create -# patches will create $QUILT_PATCHES in the current working directory. -# -# When quilt is invoked from a directory below the base directory, it -# changes into the base directory, and sets $SUBDIR to the relative -# path from the base directory to the directory in which it was -# invoked. (e.g., if quilt is invoked in /usr/src/linux/drivers/net -# and the base direcory is /usr/src/linux, $SUBDIR is set to -# drivers/net/. - -unset SUBDIR -if ! [ -d "$QUILT_PATCHES" ] -then - basedir=$PWD - while [ -n "$basedir" ] - do - basedir=${basedir%/*} - if [ -d "$basedir/$QUILT_PATCHES" ] - then - SUBDIR="${PWD#$basedir/}/" - if ! cd $basedir/ - then - echo "Cannot change into parent directory $basedir/" >&2 - exit 1 - fi - break - fi - done - unset basedir -fi - -if [ -n "$QUILT_SERIES" ] -then - SERIES=$QUILT_SERIES -elif [ -e $QUILT_PC/series ] -then - SERIES=$QUILT_PC/series -elif [ -e series ] -then - SERIES=series -else - SERIES=$QUILT_PATCHES/series -fi - -DB="$QUILT_PC/applied-patches" - # Quote a string for use in a basic regular expression. quote_bre() @@ -413,6 +365,11 @@ add_to_db() { + if ! [ -e $QUILT_PC/.version ] + then + echo $DB_VERSION > $QUILT_PC/.version + fi + echo $1 >> $DB } @@ -706,6 +663,83 @@ done return 1 } + +version_check() { + [ -e $QUILT_PC ] || return 0 + + if [ -e $QUILT_PC/.version ] + then + if [ $DB_VERSION = "$(< $QUILT_PC/.version)" ] + then + return 0 + fi + if [ $DB_VERSION -lt "$(< $QUILT_PC/.version)" ] + then + echo $"Your tree was created by a version of quilt more recent than this one. +Upward compatibility is not possible, please pop all the patches using the +version used to push them before downgrading." >&2 + + exit 1 + fi + fi + echo $"Your tree was created by an older version of quilt. Please use 'quilt upgrade'." >&2 + exit 1 +} + + +# +# If the working directory does not contain a $QUILT_PATCHES directory, +# quilt searches for its base directory up the directory tree. If no +# $QUILT_PATCHES directory exists, the quilt operations that create +# patches will create $QUILT_PATCHES in the current working directory. +# +# When quilt is invoked from a directory below the base directory, it +# changes into the base directory, and sets $SUBDIR to the relative +# path from the base directory to the directory in which it was +# invoked. (e.g., if quilt is invoked in /usr/src/linux/drivers/net +# and the base direcory is /usr/src/linux, $SUBDIR is set to +# drivers/net/. + +unset SUBDIR +if ! [ -d "$QUILT_PATCHES" ] +then + basedir=$PWD + while [ -n "$basedir" ] + do + basedir=${basedir%/*} + if [ -d "$basedir/$QUILT_PATCHES" ] + then + SUBDIR="${PWD#$basedir/}/" + if ! cd $basedir/ + then + echo "Cannot change into parent directory $basedir/" >&2 + exit 1 + fi + break + fi + done + unset basedir +fi + +if [ -n "$QUILT_SERIES" ] +then + SERIES=$QUILT_SERIES +elif [ -e $QUILT_PC/series ] +then + SERIES=$QUILT_PC/series +elif [ -e series ] +then + SERIES=series +else + SERIES=$QUILT_PATCHES/series +fi + +DB="$QUILT_PC/applied-patches" + +if [ -z "$quilt_no_version_check" ] # no check when called from upgrade +then + version_check +fi ### Local Variables: ### mode: shell-script ### End: --- quilt-0.33.orig/po/Makefile +++ quilt-0.33/po/Makefile @@ -1,6 +1,6 @@ QUILT_IN := add applied delete diff files import new next patches \ pop previous push refresh remove series setup top unapplied \ - fold fork snapshot edit + fold fork snapshot edit upgrade SCRIPTS_IN := apatch rpatch patchfns inspect patchfns # scripts/parse-patch is perl based --- quilt-0.33.orig/po/fr.po +++ quilt-0.33/po/fr.po @@ -4,8 +4,8 @@ # msgid "" msgstr "" -"Project-Id-Version: quilt 0.30\n" -"PO-Revision-Date: 2004-06-01 10:21-0700\n" +"Project-Id-Version: quilt 0.33\n" +"PO-Revision-Date: 2004-06-09 00:08-0700\n" "Last-Translator: Martin Quinson \n" "Language-Team: French \n" "MIME-Version: 1.0\n" @@ -888,6 +888,75 @@ "\n" "-n\tAffiche les noms de fichier au lieu des noms de patch." +#: ../quilt/upgrade.in:23 +msgid "Your tree already use the format v$DB_VERSION." +msgstr "Les méta-données de votre arbre sont déjà au format v$DB_VERSION." + +#: ../quilt/upgrade.in:29 +msgid "Usage: quilt upgrade" +msgstr "Usage : quilt upgrade" + +#: ../quilt/upgrade.in:32 +msgid "" +"\n" +"Upgrades the meta-data contained in a working tree from an old version of\n" +"quilt to the current one. You only have to use this command when an " +"upgraded\n" +"version of the quilt program breaks on your tree with a message like:\n" +msgstr "" +"\n" +"Converti au nouveau format les méta-données contenues dans un arbre de travail\n" +"créé par une ancienne version de quilt. Il n'est nécessaire d'utiliser cette\n" +"commande que lorsqu'une mise à jour du programme quilt s'avère incapable\n" +"d'utiliser votre arbre, et affiche le message suivant :\n" + +#: ../quilt/upgrade.in:39 ../scripts/patchfns.in:685 +msgid "" +"Your tree was created by an older version of quilt. Please use 'quilt " +"upgrade'." +msgstr "" +"Votre arbre a été créé par une vieille version de quilt. Veuillez utiliser " +"'quilt upgrade'." + +#: ../quilt/upgrade.in:81 ../scripts/patchfns.in:678 +msgid "" +"Your tree was created by a version of quilt more recent than this one. \n" +"Upward compatibility is not possible, please pop all the patches using the\n" +"version used to push them before downgrading." +msgstr "" +"Votre arbre a été créé par une version de quilt plus récente que celle-ci. " +"La\n" +"compatibilité descendante est impossible, veuillez retirer tous les patches\n" +"avec la version utilisée pour les appliquer avant d'installer une version " +"plus\n" +"ancienne." + +#: ../quilt/upgrade.in:88 +msgid "Trying to convert the meta-data to format v$DB_VERSION... " +msgstr "Tentative de conversion des méta-donées au format v$DB_VERSION... " + +#: ../quilt/upgrade.in:119 +msgid "failed !" +msgstr "échec !" + +#: ../quilt/upgrade.in:120 +msgid "" +"\n" +"Please pop all the patches using the quilt version used to push them before\n" +"upgrade, or remove the $QUILT_PC directory and start your patches from " +"scratch. Sorry." +msgstr "" +"\n" +"Veuillez retirer tous les patchs avec la version utilisée pour les " +"appliquer\n" +"avant d'installer une version plus récente, ou effacez le répertoire " +"$QUILT_PC\n" +"et recommencez vos patchs de zéro. Désolé." + +#: ../quilt/upgrade.in:125 +msgid "successful." +msgstr "réussite." + #: ../scripts/apatch.in:22 msgid "Usage: $0 [-fqv] patchname" msgstr "Usage : $0 [-fqv] patchname"