summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorBaptiste Daroussin <baptiste.daroussin@gmail.com>2007-06-22 19:23:28 +0100
committerDan McGee <dan@archlinux.org>2007-06-27 20:35:08 -0400
commit24c41f5190974e68444466d0d8563dbe9ab06768 (patch)
treed116e094c48f5eef5a0057a8f3e873f99b34356f /scripts
parent5a3b59583740c033a5e27b61c3c38bebfd580acc (diff)
downloadpacman-24c41f5190974e68444466d0d8563dbe9ab06768.tar.xz
FS7485: Replace tar/cpio/unzip with bsdtar for extracting/creating packages.
Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/makepkg.in22
1 files changed, 5 insertions, 17 deletions
diff --git a/scripts/makepkg.in b/scripts/makepkg.in
index 001179d0..f7f320fa 100644
--- a/scripts/makepkg.in
+++ b/scripts/makepkg.in
@@ -565,7 +565,6 @@ extract_sources() {
msg "$(gettext "Extracting Sources...")"
local netfile
for netfile in "${source[@]}"; do
- unziphack=0
file=$(strip_url "$netfile")
if in_array "$file" ${noextract[@]}; then
#skip source files in the noextract=() array
@@ -577,14 +576,7 @@ extract_sources() {
local file_type=$(file -biz "$file")
local cmd=''
case "$file_type" in
- *application/x-tar*application/x-compress*)
- cmd="tar -xzf $file" ;;
- *application/x-tar*)
- cmd="tar -xf $file" ;;
- *application/x-zip*)
- unziphack=1
- cmd="unzip -qqo $file" ;;
- *application/x-cpio*)
+ *application/x-tar*|*application/x-zip*|*application/x-cpio*)
cmd="bsdtar -x -f $file" ;;
*application/x-gzip*)
cmd="gunzip -d -f $file" ;;
@@ -600,12 +592,8 @@ extract_sources() {
msg2 "$cmd"
$cmd || ret=$?
if [ $ret -ne 0 ]; then
- # unzip will return a 1 as a warning, it is not an error
- if [ $unziphack -ne 1 -o $ret -ne 1 ]; then
- error "$(gettext "Failed to extract %s")" "$file"
- plain "$(gettext "Aborting...")"
- exit 1
- fi
+ error "$(gettext "Failed to extract %s")" "$file"
+ plain "$(gettext "Aborting...")"
fi
done
@@ -823,7 +811,7 @@ create_package() {
local pkg_file="$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}"
comp_files="$comp_files .PKGINFO .FILELIST"
- if ! tar -czf "$pkg_file" $comp_files $(ls); then
+ if ! bsdtar -czf "$pkg_file" $comp_files $(ls); then
error "$(gettext "Failed to create package file.")"
exit 1 # TODO: error code
fi
@@ -914,7 +902,7 @@ create_srcpackage() {
# tar it up
msg2 "$(gettext "Compressing source package...")"
- if ! tar -czf "$pkg_file" $comp_files; then
+ if ! bsdtar -czf "$pkg_file" $comp_files; then
error "$(gettext "Failed to create source package file.")"
exit 1 # TODO: error code
fi