From 335a3a0cdb9098bbad32bf06cf64c9eed22d11e7 Mon Sep 17 00:00:00 2001 From: Felix Kauselmann Date: Wed, 6 Jun 2018 13:12:29 +0200 Subject: [PATCH] Update mktarball.sh for git usage (needs .gitattributes). --- .gitattributes | 8 ++++++++ mktarball.sh | 15 +++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..8d4a272b --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/mktarball.sh b/mktarball.sh index ee56c4a1..d27489f7 100755 --- a/mktarball.sh +++ b/mktarball.sh @@ -1,20 +1,19 @@ #! /bin/bash #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" ] then - echo "Building source tarball" + echo "Building source tarball for ${YACVERSION}" 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 fi -hg archive -t tar -p yacreader-${YACVERSION} -X "dependencies/{unarr,pdfium,poppler}"\ - yacreader-${YACVERSION}-src.tar -xz -c yacreader-${YACVERSION}-src.tar > yacreader-${YACVERSION}-src.tar.xz -rm yacreader-${YACVERSION}-src.tar +git archive --format=tar --prefix=yacreader-${YACVERSION}/ HEAD | xz -c > yacreader-${YACVERSION}-src.tar.xz #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