blob: c651fc3f533becf87be16aed2da69c25342bf1f8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#!/bin/bash
WORKERS=$(getconf _NPROCESSORS_ONLN)
TDE_VERSION="${1:-14.0.0}"
LOCKFILE="/tmp/lock.${0##*/}"
while [ -e "${LOCKFILE}" ]; do
echo "Waiting for lock file '${LOCKFILE}' to vanish."
sleep 3
done
if [ -x /usr/sbin/urpmi ]; then
REPOUPDATE='(cd $(rpm -E %{_rpmdir}.tde-${TDE_VERSION}); 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}.tde-${TDE_VERSION}); 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}.tde-${TDE_VERSION}); createrepo $(uname -i); createrepo noarch; sudo yum clean all --disablerepo="*" --enablerepo="rpmbuild*")'
elif [ -x /usr/bin/apt-get ]; then
REPOUPDATE='(cd $(rpm -E %{_rpmdir}.tde-${TDE_VERSION}); genpkglist $PWD noarch; genpkglist $PWD i586; genpkglist $PWD x86_64; genbasedir $PWD i586 x86_64 noarch; sudo apt-get update)'
fi
eval "${REPOUPDATE}; rm -f ${LOCKFILE}"|| exit 1
|