From a87ebb916a98dd8434d194a6c95ed03b7eef6615 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Thu, 2 Jul 2015 11:51:32 +0200 Subject: setup: Reorder code in function inspect() Reorder the code in function inspect() to avoid testing for the same condition twice. --- quilt/setup.in | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/quilt/setup.in b/quilt/setup.in index 0db8c73..41a2d9a 100644 --- a/quilt/setup.in +++ b/quilt/setup.in @@ -220,17 +220,6 @@ inspect() ln -s $QUILT_DIR/scripts/inspect-wrapper $tmpdir/bin/patch ln -s $QUILT_DIR/scripts/inspect-wrapper $tmpdir/bin/tar ln -s $QUILT_DIR/scripts/inspect-wrapper $tmpdir/bin/unzip - if [ -n "$targetdir" ] - then - # Fast mode - export QUILT_SETUP_FAST=1 - [ -d "$targetdir" ] || mkdir -p "$targetdir" || exit 1 - ln -s "$targetdir" $tmpdir/build - else - # Standard mode - mkdir -p $tmpdir/build - fi - export -f normalize_path dir_to_dir # Redirect file descriptors # 5 is used in verbose mode, 4 in non-verbose mode, and 2 for both (real errors) @@ -241,12 +230,19 @@ inspect() exec 3>&1 4>&2 5>/dev/null fi - if [ -n "$QUILT_SETUP_FAST" ] + if [ -n "$targetdir" ] then + # Fast mode + export QUILT_SETUP_FAST=1 + [ -d "$targetdir" ] || mkdir -p "$targetdir" || exit 1 + ln -s "$targetdir" $tmpdir/build export -f create_md5sums else + # Standard mode + mkdir -p $tmpdir/build create_md5sums "$sourcedir" $tmpdir/md5sums fi + export -f normalize_path dir_to_dir # let rpm do all the dirty specfile stuff ... echo -n "### rpmbuild: " >&4 -- cgit