[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Quilt-dev] [RFC] Resolving symlinks
From: |
Wolfram Sang |
Subject: |
Re: [Quilt-dev] [RFC] Resolving symlinks |
Date: |
Wed, 17 Jun 2009 19:07:33 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Fri, Dec 19, 2008 at 02:59:11PM +0100, Wolfram Sang wrote:
Ping.
> 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/.
I might add that this is not an academic case. This caused a problem for me
when working with a symlink I kept as a shortcut.
>
> Signed-off-by: Wolfram Sang <address@hidden>
> ---
>
> 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
> _______________________________________________
> Quilt-dev mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/quilt-dev
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-5064 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
signature.asc
Description: Digital signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Quilt-dev] [RFC] Resolving symlinks,
Wolfram Sang <=