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
This commit is contained in:
raburton 2008-08-29 21:36:31 +00:00
parent 46f931b6ae
commit 04b9bb6e6d
2 changed files with 47 additions and 2 deletions

View File

@ -9,7 +9,7 @@ COMMON_GLOBL wxString g_BuildVersion
# include "config.h" # include "config.h"
(wxT(KICAD_SVN_VERSION)) (wxT(KICAD_SVN_VERSION))
# else # else
(wxT("(20080825)")) (wxT("(20080825)")) /* main program version */
# endif # endif
#endif #endif
; ;
@ -20,7 +20,7 @@ COMMON_GLOBL wxString g_BuildAboutVersion
# include "config.h" # include "config.h"
(wxT(KICAD_ABOUT_VERSION)) (wxT(KICAD_ABOUT_VERSION))
# else # else
(wxT("(20080811.r1188)")) (wxT("(20080811.r1188)")) /* svn date & rev (normally overridden) */
# endif # endif
#endif #endif
; ;

45
packagesrc.sh Executable file
View File

@ -0,0 +1,45 @@
#!/bin/bash
svnrev=$1
svnpath=$2
tempdir=kicad-$$
if [ -z "$svnrev" ]; then
echo "usage: $0 <svnrevision> [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 <<EOF >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}