summaryrefslogtreecommitdiffstats
path: root/redhat/build/update_repository.sh
diff options
context:
space:
mode:
authorFrançois Andriot <albator78@libertysurf.fr>2014-01-24 20:46:50 +0100
committerFrançois Andriot <albator78@libertysurf.fr>2014-01-24 20:46:50 +0100
commit43429e67cfc03fdf5065e90c197753ec5f15aa19 (patch)
tree3f85e6c48280c03682aa2aa92fca68fd9aa60634 /redhat/build/update_repository.sh
parentdf55195d132cbe6af516c6f1883315f26abd7f4a (diff)
downloadtde-packaging-43429e67cfc03fdf5065e90c197753ec5f15aa19.tar.gz
tde-packaging-43429e67cfc03fdf5065e90c197753ec5f15aa19.zip
RPM Packaging: update build scripts
Diffstat (limited to 'redhat/build/update_repository.sh')
-rwxr-xr-xredhat/build/update_repository.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/redhat/build/update_repository.sh b/redhat/build/update_repository.sh
new file mode 100755
index 000000000..bdd2f0f4f
--- /dev/null
+++ b/redhat/build/update_repository.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+WORKERS=$(getconf _NPROCESSORS_ONLN)
+
+if [ -x /usr/sbin/urpmi ]; then
+ REPOUPDATE='(cd $(rpm -E %{_rpmdir}); genhdlist2 --clean --allow-empty noarch; genhdlist2 --clean --allow-empty $(uname -i); sudo urpmi.update rpmbuild.$(uname -i) rpmbuild.noarch)'
+elif [ -x /usr/bin/zypper ]; then
+ REPOUPDATE='(cd $(rpm -E %{_rpmdir}); createrepo --workers=${WORKERS} $(uname -i); createrepo --workers=${WORKERS} noarch; sudo zypper refresh rpmbuild.$(uname -i) rpmbuild.noarch)'
+elif [ -x /usr/bin/yum ]; then
+ REPOUPDATE='(cd $(rpm -E %{_rpmdir}); createrepo $(uname -i); createrepo noarch; sudo yum clean all --disablerepo="*" --enablerepo="rpmbuild*")'
+elif [ -x /usr/bin/apt-get ]; then
+ REPOUPDATE='(cd $(rpm -E %{_rpmdir}); genpkglist $PWD noarch; genpkglist $PWD i586; genpkglist $PWD x86_64; genbasedir $PWD i586 x86_64 noarch; sudo apt-get update)'
+fi
+
+eval ${REPOUPDATE} || exit 1