? u.diff ? scripts/spec2series Index: po/de.po =================================================================== RCS file: /cvsroot/quilt/quilt/po/de.po,v retrieving revision 1.15 diff -u -r1.15 de.po --- po/de.po 6 Jun 2004 01:41:42 -0000 1.15 +++ po/de.po 6 Jun 2004 03:06:03 -0000 @@ -903,6 +903,16 @@ msgid "The topmost patch $top needs to be refreshed first." msgstr "Der oberste Patch $top muss zuerst aufgefrischt werden (Refresh)." +#: ../scripts/patchfns.in:669 +msgid "" +"Failed to update $QUILT_PC directory to version $DB_VERSION; please remove " +"and start from scratch." +msgstr "" + +#: ../scripts/patchfns.in:672 +msgid "$QUILT_PC directory updated to version $DB_VERSION" +msgstr "" + #: ../scripts/rpatch.in:22 msgid "Usage: $0 [-fRq] patchname" msgstr "Verwendung: $0 [-fRq] patchname" Index: po/fr.po =================================================================== RCS file: /cvsroot/quilt/quilt/po/fr.po,v retrieving revision 1.20 diff -u -r1.20 fr.po --- po/fr.po 6 Jun 2004 01:41:42 -0000 1.20 +++ po/fr.po 6 Jun 2004 03:06:05 -0000 @@ -921,6 +921,16 @@ 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:669 +msgid "" +"Failed to update $QUILT_PC directory to version $DB_VERSION; please remove " +"and start from scratch." +msgstr "" + +#: ../scripts/patchfns.in:672 +msgid "$QUILT_PC directory updated to version $DB_VERSION" +msgstr "" + #: ../scripts/rpatch.in:22 msgid "Usage: $0 [-fRq] patchname" msgstr "Usage: $0 [-fRq] nom_de_patch" Index: po/quilt.pot =================================================================== RCS file: /cvsroot/quilt/quilt/po/quilt.pot,v retrieving revision 1.18 diff -u -r1.18 quilt.pot --- po/quilt.pot 6 Jun 2004 01:41:42 -0000 1.18 +++ po/quilt.pot 6 Jun 2004 03:06:05 -0000 @@ -673,6 +673,16 @@ msgid "The topmost patch $top needs to be refreshed first." msgstr "" +#: ../scripts/patchfns.in:669 +msgid "" +"Failed to update $QUILT_PC directory to version $DB_VERSION; please remove " +"and start from scratch." +msgstr "" + +#: ../scripts/patchfns.in:672 +msgid "$QUILT_PC directory updated to version $DB_VERSION" +msgstr "" + #: ../scripts/rpatch.in:22 msgid "Usage: $0 [-fRq] patchname" msgstr "" Index: scripts/patchfns.in =================================================================== RCS file: /cvsroot/quilt/quilt/scripts/patchfns.in,v retrieving revision 1.42 diff -u -r1.42 patchfns.in --- scripts/patchfns.in 27 Apr 2004 22:49:06 -0000 1.42 +++ scripts/patchfns.in 6 Jun 2004 03:06:06 -0000 @@ -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 } @@ -664,6 +621,110 @@ done return 1 } + +version_check_update() { + [ -e $QUILT_PC ] || return 0 + + if [ -e $QUILT_PC/.version ] + then + if [ $DB_VERSION = "$(< $QUILT_PC/.version)" ] + then + return 0 + fi + fi + + # Previously we have stripped standard patch extensions (.dif .diff + # .patch .gz .bz2) off patch names; we have used the mangled names in + # .pc/applied-patches, .pc/$patch/, but not in the series file. + + set -x + + local patch failed + 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/} + 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 + + set +x + + if [ -n "$failed" ] + then + echo $"Failed to update $QUILT_PC directory to version $DB_VERSION; please remove and start from scratch." >&2 + exit 1 + else + echo $"$QUILT_PC directory updated to version $DB_VERSION" + echo $DB_VERSION > $QUILT_PC/.version + 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" + +version_check_update ### Local Variables: ### mode: shell-script ### End: