diff options
author | Jean Delvare <jdelvare@suse.de> | 2015-07-02 11:51:28 +0200 |
---|---|---|
committer | Jean Delvare <jdelvare@suse.de> | 2015-07-02 11:51:28 +0200 |
commit | 311e3e68dbc149b14dff9ff787806b4dd9f788ce (patch) | |
tree | e5cc45dada3d1158ed7d2c41801f2fcd12e0dbe0 | |
parent | ecfe1b53be0b06eec4e76bab3ce850dcbb3ca7e5 (diff) | |
download | quilt-311e3e68dbc149b14dff9ff787806b4dd9f788ce.tar.gz |
setup: Delay the computation of md5sums
In fast mode, don't compute the md5sum of the files in the source
directory before we need them. In most cases we will never actually
need them, so this avoids computing them for nothing.
Speed gain from this change can reach 12 %.
-rw-r--r-- | quilt/scripts/inspect-wrapper.in | 7 | ||||
-rw-r--r-- | quilt/setup.in | 12 |
2 files changed, 16 insertions, 3 deletions
diff --git a/quilt/scripts/inspect-wrapper.in b/quilt/scripts/inspect-wrapper.in index 9636a62..e26f672 100644 --- a/quilt/scripts/inspect-wrapper.in +++ b/quilt/scripts/inspect-wrapper.in @@ -5,6 +5,13 @@ original_file() { local md5sum=$1 + if ! [ -e $tmpdir/md5sums ] + then + echo >&4 + create_md5sums "$RPM_SOURCE_DIR" $tmpdir/md5sums + echo -n "### rpmbuild: " >&4 + fi + while read md5sum_ file_ do if [ "$md5sum" = "$md5sum_" ] diff --git a/quilt/setup.in b/quilt/setup.in index 165c008..0db8c73 100644 --- a/quilt/setup.in +++ b/quilt/setup.in @@ -142,7 +142,7 @@ create_md5sums() # 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 + [ -n "$QUILT_SETUP_FAST" ] && continue ;; esac [ -f "$file" ] || continue @@ -223,6 +223,7 @@ inspect() if [ -n "$targetdir" ] then # Fast mode + export QUILT_SETUP_FAST=1 [ -d "$targetdir" ] || mkdir -p "$targetdir" || exit 1 ln -s "$targetdir" $tmpdir/build else @@ -240,12 +241,17 @@ inspect() exec 3>&1 4>&2 5>/dev/null fi - create_md5sums "$sourcedir" $tmpdir/md5sums + if [ -n "$QUILT_SETUP_FAST" ] + then + export -f create_md5sums + else + create_md5sums "$sourcedir" $tmpdir/md5sums + fi # let rpm do all the dirty specfile stuff ... echo -n "### rpmbuild: " >&4 - PATH="$tmpdir/bin:$PATH" QUILT_SETUP_FAST=${targetdir:+1} \ + PATH="$tmpdir/bin:$PATH" \ rpmbuild --eval "%define _sourcedir $abs_sourcedir" \ --eval "%define _specdir $specdir" \ --eval "%define _builddir $tmpdir/build" \ |