quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Quilt-dev] PATCH: (2nd try) teach setup and scripts/inspect about --pat


From: Alex Chiang
Subject: [Quilt-dev] PATCH: (2nd try) teach setup and scripts/inspect about --path
Date: Tue, 7 Aug 2007 15:36:04 -0600
User-agent: Mutt/1.5.13 (2006-08-11)

* Alex Chiang <address@hidden>:
> 
> Here is a patch that teaches setup and scripts/inspect about the
> --path option, when passed to quilt setup.
 
Here is attempt #2 at the patch. I was patching the *installed*
version of quilt, rather than the actual source. D'oh!

This patch applies against the 0.46 tarball that you can grab
from the web page.

Feedback welcomed.

Thanks.

/ac

Index: quilt-0.46/quilt/scripts/inspect.in
===================================================================
--- quilt-0.46.orig/quilt/scripts/inspect.in
+++ quilt-0.46/quilt/scripts/inspect.in
@@ -21,11 +21,25 @@ usage() {
        exit 1
 }
 
-if [ "$1" = -v ]
-then
-       verbose=1
-       shift
-fi
+options=$(getopt -o v --long path: -n "$0" -- "$@") || exit
+
+eval set -- "$options"
+
+while true
+do
+
+       case "$1" in
+       -v)
+               verbose=1
+               shift ;;
+       --path)
+               path="$2"
+               shift 2 ;;
+       --)
+               shift
+               break ;;
+       esac
+done
 
 specfile=$1
 if [ $# -ne 1 -o ! -f "$specfile" ]
@@ -36,8 +50,15 @@ fi
 if [ "${specfile:0:1}"  != / ]
 then
        specfile="$PWD/$specfile"
+       specdir=$PWD
+fi
+
+if [ "$path" ]
+then
+       sourcedir=${path#:}
+else
+       sourcedir=${specfile%/*}
 fi
-sourcedir=${specfile%/*}
 
 tmpdir="$(gen_tempfile -d ${TMPDIR-/var/tmp}/${0##*/})"
 mkdir -p $tmpdir || exit 1
@@ -56,6 +77,7 @@ fi
 # create md5 sums, also for uncompressed files
 echo -n "### md5sum: " >&4
 shopt -s nullglob
+cd $sourcedir
 for file in *
 do
        file=${file##*/}
@@ -225,7 +247,7 @@ echo -n "### rpmbuild: " >&4
 
 export PATH="$tmpdir/bin:$PATH"
 rpmbuild --eval "%define _sourcedir $sourcedir" \
-        --eval "%define _specdir   $sourcedir" \
+        --eval "%define _specdir   $specdir" \
         --eval "%define _builddir  $tmpdir/build" \
         --nodeps \
         -bp "$specfile" < /dev/null >&2
Index: quilt-0.46/quilt/setup.in
===================================================================
--- quilt-0.46.orig/quilt/setup.in
+++ quilt-0.46/quilt/setup.in
@@ -153,7 +153,7 @@ case "$1" in
 *.spec)
        spec_file=$1
 
-       if ! $QUILT_DIR/scripts/inspect $verbose "$spec_file" 2>&1 > $tmpfile
+       if ! $QUILT_DIR/scripts/inspect $verbose --path $path "$spec_file" 2>&1 
> $tmpfile
        then
                printf $"The %%prep section of %s failed; results may be 
incomplete\n" "$spec_file"
                if [ -z "$verbose" ]
@@ -215,7 +215,7 @@ do
                ;;
        patch)
                [ -e "$prefix$dir/$QUILT_PATCHES" ] \
-               || create_symlink "" "$prefix$dir/$QUILT_PATCHES"
+               || create_symlink "${path#:}" "$prefix$dir/$QUILT_PATCHES"
                if [ -n "$series_file" ]
                then
                        [ -e "$prefix$dir/${QUILT_SERIES:-series}" ] \




reply via email to

[Prev in Thread] Current Thread [Next in Thread]