Updated svn version scripts for git
This commit is contained in:
parent
3467a44761
commit
2357e31965
4 changed files with 37 additions and 44 deletions
|
@ -113,7 +113,7 @@ set( DATADIR share CACHE PATH "Directory for shared data" )
|
||||||
set( SYSCONFDIR /etc CACHE PATH "Directory for configuration files" )
|
set( SYSCONFDIR /etc CACHE PATH "Directory for configuration files" )
|
||||||
set( DOCDIR share/doc/tint2 CACHE PATH "Directory for documentation files" )
|
set( DOCDIR share/doc/tint2 CACHE PATH "Directory for documentation files" )
|
||||||
|
|
||||||
add_custom_target( version ALL "${PROJECT_SOURCE_DIR}/get_svnrev.sh" "\"${PROJECT_SOURCE_DIR}\"" )
|
add_custom_target( version ALL "${PROJECT_SOURCE_DIR}/get_version.sh" "\"${PROJECT_SOURCE_DIR}\"" )
|
||||||
|
|
||||||
link_directories( ${X11_LIBRARY_DIRS}
|
link_directories( ${X11_LIBRARY_DIRS}
|
||||||
${PANGOCAIRO_LIBRARY_DIRS}
|
${PANGOCAIRO_LIBRARY_DIRS}
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
FALLBACK=\"0.11-svn\"
|
|
||||||
|
|
||||||
if [ $# -eq 0 ]; then
|
|
||||||
DIR=.
|
|
||||||
else
|
|
||||||
DIR=$1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f version.h ]; then
|
|
||||||
REV_OLD=$(cat version.h | cut -d" " -f3)
|
|
||||||
else
|
|
||||||
REV_OLD=\"\"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -x "$(which svnversion 2>/dev/null)" -a -d "${DIR}/.svn" ] ; then
|
|
||||||
REV=\"$(svnversion -n ${DIR})\"
|
|
||||||
else
|
|
||||||
REV=${FALLBACK}
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ${REV_OLD} != ${REV} ]; then
|
|
||||||
echo "Building new version.h"
|
|
||||||
echo "Rev_old: ${REV_OLD} Rev: ${REV}"
|
|
||||||
echo "#define VERSION_STRING ${REV}" > version.h
|
|
||||||
fi
|
|
3
get_version.sh
Executable file
3
get_version.sh
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
git describe --exact-match 2>/dev/null || echo "0.11-git$(git show -s --pretty=format:%cI.%h | tr -d ':' | tr -d '-' | tr '.' '-' | sed 's/T[0-9\+]*//g')"
|
|
@ -1,23 +1,40 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# usage: ./make_release.sh RELEASE_VERSION_NUMBER
|
# Usage: ./make_release.sh
|
||||||
|
# Creates a tar.bz2 archive of the current tree.
|
||||||
|
#
|
||||||
|
# To bump the version number for the current commit (make sure you are in HEAD!), run manually:
|
||||||
|
#
|
||||||
|
# git tag -a v0.12 -m 'Version 0.12'
|
||||||
|
#
|
||||||
|
# To generate a release for an older tagged commit, first list the tags with:
|
||||||
|
#
|
||||||
|
# git tags
|
||||||
|
#
|
||||||
|
# then checkout the tagged commit with:
|
||||||
|
#
|
||||||
|
# git checkout tags/v0.1
|
||||||
|
#
|
||||||
|
# Finally, to revert to HEAD:
|
||||||
|
#
|
||||||
|
# git checkout master
|
||||||
|
|
||||||
if [[ $# -ne 1 ]]; then
|
VERSION=$(./get_version.sh)
|
||||||
echo "usage: $0 RELEASE_VERSION_NUMBER"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
DIR=tint2-${1}
|
DIR=tint2-$VERSION
|
||||||
echo "Making release ${DIR}"
|
echo "Making release $DIR"
|
||||||
rm -Rf ${DIR}
|
rm -rf $DIR
|
||||||
svn export . ${DIR} > /dev/null
|
|
||||||
|
|
||||||
# delete unneeded files
|
git checkout-index --prefix=$DIR/ -a
|
||||||
rm -f ${DIR}/configure ${DIR}/make_release.sh
|
|
||||||
|
|
||||||
# replace get_svnrev.sh by a simple echo command
|
# Delete unneeded files
|
||||||
echo "echo \"#define VERSION_STRING \\\"${1}\\\"\" > version.h" > ${DIR}/get_svnrev.sh
|
rm -f $DIR/make_release.sh
|
||||||
|
|
||||||
# create tarball and remove the exported directory
|
echo "echo \"#define VERSION_STRING \\\"$VERSION\\\"\" > version.h" > $DIR/get_version.sh
|
||||||
tar -cjf ${DIR}.tar.bz2 ${DIR}
|
|
||||||
rm -Rf ${DIR}
|
# Create tarball and remove the exported directory
|
||||||
|
tar -cjf $DIR.tar.bz2 $DIR
|
||||||
|
rm -rf $DIR
|
||||||
|
|
||||||
|
sha1sum -b $DIR.tar.bz2
|
||||||
|
sha256sum -b $DIR.tar.bz2
|
||||||
|
|
Loading…
Reference in a new issue