summaryrefslogtreecommitdiffstats
path: root/scripts/makepkg.sh.in
diff options
context:
space:
mode:
authorXavier Chantry <shiningxc@gmail.com>2009-02-19 19:12:34 +0100
committerXavier Chantry <shiningxc@gmail.com>2009-03-15 18:08:36 +0100
commitc8beffa7904abe7e0ad01fed6113acf449df15cd (patch)
treed8f4db6d26b2ed36300266ba0931b7a1ba01e4c1 /scripts/makepkg.sh.in
parent9519d22df7cef5b5a48a7d1ebee44a9e935e02b7 (diff)
downloadpacman-c8beffa7904abe7e0ad01fed6113acf449df15cd.tar.gz
pacman-c8beffa7904abe7e0ad01fed6113acf449df15cd.tar.xz
Fix several issues with xdelta
1) The changes to sync.c look big but there are mostly caused by the indentation. Fix a bug where download_size == 0 because the packages and deltas are already in the cache, but we still need to build the deltas list and apply the deltas to create the final package. 2) Fix the gzip / md5sum issue by switching to xdelta3, disabling external recompression and using gzip -n in pacman, and disable bsdtar compression and using gzip -n in makepkg. Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
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 0aa8a9b1..a41b0695 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -963,25 +963,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() {