Skip to content

Commit b4ce8d6

Browse files
committedMar 26, 2019
[RPM] Improve buildrpms.sh script and use pbzip2 when available
1 parent f878ecc commit b4ce8d6

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed
 

‎rpm/buildrpms.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,18 @@ Usage:
3838
'
3939
}
4040

41+
function compress
42+
{
43+
if command -v pbzip2 &> /dev/null; then
44+
echo 'pbzip2'
45+
else
46+
echo 'bzip2'
47+
fi
48+
}
49+
4150
if [ $_MOCK_OLD_CHROOT ]
4251
then
43-
mock_args="--old-chroot"
52+
mock_args="--old-chroot"
4453
fi
4554

4655
relver=1
@@ -133,7 +142,7 @@ then
133142

134143
print_info "Creating source tarball"
135144
# Create source tarball
136-
git -C .. archive --format=tar --prefix=qgis-$version/ HEAD | bzip2 > sources/qgis-$version.tar.bz2
145+
git -C .. archive --format=tar --prefix=qgis-$version/ HEAD | compress > sources/qgis-$version.tar.bz2
137146

138147
print_info "Creating source package"
139148
# Build source package
@@ -148,7 +157,7 @@ then
148157
fi
149158

150159
srpm=$(grep -e 'Wrote: .*\.src\.rpm' $OUTDIR/build.log |
151-
sed 's_Wrote: /builddir/build/SRPMS/\(.*\)_\1_')
160+
sed 's_Wrote: /builddir/build/SRPMS/\(.*\)_\1_')
152161

153162
print_info "Source package created: $srpm"
154163
fi

0 commit comments

Comments
 (0)
Please sign in to comment.