quilt: Resolve symlinks for SUBDIR This patch makes sure there are no symlinks in SUBDIR. So, they won't be used with "quilt add". This helps in the following cases:
a) In some projects, symlinks are created during build. If a path inside a patch relies on such a symlink, you can't apply it before building the project (for example, include/asm in the kernel-tree). b) It will take care of such a situation (symbolic ls output follows): .: drwxr-xr-x 1 lrwxrwxrwx link -> 1/2/3 ./1: total 4 drwxr-xr-x 2 ./1/2: total 8 drwxr-xr-x 3 drwxr-xr-x patches ./1/2/3: total 0 -rw-r--r-- a -rw-r--r-- b -rw-r--r-- c That is the basedir has a link to the relative path 1/2/3/. Directory 1/2/ contains a patches directory. If I am now in directory 1/2/3/ and make a new patch, it will be added to the stack in 1/2/ as expected. If I use the _link_ in the basedir to reach 1/2/3/, quilt originally would not detect the patch stack in 1/2/ and create it in 1/2/3/. Signed-off-by: Wolfram Sang <[email protected]> --- I hope you got the example :) Does anyone see sideeffects? quilt/scripts/patchfns.in | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) Index: quilt/scripts/patchfns.in =================================================================== --- quilt/scripts/patchfns.in.orig +++ quilt/scripts/patchfns.in @@ -985,14 +985,15 @@ quilt_command() unset SUBDIR SUBDIR_DOWN if ! [ -d "$QUILT_PATCHES" ] then - basedir=$PWD + basedir_orig=$(pwd -P) + basedir=$basedir_orig while [ -n "$basedir" ] do basedir=${basedir%/*} down=$down../ if [ -d "$basedir/$QUILT_PATCHES" ] then - SUBDIR="${PWD#$basedir/}/" + SUBDIR="${basedir_orig#$basedir/}/" SUBDIR_DOWN=$down if ! cd $basedir/ then @@ -1002,7 +1003,7 @@ then break fi done - unset basedir down + unset basedir basedir_orig down fi : ${QUILT_SERIES:=series} -- Dipl.-Ing. Wolfram Sang | http://www.pengutronix.de Pengutronix - Linux Solutions for Science and Industry
signature.asc
Description: Digital signature
_______________________________________________ Quilt-dev mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/quilt-dev
