summaryrefslogtreecommitdiff
path: root/scripts/makepkg.sh.in
diff options
context:
space:
mode:
authorAndrew Fyfe <andrew@neptune-one.net>2007-07-10 13:11:40 +0100
committerDan McGee <dan@archlinux.org>2007-07-10 11:18:17 -0400
commit142225fd7db358655cc35acb365a983624a3a5bd (patch)
tree5c13dc3b4eff6587d2cb5e3ffdd68594e9961cf0 /scripts/makepkg.sh.in
parent862ea627617bc20b5c9a18b191aa5d548043db6b (diff)
downloadpacman-142225fd7db358655cc35acb365a983624a3a5bd.tar.xz
FS#7271 - [patch] option for avoiding caching netfiles
Change the behaviour of makepkg so no longer stores a copy of the source tarball in $srcdir, instead it downloads all sources to $SRCDEST then extracts them to $srcdir. Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
Diffstat (limited to 'scripts/makepkg.sh.in')
-rw-r--r--scripts/makepkg.sh.in58
1 files changed, 43 insertions, 15 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index ed12e761..137d58e5 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -433,16 +433,23 @@ remove_deps() {
download_sources() {
msg "$(gettext "Retrieving Sources...")"
+
+ if [ ! -w "$SRCDEST" ] ; then
+ error "$(gettext "You do not have write permission to store downloads in %s.")" "$SRCDEST"
+ plain "$(gettext "Aborting...")"
+ exit 1
+ fi
+
+ pushd "$SRCDEST" &>/dev/null
+
local netfile
for netfile in ${source[@]}; do
local file=$(strip_url "$netfile")
- if [ -f "../$file" ]; then
+ if [ -f "$startdir/$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
@@ -458,17 +465,9 @@ download_sources() {
plain "$(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
done
+
+ popd &>/dev/null
}
generate_checksums() {
@@ -504,6 +503,17 @@ generate_checksums() {
local netfile
for netfile in ${source[@]}; do
local file="$(strip_url "$netfile")"
+
+ if [ ! -f "$file" ] ; then
+ if [ ! -f "$SRCDEST/$file" ] ; then
+ error "$(gettext "Unable to find source file %s to generate checksum.")" "$file"
+ plain "$(gettext "Aborting...")"
+ exit 1
+ else
+ file=$SRCDEST/$file
+ fi
+ fi
+
local sum="$(${integ}sum "$file" | cut -d ' ' -f 1)"
[ $ct -gt 0 ] && echo -n "$indent"
echo -n "'$sum'"
@@ -541,14 +551,22 @@ check_checksums() {
file="$(strip_url "$file")"
echo -n " $file ... " >&2
+ if [ ! -f "$file" ] ; then
+ if [ ! -f "$file" ] ; then
+ echo "$(gettext "NOT FOUND")" >&2
+ errors=1
+ continue
+ else
+ file=$SRCDEST/$file
+ fi
+ fi
+
if echo "${integrity_sums[$idx]} $file" | ${integ}sum --status -c - &>/dev/null; then
echo "$(gettext "Passed")" >&2
else
echo "$(gettext "FAILED")" >&2
errors=1
fi
-
- idx=$(($idx+1))
done
if [ $errors -gt 0 ]; then
@@ -572,6 +590,16 @@ extract_sources() {
continue
fi
+ if [ ! -f "$file" ] ; then
+ if [ ! -f "$SRCDEST/$file" ] ; then
+ error "$(gettext "Unable to find source file %s for extraction.")" "$file"
+ plain "$(gettext "Aborting...")"
+ exit 1
+ else
+ file=$SRCDEST/$file
+ fi
+ fi
+
# fix flyspray #6246
local file_type=$(file -biz "$file")
local cmd=''