mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-23 00:02:38 -05:00
[RPM] Fix rpmbuild.sh broken shell checks
This commit is contained in:
parent
8f9e782396
commit
08c095e7a7
@ -47,21 +47,18 @@ Usage:
|
||||
'
|
||||
}
|
||||
|
||||
function compress
|
||||
{
|
||||
if command -v pbzip2 &> /dev/null
|
||||
then
|
||||
echo 'pbzip2'
|
||||
else
|
||||
echo 'bzip2'
|
||||
fi
|
||||
}
|
||||
|
||||
if [ $_MOCK_OLD_CHROOT ]
|
||||
then
|
||||
mock_args="--old-chroot"
|
||||
fi
|
||||
|
||||
if command -v pbzip2 &> /dev/null
|
||||
then
|
||||
bzip2_cmd="pbzip2"
|
||||
else
|
||||
bzip2_cmd="bzip2"
|
||||
fi
|
||||
|
||||
relver=1
|
||||
compile_spec_only=0
|
||||
build_only=0
|
||||
@ -117,13 +114,6 @@ else
|
||||
timestamp=$(date +'%s')
|
||||
fi
|
||||
|
||||
# Clean logfiles
|
||||
if [ -f $OUTDIR/build.log ]
|
||||
then
|
||||
print_info "Cleaning log file"
|
||||
rm $OUTDIR/build.log
|
||||
fi
|
||||
|
||||
# Get the version string
|
||||
major=$(grep -e 'SET(CPACK_PACKAGE_VERSION_MAJOR' ../CMakeLists.txt |
|
||||
sed -r 's/.*\"([0-9]+)\".*/\1/g')
|
||||
@ -137,6 +127,12 @@ version=$major.$minor.$patch
|
||||
print_info "Building version $version-$relver"
|
||||
if [ "$build_only" -ne "1" ]
|
||||
then
|
||||
# Clean logfiles
|
||||
if [ -f $OUTDIR/build.log ]
|
||||
then
|
||||
print_info "Cleaning log file"
|
||||
rm $OUTDIR/build.log
|
||||
fi
|
||||
print_info "Creating spec file from template"
|
||||
# Create spec file
|
||||
cat qgis.spec.template \
|
||||
@ -152,7 +148,7 @@ then
|
||||
|
||||
print_info "Creating source tarball"
|
||||
# Create source tarball
|
||||
git -C .. archive --format=tar --prefix=qgis-$version/ HEAD | $(compress) > sources/qgis-$version.tar.bz2
|
||||
git -C .. archive --format=tar --prefix=qgis-$version/ HEAD | $bzip2_cmd > sources/qgis-$version.tar.bz2
|
||||
|
||||
print_info "Creating source package"
|
||||
# Build source package
|
||||
@ -165,12 +161,11 @@ then
|
||||
print_error "Creating source package failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
print_info "Source package created: $srpm"
|
||||
print_info "Source package created"
|
||||
fi
|
||||
|
||||
srpm="$(ls -t $OUTDIR/qgis-$version-$relver.*.src.rpm | head -n 1 ||
|
||||
(print_error "Source package unavailable. Abort"; exit 1))"
|
||||
srpm=$(grep -e 'Wrote: .*\.src\.rpm' $OUTDIR/build.log 2>/dev/null |
|
||||
sed 's_Wrote: /builddir/build/SRPMS/\(.*\)_\1_')
|
||||
|
||||
if [ "$srpm_only" -eq "1" ]
|
||||
then
|
||||
@ -180,7 +175,9 @@ fi
|
||||
# Create packages for every ARCH defined in the config file
|
||||
for arch in "${ARCHS[@]}"
|
||||
do :
|
||||
print_info "Building packages for $arch"
|
||||
if [ -f $OUTDIR/$srpm ]
|
||||
then
|
||||
print_info "Building $srpm for $arch"
|
||||
if [ -d $OUTDIR/$arch ]
|
||||
then
|
||||
if [ -f $OUTDIR/$arch/build.log ]
|
||||
@ -191,8 +188,7 @@ do :
|
||||
else
|
||||
mkdir $OUTDIR/$arch
|
||||
fi
|
||||
|
||||
if ! mock -r $arch --rebuild $srpm \
|
||||
if ! mock -r $arch --rebuild $OUTDIR/$srpm \
|
||||
--define "_relver $relver" \
|
||||
--define "_version $version" \
|
||||
--define "_timestamp $timestamp" \
|
||||
@ -204,6 +200,10 @@ do :
|
||||
# Add to package list
|
||||
packages="$packages $(ls $OUTDIR/$arch/*-$version-$relver.*.rpm)"
|
||||
fi
|
||||
else
|
||||
print_error "Source package unavailable. Abort"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
if $NOSIGN
|
||||
|
Loading…
x
Reference in New Issue
Block a user