[arch-commits] CVS update of arch/build/base/pacman (PKGBUILD pacman.install)

Aaron Griffin aaron at archlinux.org
Mon Apr 23 07:51:50 UTC 2007


    Date: Monday, April 23, 2007 @ 03:51:50
  Author: aaron
    Path: /home/cvs-arch/arch/build/base/pacman

Modified: PKGBUILD (1.134 -> 1.135) pacman.install (1.5 -> 1.6)

upgpkg: pacman 3.0.2-1
bug fix upgrade, see http://archlinux.org/pacman/ for details


----------------+
 PKGBUILD       |    8 ++++----
 pacman.install |   53 +++++++++++++++++++++++++++++++++++++++++++++++++----
 2 files changed, 53 insertions(+), 8 deletions(-)


Index: arch/build/base/pacman/PKGBUILD
diff -u arch/build/base/pacman/PKGBUILD:1.134 arch/build/base/pacman/PKGBUILD:1.135
--- arch/build/base/pacman/PKGBUILD:1.134	Wed Apr  4 01:39:56 2007
+++ arch/build/base/pacman/PKGBUILD	Mon Apr 23 03:51:50 2007
@@ -1,7 +1,7 @@
-# $Id: PKGBUILD,v 1.134 2007/04/04 05:39:56 aaron Exp $
+# $Id: PKGBUILD,v 1.135 2007/04/23 07:51:50 aaron Exp $
 # Maintainer: Aaron Griffin <aaron at archlinux.org>
 pkgname=pacman
-pkgver=3.0.1
+pkgver=3.0.2
 pkgrel=1
 pkgdesc="A library-based package manager with dependency support"
 arch=('i686' 'x86_64')
@@ -16,8 +16,8 @@
         etc/abs/supfile.{arch,extra,community,testing,unstable})
 install=pacman.install
 source=(ftp://ftp.archlinux.org/other/pacman/$pkgname-$pkgver.tar.gz)
-md5sums=('c1af4e271532f51346f7b2a78c2c3e68')
-options=(force)
+md5sums=('69611f002365584a5a0d119b66d59f16')
+options=(!libtool)
 
 build() {
   cd $startdir/src/$pkgname-$pkgver
Index: arch/build/base/pacman/pacman.install
diff -u arch/build/base/pacman/pacman.install:1.5 arch/build/base/pacman/pacman.install:1.6
--- arch/build/base/pacman/pacman.install:1.5	Sun Mar 25 23:21:17 2007
+++ arch/build/base/pacman/pacman.install	Mon Apr 23 03:51:50 2007
@@ -7,6 +7,12 @@
 # arg 1:  the new package version
 # arg 2:  the old package version
 post_upgrade() {
+  if [ "$(vercmp $2 3.0.2)" -lt 0 ]; then
+    echo ">>> Performing one-time reset of NoUpgrade md5sums. After this reset"
+	echo ">>> you are able to remove all NoUpgrade lines of already protected"
+	echo ">>> files from pacman.conf."
+  	_resetbackups
+  fi
   echo ">>> PLEASE READ THE FOLLOWING!"
   if [ "$(vercmp $2 3.0.0)" -lt 0 ]; then
     echo ">>> The makepkg.conf syntax has changed, please note the new format"
@@ -18,10 +24,49 @@
 
 _rankmirrors() {
   echo ">>> Use of the new rankmirrors script on your /etc/pacman.d/ files is"
-  echo ">>> highly recommended. Read rankmirrors --help for details. In"
-  echo ">>> addition, mirrors are now listed by country, so move those that"
-  echo ">>> are geographically close to you to the top and remove the others"
-  echo ">>> BEFORE running rankmirrors."
+  echo ">>> highly recommended. Python is required, and read rankmirrors --help"
+  echo ">>> for details. In addition, mirrors are now listed by country, so"
+  echo ">>> move those that are geographically close to you to the top and"
+  echo ">>> remove the others BEFORE running rankmirrors."
+}
+
+_resetbackups() {
+	# path variables
+	pacconf=/etc/pacman.conf
+	dbpath=/var/lib/pacman/local
+
+	# get a list of NoUpgrade files from the user's pacman.conf
+	echo ":: Retrieving pacman.conf NoUpgrade list..."
+	config=$(grep "^NoUpgrade" $pacconf | cut -d'=' -f2)
+	# add the standard list of files, even if they are already above
+	config="$config \
+	etc/passwd etc/group etc/shadow etc/sudoers \
+	etc/fstab etc/raidtab etc/ld.so.conf \
+	etc/rc.conf etc/rc.local \
+	etc/modprobe.conf etc/modules.conf \
+	etc/lilo.conf boot/grub/menu.lst"
+
+	# blank md5sum for use in sed expression
+	zeroes='00000000000000000000000000000000'
+
+	for file in $config; do
+		echo ":: -> finding owner of /$file..."
+		line=$(LANG=C pacman -Qo /$file 2>/dev/null)
+		# if file is owned by a package, go find its incorrectly stored sum
+		if [ ! -z "$line" ]; then
+			# get the name and version of the package owning file
+			name=$(echo $line | awk '{print $5}')
+			version=$(echo $line | awk '{print $6}')
+			# set the path to the backup array holding the md5sum
+			path="$dbpath/$name-$version/files"
+			# run a sed on the path to reset the line containing $file
+			# NOTE: literal tab characters in sed expression after $file
+			echo ":: -> resetting sum of /$file..."
+			sed -i "s#$file	[0-9a-fA-F]*#$file	$zeroes#" $path
+		else
+			echo ":: -> $file is unowned."
+		fi
+	done
 }
 
 op=$1




More information about the arch-commits mailing list