diff options
Diffstat (limited to 'redhat/build')
-rwxr-xr-x | redhat/build/install_rpm_package.sh | 6 | ||||
-rwxr-xr-x | redhat/build/update_repository.sh | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/redhat/build/install_rpm_package.sh b/redhat/build/install_rpm_package.sh index 8c9973037..13daa1258 100755 --- a/redhat/build/install_rpm_package.sh +++ b/redhat/build/install_rpm_package.sh @@ -1,5 +1,11 @@ #!/bin/bash +LOCKFILE="/tmp/lock.${0##*/}" +while [ -e "${LOCKFILE}" ]; do + echo "Waiting for lock file '${LOCKFILE}' to vanish." + sleep 3 +done + PKGCATEGORY="${1%%/*}" PKGNAME="${1##*/}" diff --git a/redhat/build/update_repository.sh b/redhat/build/update_repository.sh index bdd2f0f4f..8ffeabe93 100755 --- a/redhat/build/update_repository.sh +++ b/redhat/build/update_repository.sh @@ -2,6 +2,12 @@ WORKERS=$(getconf _NPROCESSORS_ONLN) +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}); 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 @@ -12,4 +18,4 @@ 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 +eval "${REPOUPDATE}; rm -f ${LOCKFILE}"|| exit 1 |