summaryrefslogtreecommitdiff
path: root/scripts/makepkg.sh.in
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2009-04-11 13:50:56 -0500
committerDan McGee <dan@archlinux.org>2009-04-11 13:50:56 -0500
commit93ca155b48a29685914ffa10b11be42ef5d4734a (patch)
tree33500882d30b496c391d26533640825cac60c665 /scripts/makepkg.sh.in
parent101c16b3eb8048dffd1c6c4438e84b759d2e2aff (diff)
parent0c614c181efec31ea8d3948745e5746b642cb10c (diff)
downloadpacman-93ca155b48a29685914ffa10b11be42ef5d4734a.tar.xz
Merge branch 'xav/repo-add'
Diffstat (limited to 'scripts/makepkg.sh.in')
-rw-r--r--scripts/makepkg.sh.in23
1 files changed, 16 insertions, 7 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 3070c66e..97acfb49 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -974,25 +974,34 @@ create_package() {
# tar it up
msg2 "$(gettext "Compressing package...")"
- local TAR_OPT
case "$PKGEXT" in
- *tar.gz) TAR_OPT="z" ;;
- *tar.bz2) TAR_OPT="j" ;;
+ *tar.gz) EXT=${PKGEXT%.gz} ;;
+ *tar.bz2) EXT=${PKGEXT%.bz2} ;;
*) warning "$(gettext "'%s' is not a valid archive extension.")" \
- "$PKGEXT" ;;
+ "$PKGEXT" ; EXT=$PKGEXT ;;
esac
+ local pkg_file="$PKGDEST/${nameofpkg}-${pkgver}-${pkgrel}-${CARCH}${EXT}"
- local pkg_file="$PKGDEST/${nameofpkg}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}"
+ local ret=0
# when fileglobbing, we want * in an empty directory to expand to
# the null string rather than itself
shopt -s nullglob
+ bsdtar -cf - $comp_files * > "$pkg_file" || ret=$?
+ shopt -u nullglob
- if ! bsdtar -c${TAR_OPT}f "$pkg_file" $comp_files *; then
+ if [ $ret -eq 0 ]; then
+ case "$PKGEXT" in
+ *tar.gz) gzip -f -n "$pkg_file" ;;
+ *tar.bz2) bzip2 -f "$pkg_file" ;;
+ esac
+ ret=$?
+ fi
+
+ if [ $ret -ne 0 ]; then
error "$(gettext "Failed to create package file.")"
exit 1 # TODO: error code
fi
- shopt -u nullglob
}
create_srcpackage() {