From 04b9bb6e6dbff8f9ed519d42224e74990396deb1 Mon Sep 17 00:00:00 2001 From: raburton Date: Fri, 29 Aug 2008 21:36:31 +0000 Subject: [PATCH] add a script for packaging a source release add a note to the build versions, to indicate purpose and be grep-able to allow for easier source packaging --- include/build_version.h | 4 ++-- packagesrc.sh | 45 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 2 deletions(-) create mode 100755 packagesrc.sh diff --git a/include/build_version.h b/include/build_version.h index b3c07ec931..1cc70a5328 100644 --- a/include/build_version.h +++ b/include/build_version.h @@ -9,7 +9,7 @@ COMMON_GLOBL wxString g_BuildVersion # include "config.h" (wxT(KICAD_SVN_VERSION)) # else - (wxT("(20080825)")) + (wxT("(20080825)")) /* main program version */ # endif #endif ; @@ -20,7 +20,7 @@ COMMON_GLOBL wxString g_BuildAboutVersion # include "config.h" (wxT(KICAD_ABOUT_VERSION)) # else - (wxT("(20080811.r1188)")) + (wxT("(20080811.r1188)")) /* svn date & rev (normally overridden) */ # endif #endif ; diff --git a/packagesrc.sh b/packagesrc.sh new file mode 100755 index 0000000000..2ede36f4f2 --- /dev/null +++ b/packagesrc.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +svnrev=$1 +svnpath=$2 +tempdir=kicad-$$ + +if [ -z "$svnrev" ]; then + echo "usage: $0 [svnrepo]" + exit 1 +fi + +if [ -z "$svnpath" ]; then + svnpath="https://kicad.svn.sourceforge.net/svnroot/kicad/trunk" +fi + +mkdir ${tempdir} +cd ${tempdir} + +# export requested revision +echo "Exporting..." +svn export -r ${svnrev} ${svnpath}/kicad +svn export -r ${svnrev} ${svnpath}/kicad-doc +svn export -r ${svnrev} ${svnpath}/kicad-library + +# create "include/config.h" with svn date & revision in it +echo "Getting svn revision info..." +svndate=`svn info -r ${svnrev} ${svnpath}/kicad | grep "Last Changed Date: " | cut -f4 -d' ' | sed s/-//g` +cat <kicad/include/config.h +#ifndef __KICAD_SVN_VERSION_H__ +#define __KICAD_SVN_VERSION_H__ + +#define KICAD_ABOUT_VERSION "svn-r${svnrev} (${svndate})" + +#endif /* __KICAD_SVN_VERSION_H__ */ +EOF + +# get main program version from an include file +mainver=`cat kicad/include/build_version.h | grep 'main program version' | cut -d\( -f4 | cut -d\) -f1` + +cd .. + +# rename with proper version and tar it up +mv ${tempdir} kicad-${mainver} +tar -zcf kicad-${mainver}.tar.z kicad-${mainver} +