summaryrefslogtreecommitdiffstats
path: root/pki/dogtag/scripts/create_pki_yum_repos
diff options
context:
space:
mode:
authormharmsen <mharmsen@c9f7a03b-bd48-0410-a16d-cbbf54688b0b>2011-10-04 01:17:41 +0000
committermharmsen <mharmsen@c9f7a03b-bd48-0410-a16d-cbbf54688b0b>2011-10-04 01:17:41 +0000
commita4682ceae6774956461edd03b2485bbacea445f4 (patch)
tree94c475a125441da63101738220ce3972cf37db61 /pki/dogtag/scripts/create_pki_yum_repos
parent0c775428675d2cb1be9551f84e6b741ca813f77e (diff)
downloadpki-a4682ceae6774956461edd03b2485bbacea445f4.tar.gz
pki-a4682ceae6774956461edd03b2485bbacea445f4.tar.xz
pki-a4682ceae6774956461edd03b2485bbacea445f4.zip
Bugzilla Bug #688225 - (dogtagIPAv2.1) TRACKER: of the Dogtag fixes for freeIPA 2.1IPA_v2_RHEL_6_2_20111003
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/tags/IPA_v2_RHEL_6_2_20111003@2252 c9f7a03b-bd48-0410-a16d-cbbf54688b0b
Diffstat (limited to 'pki/dogtag/scripts/create_pki_yum_repos')
-rwxr-xr-xpki/dogtag/scripts/create_pki_yum_repos73
1 files changed, 73 insertions, 0 deletions
diff --git a/pki/dogtag/scripts/create_pki_yum_repos b/pki/dogtag/scripts/create_pki_yum_repos
new file mode 100755
index 000000000..95cf500fb
--- /dev/null
+++ b/pki/dogtag/scripts/create_pki_yum_repos
@@ -0,0 +1,73 @@
+#!/bin/bash
+
+# This script may ONLY be run on Linux!
+PKI_OS=`uname`
+if [ "${PKI_OS}" != "Linux" ]; then
+ printf "The '$0' script is ONLY executable\n"
+ printf "on a 'Linux' machine!\n"
+ exit 255
+fi
+
+# Always switch into the base directory three levels
+# above this shell script prior to executing it so
+# that all of its output is written to this directory
+cd `dirname $0`/../../..
+
+# Retrieve the name of this base directory
+PKI_PWD=`pwd`
+
+# Establish the release directory
+PKI_RELEASE_ROOT="${PKI_PWD}/release"
+
+# This script is only executable from the directory
+# containing the "./release" directory!
+if [ ! -d ./release ]; then
+ printf "The '$0' script is ONLY executable\n"
+ printf "from the directory containing './release'!\n"
+ exit 255
+fi
+
+printf "Removing any 'RPMS/' and 'SRPMS/' directories . . . "
+if [ -d RPMS ]; then
+ rm -rf RPMS
+fi
+if [ -d SRPMS ]; then
+ rm -rf SRPMS
+fi
+printf "done.\n\n"
+
+printf "Creating new 'RPMS/' and 'SRPMS/' directories . . . "
+mkdir RPMS SRPMS
+printf "done.\n\n"
+
+printf "Copying all 'RPMS' and 'SRPMS' into the 'RPMS/' directory . . . "
+cd ./release
+find . -name "*.rpm" | xargs -n1 -I{} cp -p {} ../RPMS
+cd ..
+printf "done.\n\n"
+
+printf "Moving all 'SRPMS' into the 'SRPMS/' directory . . . "
+mv ./RPMS/*.src.rpm ./SRPMS
+printf "done.\n\n"
+
+if [ -x /usr/bin/createrepo ]; then
+ printf "Attempting to create a yum repo in the 'RPMS/' directory . . .\n"
+ /usr/bin/createrepo ./RPMS
+ printf "done.\n\n"
+
+ printf "Attempting to create a yum repo in the 'SRPMS/' directory . . .\n"
+ /usr/bin/createrepo ./SRPMS
+ printf "done.\n\n"
+fi
+
+printf "Counting all 'RPMS' . . . "
+RPM_COUNT=`ls -1 ./RPMS/*.rpm | wc -l`
+printf "done.\n\n"
+
+printf "Counting all 'SRPMS' . . . "
+SRPM_COUNT=`ls -1 ./SRPMS/*.rpm | wc -l`
+printf "done.\n\n"
+
+printf "TOTAL: RPMS = ${RPM_COUNT}\n"
+printf " SRPMS = ${SRPM_COUNT}\n\n"
+