1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
|
#!/bin/bash
#
# make-release-tarball
#
# Copyright 2000-2021 the Rosegarden development team.
# Copyright 2009, 2015 D. Michael McIntyre <rosegarden.trumpeter@gmail.com>
#
# Other copyrights also apply to some parts of this work. Please
# see the AUTHORS file and individual file headers for details.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version. See the file
# COPYING included with this distribution for more information.
# First attempt at a git version. Don't think this is the right way
# to go as it might capture some garbage from the user's directory.
# Going to try this again, but using a snapshot downloaded from sf as
# the starting point.
# This was lightly tested and probably mostly works. But it has been
# abandoned.
readonly myname=$(basename $0)
usage() {
cat << EOF
Usage: $myname
Creates a deliverable release tarball.
EOF
exit 1
}
puke() {
echo $1
exit 2
}
if [ ! -d "src" ]; then
echo "Cannot find src directory."
echo "$myname must be run from a top level directory!"
exit 2
fi
if [ ! -f "Doxyfile" ]; then
echo "No Doxyfile! Is this a top level directory?"
echo "$myname must be run from a top level directory!"
exit 2
fi
if [ ! -d ".git" ]; then
echo "No .git directory. Is this a development tree?"
exit 2
fi
readonly srcdir=$(pwd)
# We could confirm a clean working copy at this point.
# Or we can just make that part of the checklist...
readonly VERSION=$(grep ROSEGARDEN_VERSION CMakeLists.txt|cut -d \" -f 2|sed 's/ //g')
cd ..
readonly tempdir="rosegarden-$VERSION"
if [ -d "$tempdir" ]; then
echo "$tempdir already exists! Aborting!"
exit 2
fi
mkdir "$tempdir"
# Copy what we need to the tempdir.
rsync -rl --exclude=".git" --exclude="build" --exclude="core" "$srcdir/" "$tempdir"
# Continue working in the temp dir...
cd "$tempdir"
pwd
ls
# Indicate this is now a STABLE build.
sed -i "s/UNSTABLE/STABLE/" CMakeLists.txt
# ??? Just commit this to the repo.
cat > CONTRIBUTING << EOF
If you wish to fix a bug or add a new feature, follow the instructions here:
https://www.rosegardenmusic.com/wiki/dev:building_rosegarden_from_source
EOF
echo "Purging unwanted files..."
# Eclipse stuff
rm .cproject
rm .project
rm -rf .settings
# ??? There might be more that needs to be deleted. We should probably add
# a directory diff step to this to highlight any unexpected files that
# have appeared. We could diff against a downloaded snapshot.
# ??? An alternative would be to use sourceforge's "Download Snapshot"
# feature as the starting point. Redo this script
# to transform a downloaded snapshot into a proper release.
cd ..
readonly tarball="$tempdir.tar.bz2"
echo "Assembling $tarball..."
tar cjf $tarball $tempdir || puke "Making tarball failed!"
echo "Cleaning up..."
echo "Removing $tempdir"
rm -rf $tempdir
# Tag the release.
cd $srcdir
pwd
tagcmd="git tag -m \"Tag release $VERSION\" $VERSION"
echo "About to tag release with the following command:"
echo "$tagcmd"
# Not done yet.
fini=0
# While not done
while [ $fini -eq 0 ]; do
read -p "Do you want to tag this release (Y/n)? " answer
# This is pretty wordy. Can we do better?
if [ "$answer" == "Y" ] || [ "$answer" == "y" ] || [ -z "$answer" ]; then
#echo we got yes...
answer="y"
fini=1
elif [ "$answer" == "N" ] || [ "$answer" == "n" ]; then
#echo we got no...
fini=1
else
echo Please enter y or n...
fi
done
# If they said yes, run the tag command
if [ "$answer" == "y" ]; then
eval "$tagcmd"
fi
|