[pacman-dev] Fwd: [Arch Linux] patch for bacman from pacman-contrib package

Allan McRae allan at archlinux.org
Sat Aug 21 21:49:14 EDT 2010


Forwarding to the pacman-dev list.

I'd prefer some copying of the code we use in makepkg to decide how to 
compress a package based on PKGEXT.

Alla

-------- Original Message --------
Subject: 	[Arch Linux] patch for bacman from pacman-contrib package
Date: 	Sat, 21 Aug 2010 11:58:17 +1000
From: 	Nelson Chan <khcha.n.el at gmail.com>
To: 	allan at archlinux.org



originally, bacman doesn't catch up with current  .pkg.tar.xz package format
it produces a package named according /etc/makepkg.conf (e.g. *.pkg.tar.xz)
but it fact it created a .gz format instead of xz

Package : pacman-contrib (version 3.4.0-1)
Component: /usr/bin/bacman    (version 0.2.1)

---
Nelson Chan



here is the patch:

--- bacman.orig    2010-08-21 00:15:43.480000752 +1000
+++ bacman    2010-08-21 00:22:20.440001311 +1000
@@ -87,7 +87,7 @@

   pkg_arch=${CARCH:-'unknown'}
   pkg_dest="${PKGDEST:-$PWD}"
-pkg_ext=${PKGEXT:-'.pkg.tar.gz'}
+pkg_ext=${PKGEXT}
   pkg_pkger=${PACKAGER:-'Unknown Packager'}

   pkg_name="$1"
@@ -266,7 +266,15 @@
   echo "Generating the package..."

   ret=0
-bsdtar -czf "$pkg_dest/$pkg_namver-$pkg_arch$pkg_ext" $(ls -A) || ret=$?
+if [[ $pkg_ext == ".pkg.tar.xz" ]]; then
+    tar -cJf "$pkg_dest/$pkg_namver-$pkg_arch.pkg.tar.xz" $(ls -A) ||
ret=$?
+elif [[ $pkg_ext == ".pkg.tar.bz2" ]]; then
+    bsdtar -cyf "$pkg_dest/$pkg_namver-$pkg_arch.pkg.tar.bz2" $(ls -A)
|| ret=$?
+else
+    bsdtar -czf "$pkg_dest/$pkg_namver-$pkg_arch.pkg.tar.gz" $(ls -A)
|| ret=$?
+fi
+
+
   if [ $ret -ne 0 ]; then
       echo "ERROR: unable to write package to $pkg_dest"
       echo "       Maybe the disk is full or you do not have write access"





-------------- next part --------------
A non-text attachment was scrubbed...
Name: bacman.patch
Type: application/octet-stream
Size: 926 bytes
Desc: not available
URL: <http://mailman.archlinux.org/pipermail/pacman-dev/attachments/20100822/c73fa63d/attachment.obj>


More information about the pacman-dev mailing list