diff options
-rw-r--r-- | doc/main.tex | 8 | ||||
-rw-r--r-- | quilt/scripts/patchfns.in | 26 |
2 files changed, 28 insertions, 6 deletions
diff --git a/doc/main.tex b/doc/main.tex index 698b89c..30acd94 100644 --- a/doc/main.tex +++ b/doc/main.tex @@ -175,7 +175,9 @@ The remainder of this document discusses the script collection With quilt, all work occurs within a single directory tree. Since version 0.30, commands can be invoked from anywhere within the source -tree. Commands are of the form ``\quilt{cmd}'', similar to CVS +tree (the directory tree is scanned upwards until either the +\textsf{.pc} or the \textsf{patches} directory is found). +Commands are of the form ``\quilt{cmd}'', similar to CVS commands. They can be abbreviated as long as the specified part of the command is unique. All commands print some help text with ``\quilt{cmd -h}''. @@ -198,7 +200,9 @@ After the refresh, the patch and the working state are the same. Patch files are located in the \textsf{patches} sub-directory of the source tree (see Figure~\ref{fig:dir-layout}). The \textsf{QUILT\_PATCHES} -environment variable can be used to override this location. The +environment variable can be used to override this location and quilt +will remember this location by storing its value in the +\textsf{.pc/.quilt\_patches} file. The \textsf{patches} directory may contain sub-directories. \textsf{patches} may also be a symbolic link instead of a directory. diff --git a/quilt/scripts/patchfns.in b/quilt/scripts/patchfns.in index fbe8f7b..9528d2c 100644 --- a/quilt/scripts/patchfns.in +++ b/quilt/scripts/patchfns.in @@ -20,7 +20,6 @@ export LANG=POSIX export QUILT_PATCHES QUILT_PC SUBDIR SERIES DB DB_VERSION=2 -: ${QUILT_PATCHES:=patches} : ${QUILT_PC:=.pc} # Support compatibility layer @@ -950,6 +949,14 @@ create_db() { mkdir -p $QUILT_PC echo $DB_VERSION > $QUILT_PC/.version fi + if ! [ -e $QUILT_PC/.quilt_patches ] + then + echo "$QUILT_PATCHES" > $QUILT_PC/.quilt_patches + fi + if ! [ -e $QUILT_PC/.quilt_series ] + then + echo "$QUILT_SERIES" > $QUILT_PC/.quilt_series + fi } version_check() { @@ -1052,14 +1059,14 @@ setup_pager() # drivers/net/. unset SUBDIR SUBDIR_DOWN -if ! [ -d "$QUILT_PATCHES" ] +if ! [ -d "$QUILT_PC" -o -d "${QUILT_PATCHES:-patches}" ] then basedir=$PWD while [ -n "$basedir" ] do basedir=${basedir%/*} down=$down../ - if [ -d "$basedir/$QUILT_PATCHES" ] + if [ -d "$basedir/$QUILT_PC" -o -d "$basedir/${QUILT_PATCHES:-patches}" ] then SUBDIR="${PWD#$basedir/}/" SUBDIR_DOWN=$down @@ -1074,7 +1081,18 @@ then unset basedir down fi -: ${QUILT_SERIES:=series} +if [ -r $QUILT_PC/.quilt_patches ] +then + : ${QUILT_PATCHES:=$(< $QUILT_PC/.quilt_patches)} +else + : ${QUILT_PATCHES:=patches} +fi +if [ -r $QUILT_PC/.quilt_series ] +then + : ${QUILT_SERIES:=$(< $QUILT_PC/.quilt_series)} +else + : ${QUILT_SERIES:=series} +fi if [ "${QUILT_SERIES:0:1}" = / ] then |