6 # invoke with do-release 2.N.M, or 2.N.M-rcXX
8 # Default maintainer values
9 SRCDIR
="${HOME}/git/lttng-modules"
10 # The output files are created in ${HOME}/stable/
11 OUTPUTDIR
="${HOME}/stable"
16 echo "Usage: do-release.sh [OPTION]... RELEASE"
18 echo "Mandatory arguments to long options are mandatory for short options too."
19 echo " -s, --srcdir DIR source directory"
20 echo " -o, --outputdir DIR output directory, must exist"
21 echo " -n, --no-sign don't GPG sign the output archive"
22 echo " -v, --verbose verbose command output"
51 # Catch unknown arguments
63 set -- "${POS_ARGS[@]}"
67 if [ x
"${REL}" = x
"" ]; then
72 echo "Doing LTTng modules release ${REL}"
73 echo " Source dir: ${SRCDIR}"
74 echo " Output dir: ${OUTPUTDIR}"
75 echo " GPG sign: ${SIGN}"
77 # Make sure the output directory exists
78 if [ ! -d "${OUTPUTDIR}" ]; then
79 echo "Output directory '${OUTPUTDIR}' doesn't exist."
83 # Make sure the source directory is a git repository
84 if [ ! -r "${SRCDIR}/.git/config" ]; then
85 echo "Source directory '${SRCDIR}' isn't a git repository."
89 # Set the git repo directory for all further git commands
90 export GIT_DIR
="${SRCDIR}/.git/"
92 # Check if the release tag exists
93 if ! git rev-parse
"refs/tags/v${REL}" >/dev
/null
2>&1; then
94 echo "Release tag 'v${REL}' doesn't exist."
98 # Generate the compressed tar archive, the git attributes from the tag will be used.
99 git archive
$VERBOSE --format=tar --prefix="lttng-modules-${REL}/" "v${REL}" | bzip2 > "${OUTPUTDIR}/lttng-modules-${REL}.tar.bz2"
101 pushd "${OUTPUTDIR}" >/dev
/null
102 # Generate the hashes
103 md5sum "lttng-modules-${REL}.tar.bz2" > "lttng-modules-${REL}.tar.bz2.md5"
104 sha256sum
"lttng-modules-${REL}.tar.bz2" > "lttng-modules-${REL}.tar.bz2.sha256"
106 if [ "x${SIGN}" = "xyes" ]; then
107 # Sign with the default key
108 gpg
--armor -b "lttng-modules-${REL}.tar.bz2"
This page took 0.032222 seconds and 4 git commands to generate.