SPECS (DEVEL): bash-completion.spec - skip "upgrade" trigger on "downgrade"

glen glen at pld-linux.org
Thu Apr 2 23:41:41 CEST 2009


Author: glen                         Date: Thu Apr  2 21:41:41 2009 GMT
Module: SPECS                         Tag: DEVEL
---- Log message:
- skip "upgrade" trigger on "downgrade"

---- Files affected:
SPECS:
   bash-completion.spec (1.142.2.3 -> 1.142.2.4) 

---- Diffs:

================================================================
Index: SPECS/bash-completion.spec
diff -u SPECS/bash-completion.spec:1.142.2.3 SPECS/bash-completion.spec:1.142.2.4
--- SPECS/bash-completion.spec:1.142.2.3	Thu Apr  2 23:04:44 2009
+++ SPECS/bash-completion.spec	Thu Apr  2 23:41:36 2009
@@ -7,7 +7,7 @@
 Summary(pl.UTF-8):	Programowalne uzupełnianie nazw dla basha
 Name:		bash-completion
 Version:	20081219
-Release:	0.17
+Release:	0.18
 License:	GPL
 Group:		Applications/Shells
 Source0:	ftp://distfiles.gentoo.org/pub/gentoo/distfiles/%{name}-%{version}.tar.bz2
@@ -95,25 +95,31 @@
 sed -i -e '/^# START bash completion/,/^# END bash completion/d' /etc/bashrc
 
 %triggerpostun -- %{name} < 20081219-0.1
+# don't do anything on --downgrade
+if [ $1 -le 1 ]; then
+	exit 0
+fi
 # No rpm in vservers
-if [ -x /bin/rpm ]; then
-	# This ugly trigger is here because we package same pathnames as ghost
-	# meaning the files will lay around from previous package version.
-
-	# get files which are ghost for us
-	files=$(rpm -ql %{name}-%{version}-%{release} | grep %{_sysconfdir}/bash_completion.d/)
-
-	# this is to get old pkg NVR, actually gives list of files that are
-	# packaged by other versions than this installed one, which is ok even for
-	# multiple bash-completion pkgs being installed.
-	oldpkg=$(rpm -qf $(echo "$files") 2>/dev/null | grep -v 'is not' | sort -u | grep -v %{name}-%{version}-%{release})
-	for a in $(rpm -ql $oldpkg | grep %{_sysconfdir}/bash_completion.d/); do
-		# remove files from old package (which are ghost in new pkg),
-		# if not already converted to symlink
-		[ -L $a ] || rm -f $a
-	done
+if [ ! -x /bin/rpm ]; then
+	exit 0
 fi
 
+# This ugly trigger is here because we package same pathnames as ghost
+# meaning the files will lay around from previous package version.
+
+# get files which are ghost for us
+files=$(rpm -ql %{name}-%{version}-%{release} | grep %{_sysconfdir}/bash_completion.d/)
+
+# this is to get old pkg NVR, actually gives list of files that are
+# packaged by other versions than this installed one, which is ok even for
+# multiple bash-completion pkgs being installed.
+oldpkg=$(rpm -qf $(echo "$files") 2>/dev/null | grep -v 'is not' | sort -u | grep -v %{name}-%{version}-%{release})
+for a in $(rpm -ql $oldpkg | grep %{_sysconfdir}/bash_completion.d/); do
+	# remove files from old package (which are ghost in new pkg),
+	# if not already converted to symlink
+	[ -L $a ] || rm -f $a
+done
+
 # Usage: bashcomp_trigger PACKAGENAME [SCRIPTNAME]
 %define bashcomp_trigger() \
 %triggerin -- %1\
@@ -194,6 +200,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.142.2.4  2009/04/02 21:41:36  glen
+- skip "upgrade" trigger on "downgrade"
+
 Revision 1.142.2.3  2009/04/02 21:04:44  glen
 - make relative symlinks (so they look good when browsing vserver/chroot)
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SPECS/bash-completion.spec?r1=1.142.2.3&r2=1.142.2.4&f=u



More information about the pld-cvs-commit mailing list