summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2017-04-24 01:10:25 -0700
committerH. Peter Anvin <hpa@zytor.com>2017-04-24 01:10:25 -0700
commitf319eb86df8171c1d298807e2ecc84034fc84a25 (patch)
tree1a0395122d5462bb95f781786f11b6c6ea2f8f30
parent77c8356423c1272d5f950528cfcb20850726a986 (diff)
downloadnasmbuild-f319eb86df8171c1d298807e2ecc84034fc84a25.tar.gz
nasmbuild-f319eb86df8171c1d298807e2ecc84034fc84a25.tar.xz
nasmbuild-f319eb86df8171c1d298807e2ecc84034fc84a25.zip
buildall.sh: generate repodata for RPM builds, fix locking
Fix locking so we lock the work directory even for test builds. Generate repodata when we build RPMs. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rwxr-xr-xbuildall.sh18
1 files changed, 13 insertions, 5 deletions
diff --git a/buildall.sh b/buildall.sh
index ed2f72e..9568d20 100755
--- a/buildall.sh
+++ b/buildall.sh
@@ -15,13 +15,20 @@ READMES=/home/nasmbuild/readmes
export PATH=/home/nasmbuild/bin:/bin:/usr/bin:/usr/local/bin:/opt/watcom/bin
-cd $here
-
if [ `whoami` != nasmbuild ]; then
echo "$0: run me as nasmbuild, please" 1>&2
exit 1
fi
+declare -A args
+for arg; do args["$arg"]=true; done
+
+if [ -z "${args[locked]}" ]; then
+ exec flock -x $here "$0" "$@" locked
+fi
+
+cd $here
+
build () {
version="$1"
outdir="$2"
@@ -55,12 +62,12 @@ build () {
# --- Generate Linux RPMs ---
(
mkdir -p rpmbuild/i386/{BUILD,RPMS,SRPMS,SPECS,SOURCES}
- do32 rpmbuild -D "%_topdir ${here}/rpmbuild/i386" --target i386 -ta nasm-$version.tar.xz
+ do32 rpmbuild -D "%_topdir ${here}/rpmbuild/i386" --target i386 -tb nasm-$version.tar.xz
) > log/rpm32 2>&1 &
jobn[rpm32]=$!
(
mkdir -p rpmbuild/x86_64/{BUILD,RPMS,SRPMS,SPECS,SOURCES}
- rpmbuild -D "%_topdir ${here}/rpmbuild/x86_64" --target x86_64 -ta nasm-$version.tar.xz
+ rpmbuild -D "%_topdir ${here}/rpmbuild/x86_64" -ta nasm-$version.tar.xz
) > log/rpm64 2>&1 &
jobn[rpm64]=$!
@@ -206,6 +213,7 @@ build () {
#mv -f nasm-${version}-os2.zip "$outdir"/os2/
# Linux (RPMS)
find rpmbuild -name \*.rpm -exec mv -f '{}' "$outdir"/linux/ \;
+ ( cd "$outdir"/linux && createrepo_c . )
# Expanded docs
cp -a doc "$outdir"/doc
@@ -245,7 +253,7 @@ HEAD=$(cd git && git rev-parse HEAD)
# Test run? Make sure to lock the working directory so the
# regular robot doesn't step on us...
#
-if [ x"$1" = xtest ]; then
+if [ -n "${args[test]}" ]; then
rm -rf /var/tmp/nasmtest
build $(cat git/version)-test /var/tmp/nasmtest git "$HEAD"
exit 0