summaryrefslogtreecommitdiffstats
path: root/build_all_nss_packages_inside_mock.sh
diff options
context:
space:
mode:
authorElio Maldonado <emaldona@redhat.com>2013-09-27 14:14:01 -0700
committerElio Maldonado <emaldona@redhat.com>2013-09-27 14:14:01 -0700
commitc10a849100db72a667a417939cb2b073706cc689 (patch)
tree926ce82d24af3d19f4b0e3156df87377b856ae87 /build_all_nss_packages_inside_mock.sh
parentaa3beac07f1cbededa5910ff1b4f0f0a0401dad5 (diff)
downloadnssmockbuilds4fedora-c10a849100db72a667a417939cb2b073706cc689.tar.gz
nssmockbuilds4fedora-c10a849100db72a667a417939cb2b073706cc689.tar.xz
nssmockbuilds4fedora-c10a849100db72a667a417939cb2b073706cc689.zip
Various fixes
- replace varuious conditionals with if then else fi statements - reorder the list of client packages to build
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
+