diff options
author | Andreas Gruenbacher <agruen@suse.de> | 2004-06-10 20:08:37 +0000 |
---|---|---|
committer | Andreas Gruenbacher <agruen@suse.de> | 2004-06-10 20:08:37 +0000 |
commit | 71d64f6c066574e47dfc0363efc576dd21474f8e (patch) | |
tree | fba3c6f2e10b661c208d0c06d32c4b2ad4ced93b | |
parent | 27a5cb45dd2f3fa87f295fb3c5de91de96ba3a7b (diff) | |
download | quilt-71d64f6c066574e47dfc0363efc576dd21474f8e.tar.gz |
- Add meta-data version check/upgrade code from Martin Quinson and
me; new `quilt upgrade' command.
- Handle new/removed files correctly in generated patches: If the
old or new file is missing, the file name in the patch should
be /dev/null. Fix test suite accordingly, and add
test/create-delete.diff. GNU patch recognizes this, and does
additional file existance tests when a patch creates/deletes a
file. Also use the --label option of GNU diff instead of
hand-editing file name headers.
- Add test/Makefile for running the test suite. Note: The tests
run against the installed version of quilt!
- Bump version to 0.34.
-rw-r--r-- | Makefile.in | 2 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | po/Makefile | 2 | ||||
-rw-r--r-- | po/de.po | 81 | ||||
-rw-r--r-- | po/fr.po | 109 | ||||
-rw-r--r-- | po/quilt.pot | 61 | ||||
-rw-r--r-- | quilt.changes | 16 | ||||
-rw-r--r-- | quilt/new.in | 1 | ||||
-rw-r--r-- | quilt/push.in | 1 | ||||
-rw-r--r-- | scripts/patchfns.in | 167 | ||||
-rw-r--r-- | test/Makefile | 10 | ||||
-rw-r--r-- | test/fold.test | 4 | ||||
-rw-r--r-- | test/new.test | 2 | ||||
-rw-r--r-- | test/one.test | 6 | ||||
-rw-r--r-- | test/subdir.test | 4 | ||||
-rw-r--r-- | test/two.test | 6 |
16 files changed, 384 insertions, 92 deletions
diff --git a/Makefile.in b/Makefile.in index 007652c..88b8af0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -57,7 +57,7 @@ DIRT += $(BIN_IN:%=bin/%) 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) diff --git a/configure.ac b/configure.ac index 539dc30..cc63410 100644 --- a/configure.ac +++ b/configure.ac @@ -1,8 +1,8 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([quilt],[0.33],[quilt-dev@nongnu.org]) +AC_INIT([quilt],[0.34],[quilt-dev@nongnu.org]) AC_CONFIG_AUX_DIR(config) AC_PREREQ(2.53) -AC_REVISION ($Revision: 1.27 $) +AC_REVISION ($Revision: 1.28 $) PACKAGE_RELEASE=1 AC_SUBST(PACKAGE_RELEASE) diff --git a/po/Makefile b/po/Makefile index b1d4450..f18dcda 100644 --- a/po/Makefile +++ b/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 @@ -77,7 +77,7 @@ msgstr "Patch $patch ist nicht angewandt" #: ../quilt/add.in:82 ../quilt/delete.in:67 ../quilt/diff.in:168 #: ../quilt/files.in:75 ../quilt/fold.in:78 ../quilt/fork.in:64 -#: ../quilt/pop.in:181 ../quilt/push.in:179 ../quilt/push.in:214 +#: ../quilt/pop.in:181 ../quilt/push.in:179 ../quilt/push.in:215 #: ../quilt/refresh.in:107 ../quilt/remove.in:80 msgid "No patches applied" msgstr "Keine Patches angewandt" @@ -454,11 +454,11 @@ msgstr "" msgid "Patch $patch exists already" msgstr "Patch $patch existiert bereits" -#: ../quilt/new.in:80 +#: ../quilt/new.in:81 msgid "Failed to create patch $patch" msgstr "Konnte Patch $patch nicht erzeugen" -#: ../quilt/new.in:83 +#: ../quilt/new.in:84 msgid "Patch $patch is now on top" msgstr "Der oberste Patch ist jetzt $patch" @@ -556,11 +556,11 @@ msgstr "Patch $stop_at_patch ist nicht angewandt." msgid "No patch removed" msgstr "Kein Patch entfernt" -#: ../quilt/pop.in:172 ../quilt/push.in:205 +#: ../quilt/pop.in:172 ../quilt/push.in:206 msgid "Interrupted by user" msgstr "Unterbrechung durch Benutzer" -#: ../quilt/pop.in:188 ../quilt/push.in:216 +#: ../quilt/pop.in:188 ../quilt/push.in:217 msgid "Now at patch $patch" msgstr "Jetzt in Patch $patch" @@ -871,6 +871,56 @@ msgstr "" "\n" "-n\tPatch-Dateinamen statt Patch-Namen ausgeben." +#: ../quilt/upgrade.in:25 +msgid "Usage: quilt upgrade" +msgstr "Verwendung: quilt upgrade" + +#: ../quilt/upgrade.in:28 +msgid "" +"\n" +"Upgrade the meta-data in a working tree from an old version of quilt to the\n" +"current version. This command is only needed when the quilt meta-data " +"format\n" +"has changed, and the working tree still contains old-format meta-data. In " +"that\n" +"case, quilt will request to run \\`quilt upgrade'." +msgstr "" +"\n" +"Aktualisiere die Metadaten in einem Arbeitsverzeichnis von einer älteren " +"Version\n" +"von quilt zur aktuellen. Dieses Kommando wird nur benötigt, wenn sich das\n" +"Format der Metadaten verändert hat, und das Arbeitsverzeichnis noch alte\n" +"Metadaten enthält. In diesem Fall fordert quilt dazu auf, \\`quilt upgrade'\n" +"auszuführen." + +#: ../quilt/upgrade.in:66 +msgid "" +"The quilt meta-data in $QUILT_PC/ already are have format version " +"$DB_VERSION; nothing to do" +msgstr "" +"Die Metadaten in $QUILT_PC/ sind bereits in Format Version $DB_VERSION; " +"nichts zu tun" + +#: ../quilt/upgrade.in:70 +msgid "Converting meta-data to version $DB_VERSION" +msgstr "Konvertiere Metadaten in Version $DB_VERSION" + +#: ../quilt/upgrade.in:101 +msgid "Conversion failed" +msgstr "Konvertierung fehlgeschlagen" + +#: ../quilt/upgrade.in:102 +msgid "" +"\n" +"Please remove all patches using \\`quilt pop -a' from the quilt version used " +"to create this working tree, or remove the $QUILT_PC directory and apply the " +"patches from scratch." +msgstr "" +"\n" +"Bitte entfernen Sie alle Patches mit \\`quilt pop -a' der quilt-Version, die " +"zur Erzeugung des Arbeitsverzeichnis verwendet wurden, oder entfernen Sie " +"das Verzeichnis $QUILT_PC, und wenden Sie die Patches neu an." + #: ../scripts/apatch.in:22 msgid "Usage: $0 [-fqv] patchname" msgstr "Verwendung: $0 [-fqv] patchname" @@ -903,6 +953,27 @@ msgstr "Patch $patch läßt sich nicht anwenden (erzwingen mit -f)" msgid "The topmost patch $top needs to be refreshed first." msgstr "Der oberste Patch $top muss zuerst aufgefrischt werden (Refresh)." +#: ../scripts/patchfns.in:691 +msgid "" +"The quilt meta-data in this tree has version $version, but this version of " +"quilt can only handle meta-data formats up to and including version " +"$DB_VERSION. Please pop all the patches using the version of quilt used to " +"push them before downgrading." +msgstr "" +"Die quilt-Metadaten in diesem Arbeitsverzeichnis haben Version $version, " +"aber diese Version von quilt kann nur mit Metadaten in den Versionen " +"$DB_VERSION und darunter umgehen. Bitte entfernen Sie vor dem Downgrade von " +"quilt alle Patches mit der Version von quilt, die zur Erstellung des " +"Arbeitsverzeichnisses verwendet wurde." + +#: ../scripts/patchfns.in:753 +msgid "" +"The working tree was created by an older version of quilt. Please run 'quilt " +"upgrade'." +msgstr "" +"Das Arbeitsverzeichnis wurde von einer älteren Version von quilt erstellt. " +"Bitte führen Sie \\`quilt upgrade' aus." + #: ../scripts/rpatch.in:22 msgid "Usage: $0 [-fRq] patchname" msgstr "Verwendung: $0 [-fRq] patchname" @@ -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 <Martin.Quinson@tuxfamily.org>\n" "Language-Team: French <traduc@traduc.org>\n" "MIME-Version: 1.0\n" @@ -78,7 +78,7 @@ msgstr "Le patch $patch n'est pas appliqué" #: ../quilt/add.in:82 ../quilt/delete.in:67 ../quilt/diff.in:168 #: ../quilt/files.in:75 ../quilt/fold.in:78 ../quilt/fork.in:64 -#: ../quilt/pop.in:181 ../quilt/push.in:179 ../quilt/push.in:214 +#: ../quilt/pop.in:181 ../quilt/push.in:179 ../quilt/push.in:215 #: ../quilt/refresh.in:107 ../quilt/remove.in:80 msgid "No patches applied" msgstr "Aucun patch n'est appliqué" @@ -459,11 +459,11 @@ msgstr "" msgid "Patch $patch exists already" msgstr "Le patch $patch existe déjà" -#: ../quilt/new.in:80 +#: ../quilt/new.in:81 msgid "Failed to create patch $patch" msgstr "Impossible de crée le patch $patch" -#: ../quilt/new.in:83 +#: ../quilt/new.in:84 msgid "Patch $patch is now on top" msgstr "Le patch $patch est maintenant au sommet" @@ -565,11 +565,11 @@ msgstr "Le patch $stop_at_patch n'est pas appliqué." msgid "No patch removed" msgstr "Aucun patch retiré" -#: ../quilt/pop.in:172 ../quilt/push.in:205 +#: ../quilt/pop.in:172 ../quilt/push.in:206 msgid "Interrupted by user" msgstr "Interrompu par l'utilisateur" -#: ../quilt/pop.in:188 ../quilt/push.in:216 +#: ../quilt/pop.in:188 ../quilt/push.in:217 msgid "Now at patch $patch" msgstr "Le patch $patch est maintenant au sommet" @@ -888,6 +888,51 @@ msgstr "" "\n" "-n\tAffiche les noms de fichier au lieu des noms de patch." +#: ../quilt/upgrade.in:25 +msgid "Usage: quilt upgrade" +msgstr "Usage : quilt upgrade" + +#: ../quilt/upgrade.in:28 +msgid "" +"\n" +"Upgrade the meta-data in a working tree from an old version of quilt to the\n" +"current version. This command is only needed when the quilt meta-data " +"format\n" +"has changed, and the working tree still contains old-format meta-data. In " +"that\n" +"case, quilt will request to run \\`quilt upgrade'." +msgstr "" + +#: ../quilt/upgrade.in:66 +msgid "" +"The quilt meta-data in $QUILT_PC/ already are have format version " +"$DB_VERSION; nothing to do" +msgstr "" + +#: ../quilt/upgrade.in:70 +#, fuzzy +msgid "Converting meta-data to version $DB_VERSION" +msgstr "Tentative de conversion des méta-donées au format v$DB_VERSION... " + +#: ../quilt/upgrade.in:101 +msgid "Conversion failed" +msgstr "" + +#: ../quilt/upgrade.in:102 +#, fuzzy +msgid "" +"\n" +"Please remove all patches using \\`quilt pop -a' from the quilt version used " +"to create this working tree, or remove the $QUILT_PC directory and apply the " +"patches from scratch." +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é." + #: ../scripts/apatch.in:22 msgid "Usage: $0 [-fqv] patchname" msgstr "Usage : $0 [-fqv] patchname" @@ -921,6 +966,30 @@ msgstr "" msgid "The topmost patch $top needs to be refreshed first." msgstr "Le patch au sommet $top doit être rafraichi au préalable." +#: ../scripts/patchfns.in:691 +#, fuzzy +msgid "" +"The quilt meta-data in this tree has version $version, but this version of " +"quilt can only handle meta-data formats up to and including version " +"$DB_VERSION. Please pop all the patches using the version of quilt 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." + +#: ../scripts/patchfns.in:753 +#, fuzzy +msgid "" +"The working tree was created by an older version of quilt. Please run 'quilt " +"upgrade'." +msgstr "" +"Votre arbre a été créé par une vieille version de quilt. Veuillez utiliser " +"'quilt upgrade'." + #: ../scripts/rpatch.in:22 msgid "Usage: $0 [-fRq] patchname" msgstr "Usage: $0 [-fRq] nom_de_patch" @@ -932,3 +1001,29 @@ msgstr "Le patch $patch ne se retire pas proprement (forcez avec -f)" #: ../scripts/rpatch.in:122 msgid "Removing $patch" msgstr "Retrait de $patch" + +#, fuzzy +#~ msgid "failed." +#~ msgstr "échec !" + +#~ msgid "successful." +#~ msgstr "réussite." + +#~ 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." + +#~ 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" diff --git a/po/quilt.pot b/po/quilt.pot index 8b23e7d..dc6aa3f 100644 --- a/po/quilt.pot +++ b/po/quilt.pot @@ -46,7 +46,7 @@ msgstr "" #: ../quilt/add.in:82 ../quilt/delete.in:67 ../quilt/diff.in:168 #: ../quilt/files.in:75 ../quilt/fold.in:78 ../quilt/fork.in:64 -#: ../quilt/pop.in:181 ../quilt/push.in:179 ../quilt/push.in:214 +#: ../quilt/pop.in:181 ../quilt/push.in:179 ../quilt/push.in:215 #: ../quilt/refresh.in:107 ../quilt/remove.in:80 msgid "No patches applied" msgstr "" @@ -342,11 +342,11 @@ msgstr "" msgid "Patch $patch exists already" msgstr "" -#: ../quilt/new.in:80 +#: ../quilt/new.in:81 msgid "Failed to create patch $patch" msgstr "" -#: ../quilt/new.in:83 +#: ../quilt/new.in:84 msgid "Patch $patch is now on top" msgstr "" @@ -413,11 +413,11 @@ msgstr "" msgid "No patch removed" msgstr "" -#: ../quilt/pop.in:172 ../quilt/push.in:205 +#: ../quilt/pop.in:172 ../quilt/push.in:206 msgid "Interrupted by user" msgstr "" -#: ../quilt/pop.in:188 ../quilt/push.in:216 +#: ../quilt/pop.in:188 ../quilt/push.in:217 msgid "Now at patch $patch" msgstr "" @@ -641,6 +641,43 @@ msgid "" "-n\tPrint patch file names instead of patch names." msgstr "" +#: ../quilt/upgrade.in:25 +msgid "Usage: quilt upgrade" +msgstr "" + +#: ../quilt/upgrade.in:28 +msgid "" +"\n" +"Upgrade the meta-data in a working tree from an old version of quilt to the\n" +"current version. This command is only needed when the quilt meta-data " +"format\n" +"has changed, and the working tree still contains old-format meta-data. In " +"that\n" +"case, quilt will request to run \\`quilt upgrade'." +msgstr "" + +#: ../quilt/upgrade.in:66 +msgid "" +"The quilt meta-data in $QUILT_PC/ already are have format version " +"$DB_VERSION; nothing to do" +msgstr "" + +#: ../quilt/upgrade.in:70 +msgid "Converting meta-data to version $DB_VERSION" +msgstr "" + +#: ../quilt/upgrade.in:101 +msgid "Conversion failed" +msgstr "" + +#: ../quilt/upgrade.in:102 +msgid "" +"\n" +"Please remove all patches using \\`quilt pop -a' from the quilt version used " +"to create this working tree, or remove the $QUILT_PC directory and apply the " +"patches from scratch." +msgstr "" + #: ../scripts/apatch.in:22 msgid "Usage: $0 [-fqv] patchname" msgstr "" @@ -673,6 +710,20 @@ msgstr "" msgid "The topmost patch $top needs to be refreshed first." msgstr "" +#: ../scripts/patchfns.in:691 +msgid "" +"The quilt meta-data in this tree has version $version, but this version of " +"quilt can only handle meta-data formats up to and including version " +"$DB_VERSION. Please pop all the patches using the version of quilt used to " +"push them before downgrading." +msgstr "" + +#: ../scripts/patchfns.in:753 +msgid "" +"The working tree was created by an older version of quilt. Please run 'quilt " +"upgrade'." +msgstr "" + #: ../scripts/rpatch.in:22 msgid "Usage: $0 [-fRq] patchname" msgstr "" diff --git a/quilt.changes b/quilt.changes index bb712c4..ba224ce 100644 --- a/quilt.changes +++ b/quilt.changes @@ -1,4 +1,20 @@ ------------------------------------------------------------------- +Thu Jun 10 22:08:07 CEST 2004 - agruen@suse.de + +- Add meta-data version check/upgrade code from Martin Quinson and + me; new `quilt upgrade' command. +- Handle new/removed files correctly in generated patches: If the + old or new file is missing, the file name in the patch should + be /dev/null. Fix test suite accordingly, and add + test/create-delete.diff. GNU patch recognizes this, and does + additional file existance tests when a patch creates/deletes a + file. Also use the --label option of GNU diff instead of + hand-editing file name headers. +- Add test/Makefile for running the test suite. Note: The tests + run against the installed version of quilt! +- Bump version to 0.34. + +------------------------------------------------------------------- Sun Jun 6 20:16:44 CEST 2004 - agruen@suse.de - Preserve the order of files in patches in the diff and refresh diff --git a/quilt/new.in b/quilt/new.in index e491ffb..32e8ee7 100644 --- a/quilt/new.in +++ b/quilt/new.in @@ -71,6 +71,7 @@ then exit 1 fi +create_db rm -rf "$QUILT_PC/$patch" mkdir -p "$QUILT_PC/$patch" diff --git a/quilt/push.in b/quilt/push.in index 2705075..53d77b5 100644 --- a/quilt/push.in +++ b/quilt/push.in @@ -194,6 +194,7 @@ fi trap "interrupted=1" SIGINT +create_db for patch in $patches do if ! @SCRIPTS@/apatch $apatch_options $patch diff --git a/scripts/patchfns.in b/scripts/patchfns.in index 154c544..1b47bf4 100644 --- a/scripts/patchfns.in +++ b/scripts/patchfns.in @@ -11,6 +11,7 @@ ORIGINAL_LANG=$LANG export LANG=POSIX export TEXTDOMAIN=quilt export QUILT_PATCHES QUILT_PC SUBDIR SERIES DB +DB_VERSION=2 : ${QUILT_PATCHES:=patches} : ${QUILT_PC:=.pc} @@ -20,55 +21,6 @@ then 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() @@ -539,18 +491,18 @@ touched_by_patch() fix_diff_header() { local from=$1 to=$2 z - [ -n "$QUILT_NO_DIFF_TIMESTAMPS" ] && z='.*' - @SED@ -e 's/^--- [^ '$'\t'']*'$z'/--- '"$(quote_bre $from)"'/' \ - -e 's/^+++ [^ '$'\t'']*'$z'/+++ '"$(quote_bre $to)"'/' + if [ -n "$QUILT_NO_DIFF_TIMESTAMPS" ] + then + sed -e 's:^\(\(---\|+++\) .*\)\t.*:\1:' + else + cat + fi } diff_file() { local file=$1 old_file=$2 new_file=$3 - local old_hdr new_hdr line - - [ -s "$old_file" ] || old_file=/dev/null - [ -s "$new_file" ] || new_file=/dev/null + local index old_hdr new_hdr line : ${opt_strip_level:=1} if [ $opt_strip_level -eq 0 ] @@ -562,14 +514,27 @@ diff_file() old_hdr=$dir.orig/$file new_hdr=$dir/$file fi + index=$new_hdr + + if ! [ -s "$old_file" ] + then + old_file=/dev/null + old_hdr=/dev/null + fi + if ! [ -s "$new_file" ] + then + new_file=/dev/null + new_hdr=/dev/null + fi - @DIFF@ -Nu $QUILT_DIFF_OPTS $old_file $new_file | - if read line + @DIFF@ -Nu $QUILT_DIFF_OPTS $old_file $new_file \ + --label "$old_hdr" --label "$new_hdr" \ + | if read line then - echo "Index: $new_hdr" + echo "Index: $index" echo "===================================================================" (echo "$line" ; cat) \ - | fix_diff_header $old_hdr $new_hdr + | fix_diff_header fi } @@ -706,6 +671,88 @@ first_modified_by() done return 1 } + +create_db() { + if ! [ -e $QUILT_PC ] + then + mkdir -p $QUILT_PC + echo $DB_VERSION > $QUILT_PC/.version + fi +} + +version_check() { + [ -e $QUILT_PC ] || return 0 + + if [ -e $QUILT_PC/.version ] + then + version="$(< $QUILT_PC/.version)" + if [ "$version" -gt $DB_VERSION ] + then + echo $"The quilt meta-data in this tree has version $version, but this version of quilt can only handle meta-data formats up to and including version $DB_VERSION. Please pop all the patches using the version of quilt used to push them before downgrading." >&2 + exit 1 + elif [ "$version" = $DB_VERSION ] + then + return 0 + fi + fi + return 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 "$skip_version_check" ] && ! version_check +then + echo $"The working tree was created by an older version of quilt. Please run 'quilt upgrade'." >&2 + exit 1 +fi ### Local Variables: ### mode: shell-script ### End: diff --git a/test/Makefile b/test/Makefile new file mode 100644 index 0000000..0595d2e --- /dev/null +++ b/test/Makefile @@ -0,0 +1,10 @@ +TESTS=$(wildcard *.test) + +all: $(patsubst %,_test_%,$(TESTS)) + +.PHONY: $(patsubst %,_test_%,$(TESTS)) +$(patsubst %,_test_%,$(TESTS)): + @test=$(patsubst _test_%,%,$@); \ + echo "[$$test]" ; \ + export QUILTRC=test.quiltrc ; \ + ./run $$test diff --git a/test/fold.test b/test/fold.test index 0695909..331138a 100644 --- a/test/fold.test +++ b/test/fold.test @@ -38,13 +38,13 @@ $ quilt diff | sed -e "s/\\t.*//" > Index: d/dir/file3.txt > =================================================================== - > --- d.orig/dir/file3.txt + > --- /dev/null > +++ d/dir/file3.txt > @@ -0,0 +1 @@ > +This is file3.txt. > Index: d/file1.txt > =================================================================== - > --- d.orig/file1.txt + > --- /dev/null > +++ d/file1.txt > @@ -0,0 +1 @@ > +This is file1.txt. diff --git a/test/new.test b/test/new.test index dfa8f64..e46bba1 100644 --- a/test/new.test +++ b/test/new.test @@ -44,7 +44,7 @@ > +new > Index: d/g > =================================================================== - > --- d.orig/g + > --- /dev/null > +++ d/g > @@ -0,0 +1 @@ > +added diff --git a/test/one.test b/test/one.test index ce29235..6d92dcb 100644 --- a/test/one.test +++ b/test/one.test @@ -27,7 +27,7 @@ of the installed quilt with `make check'. $ quilt diff | sed -e "s/\\t.*//" > Index: d/file2 > =================================================================== - > --- d.orig/file2 + > --- /dev/null > +++ d/file2 > @@ -0,0 +1 @@ > +This is file two. @@ -35,7 +35,7 @@ of the installed quilt with `make check'. $ quilt diff -z | sed -e "s/\\t.*//" > Index: d/file2 > =================================================================== - > --- d.orig/file2 + > --- /dev/null > +++ d/file2 > @@ -0,0 +1 @@ > +This is file two. @@ -109,7 +109,7 @@ of the installed quilt with `make check'. > Index: d/file4 > =================================================================== > --- d.orig/file4 - > +++ d/file4 + > +++ /dev/null > @@ -1 +0,0 @@ > -This is file 4. diff --git a/test/subdir.test b/test/subdir.test index 5e6bbda..e4334d5 100644 --- a/test/subdir.test +++ b/test/subdir.test @@ -48,14 +48,14 @@ > +new contents > Index: d/subdir/file2 > =================================================================== - > --- d.orig/subdir/file2 + > --- /dev/null > +++ d/subdir/file2 > @@ -0,0 +1 @@ > +another file > Index: d/subdir/file3 > =================================================================== > --- d.orig/subdir/file3 - > +++ d/subdir/file3 + > +++ /dev/null > @@ -1 +0,0 @@ > -yet another file diff --git a/test/two.test b/test/two.test index 372dd72..bbacbae 100644 --- a/test/two.test +++ b/test/two.test @@ -23,7 +23,7 @@ $ quilt diff | sed -e "s/\\t.*//" > Index: d/d/file2 > =================================================================== - > --- d.orig/d/file2 + > --- /dev/null > +++ d/d/file2 > @@ -0,0 +1 @@ > +This is file two. @@ -31,7 +31,7 @@ $ quilt diff -z | sed -e "s/\\t.*//" > Index: d/d/file2 > =================================================================== - > --- d.orig/d/file2 + > --- /dev/null > +++ d/d/file2 > @@ -0,0 +1 @@ > +This is file two. @@ -112,7 +112,7 @@ > Index: d/d/file4 > =================================================================== > --- d.orig/d/file4 - > +++ d/d/file4 + > +++ /dev/null > @@ -1 +0,0 @@ > -This is file 4. |