Update mktarball.sh for git usage (needs .gitattributes).

This commit is contained in:
Felix Kauselmann 2018-06-06 13:12:29 +02:00
parent 381c0f6560
commit 335a3a0cdb
2 changed files with 15 additions and 8 deletions

8
.gitattributes vendored Normal file
View File

@ -0,0 +1,8 @@
# List files and directories to exclude from git archive
/dependencies/pdfium export-ignore
/dependencies/poppler export-ignore
/dependencies/qrencode export-ignore
/dependencies/unarr export-ignore
/dependencies/create-dmg export-ignore
.gitignore export-ignore
.gitattributes export-ignore

View File

@ -1,20 +1,19 @@
#! /bin/bash #! /bin/bash
#Script to create a source tarball for YACReader distribution and packaging #Script to create a source tarball for YACReader distribution and packaging
#This should be run from YACReaders top source directory #By default this will use the latest git tag for the current branch or whatever
#version supplied as argument
#This should be run from YACReader's top source directory
YACVERSION=9.0.0 YACVERSION=${1:-`git describe --long --tags`}
if [ ! -f "yacreader-${YACVERSION}-src.tar.xz" ] if [ ! -f "yacreader-${YACVERSION}-src.tar.xz" ]
then then
echo "Building source tarball" echo "Building source tarball for ${YACVERSION}"
else else
echo "Updating source tarball" echo "Updating source tarball for ${YACVERSION}"
rm yacreader-${YACVERSION}-src.tar* #delete old tarball, since tar can't update compressed archives rm yacreader-${YACVERSION}-src.tar* #delete old tarball, since tar can't update compressed archives
fi fi
hg archive -t tar -p yacreader-${YACVERSION} -X "dependencies/{unarr,pdfium,poppler}"\ git archive --format=tar --prefix=yacreader-${YACVERSION}/ HEAD | xz -c > yacreader-${YACVERSION}-src.tar.xz
yacreader-${YACVERSION}-src.tar
xz -c yacreader-${YACVERSION}-src.tar > yacreader-${YACVERSION}-src.tar.xz
rm yacreader-${YACVERSION}-src.tar
#Calculate checksum to enable packagers to verify whether they are using the original tarball. #Calculate checksum to enable packagers to verify whether they are using the original tarball.
md5sum yacreader-${YACVERSION}-src.tar.xz > yacreader-${YACVERSION}-src.tar.xz.md5sum md5sum yacreader-${YACVERSION}-src.tar.xz > yacreader-${YACVERSION}-src.tar.xz.md5sum