summaryrefslogtreecommitdiffstats
path: root/build_all_nss_packages_inside_mock.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build_all_nss_packages_inside_mock.sh')
-rw-r--r--build_all_nss_packages_inside_mock.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/build_all_nss_packages_inside_mock.sh b/build_all_nss_packages_inside_mock.sh
new file mode 100644
index 0000000..839bb20
--- /dev/null
+++ b/build_all_nss_packages_inside_mock.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+# Build a package inside mock
+
+
+# Ignore these warnings
+# Installing /builddir/build/RPMS
+# error: not an rpm package
+# error: /builddir/build/RPMS cannot be installed
+cd /builddir/build/RPMS/
+
+# build a client package and install all the produced rpm's
+default="nss"
+pkg=${pkg:-$default}
+
+# build and install the nss packages
+rpmbuild --rebuild /tmp/${pkg}-*.src.rpm
+cd /builddir/build/RPMS
+all_rpms=`ls *.rpm`
+new_rpms=()
+# build up the array of the ones not installed yet
+for file in $all_rpms; do
+ notInstalled=`rpm -q ${file} | grep "not installed"`
+ if [ -n "${notInstalled}" ]; then
+ new_rpms+=($file)
+ fi
+done
+# Must use force in incremental builds as sometines an older version is still
+# installed and we end up with conflicts. In real life this shoudn't happen
+# and neither have I seen this on koji builds.
+rpm --force -ihv *.rpm
+
+# tLen=${#NAMESERVERS[@]}
+#if [ ${#new_rpms[@]} -gt 0 ]; then
+# rpm --force -ihv ${new_rpms[@]}
+# echo "Force-installed: ${new_rpms[@]}";
+#else
+# rpm --force -ihv *.rpm
+# echo "Force-installed: ${all_rpms}";
+#fi
+