summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--quilt/scripts/inspect-wrapper.in5
-rw-r--r--quilt/scripts/inspect.in23
-rw-r--r--quilt/setup.in43
3 files changed, 64 insertions, 7 deletions
diff --git a/quilt/scripts/inspect-wrapper.in b/quilt/scripts/inspect-wrapper.in
index c391037..eb0975e 100644
--- a/quilt/scripts/inspect-wrapper.in
+++ b/quilt/scripts/inspect-wrapper.in
@@ -220,12 +220,14 @@ patch)
;;
tar)
echo -n t >&4
+ [ -n "$QUILT_SETUP_FAST" ] && exec ${0##*/} "$@"
inputfile=$(tar_input_file "$@")
# For tar, file - means read from stdin
[ "$inputfile" = "-" ] && inputfile=
;;
unzip)
echo -n Z >&4
+ [ -n "$QUILT_SETUP_FAST" ] && exec ${0##*/} "$@"
inputfile=$(unzip_input_file "$@")
;;
esac
@@ -259,6 +261,9 @@ then
esac
fi
+# In fast mode, we don't actually apply patches
+[ -n "$QUILT_SETUP_FAST" ] && exit 0
+
if [ -n "$inputfile" ]
then
exec ${0##*/} "$@"
diff --git a/quilt/scripts/inspect.in b/quilt/scripts/inspect.in
index d545b59..3f1ce89 100644
--- a/quilt/scripts/inspect.in
+++ b/quilt/scripts/inspect.in
@@ -21,11 +21,11 @@ cd ${SUBDIR:-.}
usage()
{
- echo "Usage: ${0##*/} [-v] [--sourcedir dir] [--fuzz=N] specfile"
+ echo "Usage: ${0##*/} [-v] [--sourcedir dir] [--targetdir dir] [--fuzz=N] specfile"
exit 1
}
-options=$(getopt -o v --long sourcedir:,fuzz: -n "${0##*/}" -- "$@") || exit
+options=$(getopt -o v --long sourcedir:,targetdir:,fuzz: -n "${0##*/}" -- "$@") || exit
eval set -- "$options"
@@ -40,6 +40,9 @@ do
--sourcedir)
sourcedir=${2%/}/
shift 2 ;;
+ --targetdir)
+ targetdir=$2
+ shift 2 ;;
--fuzz)
# Only works with rpm 4.6 and later
DEFINE_FUZZ="%define _default_patch_fuzz $2"
@@ -68,8 +71,16 @@ fi
tmpdir=$(gen_tempfile -d ${VARTMPDIR:-/var/tmp}/${0##*/})
mkdir -p $tmpdir || exit 1
add_exit_handler "rm -rf $tmpdir"
-mkdir -p $tmpdir/build
mkdir -p $tmpdir/bin
+if [ -n "$targetdir" ]
+then
+ # Fast mode
+ [ -d "$targetdir" ] || mkdir -p "$targetdir" || exit 1
+ ln -s "$targetdir" $tmpdir/build
+else
+ # Standard mode
+ mkdir -p $tmpdir/build
+fi
# Redirect file descriptors
# 5 is used in verbose mode, 4 in non-verbose mode, and 2 for both (real errors)
@@ -90,6 +101,11 @@ do
ready|bigpack|_constraints|_service|baselibs.conf|MD5SUMS|MD5SUMS.meta|*.spec|*.changes|*.sig|*.sign|*rpmlintrc)
continue
;;
+ # In fast mode, we are only interested in patches, so filter out
+ # archives
+ *.tar|*.tar.Z|*.tar.gz|*.tgz|*.tar.bz2|*.tar.xz|*.zip)
+ [ -n "$targetdir" ] && continue
+ ;;
esac
[ -f "$file" ] || continue
echo -n "." >&4
@@ -150,6 +166,7 @@ ln -s $QUILT_DIR/scripts/inspect-wrapper $tmpdir/bin/unzip
echo -n "### rpmbuild: " >&4
export PATH="$tmpdir/bin:$PATH"
+export QUILT_SETUP_FAST=${targetdir:+1}
rpmbuild --eval "%define _sourcedir $sourcedir" \
--eval "%define _specdir $specdir" \
--eval "%define _builddir $tmpdir/build" \
diff --git a/quilt/setup.in b/quilt/setup.in
index 93c7ce4..639d40d 100644
--- a/quilt/setup.in
+++ b/quilt/setup.in
@@ -124,7 +124,7 @@ dir_to_dir()
usage()
{
- printf $"Usage: quilt setup [-d path-prefix] [-v] [--sourcedir dir] [--fuzz=N] {specfile|seriesfile}\n"
+ printf $"Usage: quilt setup [-d path-prefix] [-v] [--sourcedir dir] [--fuzz=N] [--slow|--fast] {specfile|seriesfile}\n"
if [ x$1 = x-h ]
then
printf $"
@@ -139,6 +139,17 @@ Initializes a source tree from an rpm spec file or a quilt series file.
--fuzz=N
Set the maximum fuzz factor (needs rpm 4.6 or later).
+
+--slow Use the original, slow method to process the spec file. This is the
+ default for now, but that might change in the future. In this mode,
+ rpmbuild generates a working tree in a temporary directory while all
+ its actions are recorded, and then everything is replayed from scratch
+ in the target directory.
+
+--fast Use an alternative, faster method to process the spec file. In this
+ mode, rpmbuild is told to generate a working tree directly in the
+ target directory. If the input is a series file, it is assumed that
+ all archives have been extracted manually beforehand.
"
exit 0
else
@@ -146,7 +157,7 @@ Initializes a source tree from an rpm spec file or a quilt series file.
fi
}
-options=`getopt -o d:vh --long sourcedir:,fuzz: -- "$@"`
+options=`getopt -o d:vh --long sourcedir:,fuzz:,slow,fast -- "$@"`
if [ $? -ne 0 ]
then
@@ -175,6 +186,12 @@ do
--fuzz)
opt_fuzz="--fuzz $2"
shift 2 ;;
+ --slow)
+ opt_fast=
+ shift ;;
+ --fast)
+ opt_fast=1
+ shift ;;
--)
shift
break ;;
@@ -203,8 +220,24 @@ case "$1" in
# check if rpmbuild is installed before running inspect
check_external_tool rpmbuild rpm-build
- if ! $QUILT_DIR/scripts/inspect $verbose $opt_sourcedir $opt_fuzz \
- "$spec_file" 2>&1 > $tmpfile
+ if [ -n "$opt_fast" ]
+ then
+ if [ "${prefix:0:1}" = / ]
+ then
+ targetdir=$prefix
+ else
+ targetdir=$PWD/$prefix
+ fi
+
+ $QUILT_DIR/scripts/inspect $verbose $opt_sourcedir $opt_fuzz \
+ --targetdir "$targetdir" \
+ "$spec_file" 2>&1 > $tmpfile
+ else
+ $QUILT_DIR/scripts/inspect $verbose $opt_sourcedir $opt_fuzz \
+ "$spec_file" 2>&1 > $tmpfile
+ fi
+
+ if [ $? -ne 0 ]
then
printf $"The %%prep section of %s failed; results may be incomplete\n" "$spec_file"
if [ -z "$verbose" ]
@@ -252,8 +285,10 @@ case "$1" in
esac
# Make sure that unpacking will not overwrite anything
+[ -n "$opt_fast" ] || \
check_for_existing_directories || exit 1
+[ -n "$opt_fast" ] || \
while read tag dir arg1 arg2
do
case "$tag" in