diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-07-08 20:57:47 -0600 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-07-08 20:57:47 -0600 |
commit | 3f87ea5a27b080756b3994674d842185e3e0c496 (patch) | |
tree | bcc1cdb99482bf2b30aba37c2f1a5efd1bf6e653 /src/librefetch | |
parent | de47a853ef515db2b9a775c235239efacd16041b (diff) |
librefetch: don't create modified files until after the help/version modes
Diffstat (limited to 'src/librefetch')
-rwxr-xr-x | src/librefetch/librefetch | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index 5428655..07303ae 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -66,16 +66,6 @@ main() { mode=download-create parse_options "$@" - local startdir=$PWD - export BUILDDIR="${BUILDFILE%/*}" - if [[ -f "${BUILDDIR}/SRCBUILD" ]]; then - BUILDFILE="${BUILDDIR}/SRCBUILD" - srcbuild="$(modified_srcbuild "$BUILDFILE")" - else - srcbuild="$(modified_pkgbuild "$BUILDFILE")" - fi - makepkg="$(modified_makepkg "$(which "${MAKEPKG:-makepkg}")")" - # Mode: version, help ################################################## if [[ $mode =~ version ]]; then @@ -87,6 +77,18 @@ main() { return 0 fi + ######################################################################## + + local startdir=$PWD + export BUILDDIR="${BUILDFILE%/*}" + if [[ -f "${BUILDDIR}/SRCBUILD" ]]; then + BUILDFILE="${BUILDDIR}/SRCBUILD" + srcbuild="$(modified_srcbuild "$BUILDFILE")" + else + srcbuild="$(modified_pkgbuild "$BUILDFILE")" + fi + makepkg="$(modified_makepkg "$(which "${MAKEPKG:-makepkg}")")" + # Mode: checksums ###################################################### if [[ $mode =~ checksums ]]; then |