Skip to content

Commit

Permalink
Simplify script to generate release tarballs
Browse files Browse the repository at this point in the history
  • Loading branch information
amadio committed Mar 8, 2024
1 parent 57ea2a4 commit fcc2e24
Showing 1 changed file with 8 additions and 34 deletions.
42 changes: 8 additions & 34 deletions gen-tarball.sh
Original file line number Diff line number Diff line change
@@ -1,37 +1,11 @@
#!/bin/bash

# Generate a source tarball including submodules
if [ -z "${1}" ] ; then
echo No tag or branch given
exit 1
fi
ver=${1}
# Remove initial v from tag name for use in filenames
if [ ${ver:0:1} = 'v' ] ; then
fver=${ver:1}
else
fver=${ver}
fi
if [ -r xrootd-${fver}.tar.gz ] ; then
echo xrootd-${fver}.tar.gz already exists
exit 1
fi
curdir=$(pwd)
tdir=$(mktemp -d)
cd ${tdir}
git clone https://github.com/xrootd/xrootd.git
cd xrootd
git checkout ${ver}
if [ $? -ne 0 ] ; then
echo No such tag or branch: ${ver}
cd ${curdir}
rm -rf ${tdir}
exit 1
fi
git archive --prefix xrootd-${fver}/ ${ver} -o ${tdir}/xrootd-${fver}.tar
cd ${tdir}
gzip xrootd-${fver}.tar
mv xrootd-${fver}.tar.gz ${curdir}
cd ${curdir}
rm -rf ${tdir}
set -e

TAG=$(printf "%s" "$(git describe "${1:-HEAD}")")
NAME="xrootd-${TAG#v}"

set -x

git archive -9 --prefix="${NAME}/" -o "${NAME}.tar.gz" ${TAG}

0 comments on commit fcc2e24

Please sign in to comment.