summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2013-10-10 12:29:07 +1000
committerAllan McRae <allan@archlinux.org>2013-10-14 12:59:49 +1000
commit2f7e92ad045fb276c8fe88d4793c8edc383d147c (patch)
treebeab30887b956e2d5ae01c7a47731ae340e73f32 /scripts
parentd5ff21c221e2821462adf0d642554ba09642f481 (diff)
downloadpacman-2f7e92ad045fb276c8fe88d4793c8edc383d147c.tar.xz
Link non-vcs sources into $srcdir during extraction
The separation between downloading and extracting for non-vsc sources was incomplete due to symlinks being made in $srcdir during the download stage. Have download_{local,file} just ensure the presence of the files in $startdir or $SRCDEST (downloading if needed) and then have extract_file symlink these files into $srcdir. Also replace "continue" with "return" in extract_file to make it clearer what is happening. Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/makepkg.sh.in20
1 files changed, 9 insertions, 11 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 30a162ec..e36e22b4 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -320,8 +320,6 @@ download_local() {
if [[ -n "$filepath" ]]; then
msg2 "$(gettext "Found %s")" "${filepath##*/}"
- rm -f "$srcdir/${filepath##*/}"
- ln -s "$filepath" "$srcdir/"
else
local filename=$(get_filename "$netfile")
error "$(gettext "%s was not found in the build directory and is not a URL.")" "$filename"
@@ -335,8 +333,6 @@ download_file() {
local filepath=$(get_filepath "$netfile")
if [[ -n "$filepath" ]]; then
msg2 "$(gettext "Found %s")" "${filepath##*/}"
- rm -f "$srcdir/${filepath##*/}"
- ln -s "$filepath" "$srcdir/"
return
fi
@@ -384,13 +380,15 @@ download_file() {
if [[ $dlfile != "$filename" ]]; then
mv -f "$SRCDEST/$dlfile" "$SRCDEST/$filename"
fi
-
- rm -f "$srcdir/$filename"
- ln -s "$SRCDEST/$filename" "$srcdir/"
}
extract_file() {
local file=$1
+
+ local filepath=$(get_filepath "$file")
+ rm -f "$srcdir/${file}"
+ ln -s "$filepath" "$srcdir/"
+
# do not rely on extension for file type
local file_type=$(file -bizL "$file")
local ext=${file##*.}
@@ -401,24 +399,24 @@ extract_file() {
*application/x-gzip*)
case "$ext" in
gz|z|Z) cmd="gzip" ;;
- *) continue;;
+ *) return;;
esac ;;
*application/x-bzip*)
case "$ext" in
bz2|bz) cmd="bzip2" ;;
- *) continue;;
+ *) return;;
esac ;;
*application/x-xz*)
case "$ext" in
xz) cmd="xz" ;;
- *) continue;;
+ *) return;;
esac ;;
*)
# See if bsdtar can recognize the file
if bsdtar -tf "$file" -q '*' &>/dev/null; then
cmd="bsdtar"
else
- continue
+ return
fi ;;
esac