diff options
author | Dag Odenhall <dag.odenhall@gmail.com> | 2007-05-30 23:04:36 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-05-31 00:07:12 -0400 |
commit | 2ef1c8416f99ae62dc9e6d570ccbaefcc6fc3eed (patch) | |
tree | 2cc46ed694ae01844bd9754aecddf4074f833d3e /scripts | |
parent | 90a307bfa3bc93be5a24e192deedc761b76cdb8d (diff) |
makepkg: do not retrieve sources if NOEXTRACT or REPKG set
Signed-off-by: Dag Odenhall <dag.odenhall@gmail.com>
Signed-off-by: Andrew Fyfe <Andrew Fyfe andrew@neptune-one.net>
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/makepkg.in | 72 |
1 files changed, 38 insertions, 34 deletions
diff --git a/scripts/makepkg.in b/scripts/makepkg.in index 65edb422..00e7b443 100644 --- a/scripts/makepkg.in +++ b/scripts/makepkg.in @@ -997,43 +997,47 @@ cd "$startdir" mkdir -p src cd "$srcdir" -msg "$(gettext "Retrieving Sources...")" -for netfile in ${source[@]}; do - file=$(strip_url "$netfile") - if [ -f "../$file" ]; then - msg2 "$(gettext "Found %s in build dir")" "$file" - cp "../$file" . - continue - elif [ -f "$SRCDEST/$file" ]; then - msg2 "$(gettext "Using cached copy of %s")" "$file" - cp "$SRCDEST/$file" . - continue - fi - - # find the client we should use for this URL - dlclient=$(getdownloadclient $netfile) || exit $? - - msg2 "$(gettext "Downloading %s")" "$file" - # fix flyspray bug #3289 - ret=0 - $dlclient "$netfile" || ret=$? - if [ $ret -gt 0 ]; then - error "$(gettext "Failure while downloading %s")" "$file" - msg "$(gettext "Aborting...")" - exit 1 - fi - - if [ -n "$SRCDEST" ]; then - mkdir -p "$SRCDEST" && cp "$file" "$SRCDEST" || ret=$? +if [ "$NOEXTRACT" = "1" -o "$REPKG" = "1" ]; then + warning "$(gettext "Skipping source retrieval -- using existing src/ tree")" +else + msg "$(gettext "Retrieving Sources...")" + for netfile in ${source[@]}; do + file=$(strip_url "$netfile") + if [ -f "../$file" ]; then + msg2 "$(gettext "Found %s in build dir")" "$file" + cp "../$file" . + continue + elif [ -f "$SRCDEST/$file" ]; then + msg2 "$(gettext "Using cached copy of %s")" "$file" + cp "$SRCDEST/$file" . + continue + fi + + # find the client we should use for this URL + dlclient=$(getdownloadclient $netfile) || exit $? + + msg2 "$(gettext "Downloading %s")" "$file" + # fix flyspray bug #3289 + ret=0 + $dlclient "$netfile" || ret=$? if [ $ret -gt 0 ]; then - warning "$(gettext "You do not have correct permissions to cache source in %s")" "$SRCDEST" + error "$(gettext "Failure while downloading %s")" "$file" + msg "$(gettext "Aborting...")" + exit 1 + fi + + if [ -n "$SRCDEST" ]; then + mkdir -p "$SRCDEST" && cp "$file" "$SRCDEST" || ret=$? + if [ $ret -gt 0 ]; then + warning "$(gettext "You do not have correct permissions to cache source in %s")" "$SRCDEST" + cp "$file" .. + fi + else cp "$file" .. fi - else - cp "$file" .. - fi -done -unset netfile file dlclient ret + done + unset netfile file dlclient ret +fi if [ "$NOEXTRACT" = "1" -o "$REPKG" = "1" ]; then warning "$(gettext "Skipping source integrity checks -- using existing src/ tree")" |