summaryrefslogtreecommitdiffstats
path: root/packaging
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2010-12-03 02:13:46 -0700
committerMichael Adam <obnox@samba.org>2011-04-06 15:00:46 +0200
commit768bb1b28322506e2d4f4caccf4a910102c25da7 (patch)
treefa9720cbc9e73875b20b29cf84f1c301cbb2ab58 /packaging
parenta16520b6939cb6d87f5818db0ac3ded228053cee (diff)
downloadsamba-768bb1b28322506e2d4f4caccf4a910102c25da7.tar.gz
samba-768bb1b28322506e2d4f4caccf4a910102c25da7.tar.xz
samba-768bb1b28322506e2d4f4caccf4a910102c25da7.zip
packaging(RHEL-CTDB): Fix debuginfo builds
At least on RHEL 5.5, we observed broken debuginfo packages when either old build directories were still present or old debuginfo packages (of samba) were installed. This patch removes the debuginfo samba RPMs and old RPM build directories, giving the user a 10 second chance to quit.
Diffstat (limited to 'packaging')
-rwxr-xr-xpackaging/RHEL-CTDB/makerpms.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/packaging/RHEL-CTDB/makerpms.sh b/packaging/RHEL-CTDB/makerpms.sh
index 74d5f7b3d95..c1a4b70151f 100755
--- a/packaging/RHEL-CTDB/makerpms.sh
+++ b/packaging/RHEL-CTDB/makerpms.sh
@@ -18,6 +18,7 @@ EXTRA_OPTIONS="$1"
RPMSPECDIR=`rpm --eval %_specdir`
RPMSRCDIR=`rpm --eval %_sourcedir`
+RPMBUILDDIR=`rpm --eval %_builddir`
# At this point the RPMSPECDIR and RPMSRCDIR variables must have a value!
@@ -42,6 +43,43 @@ case $RPMVER in
esac
##
+## Delete the old debuginfo remnants:
+##
+## At least on RHEL 5.5, we observed broken debuginfo packages
+## when either old build directories were still present or old
+## debuginfo packages (of samba) were installed.
+##
+## Remove the debuginfo samba RPMs and old RPM build
+## directories, giving the user a 10 second chance to quit.
+##
+
+if rpm -qa | grep -q samba-debuginfo || test -n "$(echo ${RPMBUILDDIR}/samba* | grep -v \*)" ; then
+ echo "Removing debuginfo remnants to fix debuginfo build:"
+ if rpm -qa | grep -q samba-debuginfo ; then
+ echo "Uninstalling the samba-debuginfo RPM"
+ echo -n "Press Control-C if you want to quit (you have 10 seconds)"
+ for count in $(seq 1 10) ; do
+ echo -n "."
+ sleep 1
+ done
+ echo
+ echo "That was your chance... :-)"
+ rpm -e samba-debuginfo
+ fi
+ if test -n "$(echo ${RPMBUILDDIR}/samba* | grep -v \*)" ; then
+ echo "Deleting ${RPMBUILDDIR}/samba*"
+ echo -n "Press Control-C if you want to quit (you have 10 seconds)"
+ for count in $(seq 1 10) ; do
+ echo -n "."
+ sleep 1
+ done
+ echo
+ echo "That was your chance... :-)"
+ rm -rf ${RPMBUILDDIR}/samba*
+ fi
+fi
+
+##
## determine the samba version and create the SPEC file
##
${DIRNAME}/makespec.sh