mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Remove svn-based build files
This commit is contained in:
parent
e2f49114d9
commit
c73eaa89f2
@ -1,122 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
#
|
|
||||||
# This assumes we're in the "packaging" directory for the correct build.
|
|
||||||
# It could be the packaging/win32 subdir of a tag checkout, or it could
|
|
||||||
# be the top-level daily-build packaging directory.
|
|
||||||
#
|
|
||||||
|
|
||||||
set -o pipefail
|
|
||||||
set -e
|
|
||||||
LOG_DIR=build-logs
|
|
||||||
|
|
||||||
function on_error() {
|
|
||||||
if [ `hostname` = "gnucash-win32" ]; then
|
|
||||||
scp -p ${LOGFILE} upload@code.gnucash.org:public_html/win32/$LOG_DIR
|
|
||||||
fi
|
|
||||||
exit
|
|
||||||
}
|
|
||||||
|
|
||||||
function unix_path() { echo "$*" | sed 's,^\([A-Za-z]\):,/\1,;s,\\,/,g'; }
|
|
||||||
|
|
||||||
tag="$1"
|
|
||||||
|
|
||||||
. functions.sh
|
|
||||||
. defaults.sh
|
|
||||||
|
|
||||||
# Determine where to upload to
|
|
||||||
if $(echo $REPOS_URL | grep -q tags); then
|
|
||||||
TARGET_DIR=releases
|
|
||||||
LOG_TAG=$tag
|
|
||||||
else
|
|
||||||
TARGET_DIR=${REPOS_URL##*/}
|
|
||||||
LOG_TAG=$TARGET_DIR
|
|
||||||
fi
|
|
||||||
|
|
||||||
set_default OUTPUT_DIR $GLOBAL_DIR\\output
|
|
||||||
LOGFILENAME=build-${LOG_TAG}-`date +'%Y-%m-%d'`.log
|
|
||||||
|
|
||||||
_OUTPUT_DIR=`unix_path $OUTPUT_DIR`
|
|
||||||
LOGFILE=${_OUTPUT_DIR}/${LOGFILENAME}
|
|
||||||
mkdir -p ${_OUTPUT_DIR}
|
|
||||||
|
|
||||||
# Small hack to create $LOG_DIR on the webserver if it doesn't exist yet
|
|
||||||
if [ `hostname` = "gnucash-win32" ]; then
|
|
||||||
mkdir -p "$_OUTPUT_DIR/$LOG_DIR"
|
|
||||||
scp -r "$_OUTPUT_DIR/$LOG_DIR" upload@code.gnucash.org:public_html/win32
|
|
||||||
rmdir "$_OUTPUT_DIR/$LOG_DIR"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If we're running on the build server, copy a temporary logfile
|
|
||||||
# content to the webserver to signal that the build is in progress
|
|
||||||
if [ `hostname` = "gnucash-win32" ]; then
|
|
||||||
_PWD=`pwd`
|
|
||||||
echo "Build for tag \"${tag}\" is in progress (current working directory: ${_PWD}) ..." > ${LOGFILE}
|
|
||||||
scp -p ${LOGFILE} upload@code.gnucash.org:public_html/win32/$LOG_DIR
|
|
||||||
fi
|
|
||||||
|
|
||||||
set +e
|
|
||||||
trap on_error ERR
|
|
||||||
|
|
||||||
# Run the compile
|
|
||||||
./install.sh 2>&1 | tee ${LOGFILE}
|
|
||||||
|
|
||||||
# This directory needs to be removed before calling dist.sh
|
|
||||||
DIST_DIR=${INSTALL_DIR}\\..\\dist
|
|
||||||
_DIST_UDIR=`unix_path $DIST_DIR`
|
|
||||||
rm -rf ${_DIST_UDIR}
|
|
||||||
|
|
||||||
# Create the installer
|
|
||||||
./dist.sh 2>&1 | tee -a ${LOGFILE}
|
|
||||||
|
|
||||||
# Copy the resulting installer into the output directory
|
|
||||||
_BUILD_UDIR=`unix_path $BUILD_DIR`
|
|
||||||
_GNUCASH_UDIR=`unix_path $GNUCASH_DIR`
|
|
||||||
PKG_VERSION=`grep PACKAGE_VERSION ${_BUILD_UDIR}/config.h | cut -d" " -f3 | cut -d\" -f2 `
|
|
||||||
GNUCASH_SCM_REV=`grep GNUCASH_SCM_REV ${_BUILD_UDIR}/src/core-utils/gnc-scm-info.h | cut -d" " -f3 | cut -d\" -f2 `
|
|
||||||
|
|
||||||
# Choose the output filename based on our "build_from_tarball" setting
|
|
||||||
# Make sure this logic matches the logic in dist.sh!
|
|
||||||
if [ "$BUILD_FROM_TARBALL" = "no" ]; then
|
|
||||||
SETUP_FILENAME="gnucash-${PKG_VERSION}-svn-r${GNUCASH_SCM_REV}-setup.exe"
|
|
||||||
else
|
|
||||||
SETUP_FILENAME="gnucash-${PKG_VERSION}-setup.exe"
|
|
||||||
fi
|
|
||||||
if [ ! -d ${_OUTPUT_DIR} ] ; then
|
|
||||||
echo "Error: _OUTPUT_DIR=${_OUTPUT_DIR} does not exist" >> ${LOGFILE}
|
|
||||||
fi
|
|
||||||
if [ -f ${_GNUCASH_UDIR}/${SETUP_FILENAME} ] ; then
|
|
||||||
echo "Successfully created ${SETUP_FILENAME} in ${_GNUCASH_UDIR}" >> ${LOGFILE}
|
|
||||||
else
|
|
||||||
echo "Error: File _GNUCASH_UDIR/SETUP_FILENAME = ${_GNUCASH_UDIR}/${SETUP_FILENAME} does not exist" >> ${LOGFILE}
|
|
||||||
echo "Files in _GNUCASH_UDIR:" >> ${LOGFILE}
|
|
||||||
ls ${_GNUCASH_UDIR}/* >> ${LOGFILE}
|
|
||||||
fi
|
|
||||||
mv ${_GNUCASH_UDIR}/${SETUP_FILENAME} ${_OUTPUT_DIR} >> ${LOGFILE} 2>&1
|
|
||||||
|
|
||||||
#
|
|
||||||
# Verify that PKG_VERSION == $tag, and add to the build log if it's not.
|
|
||||||
# Note: only do this if tag exists and matches x.y.z
|
|
||||||
#
|
|
||||||
if [ -n "${tag}" ] ; then
|
|
||||||
case "${tag}" in
|
|
||||||
[0-9]*.[0-9]*.[0-9]*)
|
|
||||||
if [ "${PKG_VERSION}" != "${tag}" ] ; then
|
|
||||||
echo "" >> ${LOGFILE}
|
|
||||||
echo " *** ERROR: Package Version ${PKG_VERSION} doesn't match Tag ${tag}" >> ${LOGFILE}
|
|
||||||
echo "" >> ${LOGFILE}
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If we're running on the build server then upload the files
|
|
||||||
if [ `hostname` = "gnucash-win32" ]; then
|
|
||||||
# Small hack to create the $TARGET_DIR on the webserver if it doesn't exist yet
|
|
||||||
mkdir -p "$_OUTPUT_DIR/$TARGET_DIR" >> ${LOGFILE} 2>&1
|
|
||||||
scp -r "$_OUTPUT_DIR/$TARGET_DIR" upload@code.gnucash.org:public_html/win32 >> ${LOGFILE} 2>&1
|
|
||||||
rmdir "$_OUTPUT_DIR/$TARGET_DIR" >> ${LOGFILE} 2>&1
|
|
||||||
# Copy the files to the chosen target directory
|
|
||||||
scp -p ${_OUTPUT_DIR}/${SETUP_FILENAME} upload@code.gnucash.org:public_html/win32/$TARGET_DIR >> ${LOGFILE} 2>&1
|
|
||||||
scp -p ${LOGFILE} upload@code.gnucash.org:public_html/win32/$LOG_DIR
|
|
||||||
fi
|
|
@ -1,118 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# Notes:
|
|
||||||
# 1. for this script to work, you need to make sure bash can
|
|
||||||
# find svn on your system. If it's not in the default
|
|
||||||
# Windows path, you will have to add it yourself, for
|
|
||||||
# example like this:
|
|
||||||
# - create a file /etc/profile.d/svn.sh
|
|
||||||
# - add this line: export PATH=/c/soft/svn/bin:$PATH
|
|
||||||
# (Use the real path to your svn installation, obviously)
|
|
||||||
#
|
|
||||||
# 2. Should this script change in the source repository, then the
|
|
||||||
# svn update below will fail due to a limitation in Windows that
|
|
||||||
# won't allow to change a file that is "in use". So in the rare
|
|
||||||
# situation this script needs to be updated, you will need to
|
|
||||||
# run the svn update once yourself.
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
function qpushd() { pushd "$@" >/dev/null; }
|
|
||||||
function qpopd() { popd >/dev/null; }
|
|
||||||
function unix_path() { echo "$*" | sed 's,^\([A-Za-z]\):,/\1,;s,\\,/,g'; }
|
|
||||||
|
|
||||||
TAG_URL=http://svn.gnucash.org/repo/gnucash/tags
|
|
||||||
|
|
||||||
################################################################
|
|
||||||
# Setup our environment (we need the DOWNLOAD_DIR)
|
|
||||||
|
|
||||||
qpushd "$(dirname $(unix_path "$0"))"
|
|
||||||
pkgdir="`pwd`"
|
|
||||||
svn update
|
|
||||||
. functions.sh
|
|
||||||
. defaults.sh
|
|
||||||
|
|
||||||
|
|
||||||
################################################################
|
|
||||||
# determine if there are any new tags since the last time we ran
|
|
||||||
#
|
|
||||||
|
|
||||||
# If we don't have a tagfile then start from 'now'
|
|
||||||
tagfile=tags
|
|
||||||
if [ ! -f ${tagfile} ] ; then
|
|
||||||
svn ls -v ${TAG_URL} | awk '/[^.]\// { print $1"/"$6 }' > ${tagfile}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Figure out the new set of tags
|
|
||||||
svn ls -v ${TAG_URL} | awk '/[^.]\// { print $1"/"$6 }' > ${tagfile}.new
|
|
||||||
tags="`diff --suppress-common-lines ${tagfile} ${tagfile}.new | grep '^> ' | sed -e 's/^> //g'`"
|
|
||||||
|
|
||||||
# move the new file into place
|
|
||||||
mv -f ${tagfile}.new ${tagfile}
|
|
||||||
|
|
||||||
################################################################
|
|
||||||
# Now iterate over all the new tags (if any) and build a package
|
|
||||||
|
|
||||||
for tag_rev in $tags ; do
|
|
||||||
tag=${tag_rev#*/}
|
|
||||||
tag=${tag%/*}
|
|
||||||
|
|
||||||
# From 2.5 and up, tags are built from git
|
|
||||||
tag_major=${tag%%.*}
|
|
||||||
tag_tmp=${tag#*.}
|
|
||||||
tag_minor=${tag_tmp%%.*}
|
|
||||||
major_minor=$(( $tag_major*100 + $tag_minor ))
|
|
||||||
if (( $major_minor >= 205 ))
|
|
||||||
then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
tagbasedir=/c/soft/gnucash-${tag}
|
|
||||||
tagdir=${tagbasedir}/gnucash
|
|
||||||
rm -fr $tagbasedir
|
|
||||||
mkdir -p ${tagdir}
|
|
||||||
echo "Building tag $tag in $tagbasedir."
|
|
||||||
|
|
||||||
# Copy the downloads to save time
|
|
||||||
mkdir -p ${tagbasedir}/downloads
|
|
||||||
cp -p $(unix_path ${DOWNLOAD_DIR})/* ${tagbasedir}/downloads
|
|
||||||
echo "Successfully copied the downloads dir to ${tagbasedir}/downloads"
|
|
||||||
|
|
||||||
# Check out the tag and setup custom.sh
|
|
||||||
svn co -q ${TAG_URL}/${tag} ${tagdir}/repos
|
|
||||||
w32pkg=${tagdir}/repos/packaging/win32
|
|
||||||
cp -p "${pkgdir}/custom.sh" ${w32pkg}/custom.sh
|
|
||||||
echo "Successfully checked out the sources"
|
|
||||||
|
|
||||||
# Set the global directory to the tag build
|
|
||||||
echo -n 'GLOBAL_DIR=c:\\soft\\gnucash-' >> ${w32pkg}/custom.sh
|
|
||||||
echo "${tag}" >> ${w32pkg}/custom.sh
|
|
||||||
|
|
||||||
# No need to update the sources we just checked out
|
|
||||||
echo "UPDATE_SOURCES=no" >> ${w32pkg}/custom.sh
|
|
||||||
|
|
||||||
# But set the repos url to the current tag anyway, it will be used
|
|
||||||
# to name the log file
|
|
||||||
echo -n "REPOS_URL=" >> ${w32pkg}/custom.sh
|
|
||||||
echo "${TAG_URL}/${tag}" >> ${w32pkg}/custom.sh
|
|
||||||
|
|
||||||
# Use the proper branch for the documentation
|
|
||||||
echo -n "DOCS_URL=" >> ${w32pkg}/custom.sh
|
|
||||||
echo "http://svn.gnucash.org/repo/gnucash-docs/branches/${tag_major}.${tag_minor}" >> ${w32pkg}/custom.sh
|
|
||||||
|
|
||||||
# BUILD_FROM_TARBALL is special:
|
|
||||||
# in install.sh place we check !=yes, in defaults.sh =yes, in dist.sh =no
|
|
||||||
# We want it to look like 'no' in install and defaults, but yes in dist
|
|
||||||
# so this hack works!
|
|
||||||
echo "BUILD_FROM_TARBALL=maybe" >> ${w32pkg}/custom.sh
|
|
||||||
|
|
||||||
# Point HH_DIR at the global installation because we don't need to redo it
|
|
||||||
echo -n "HH_DIR=" >> ${w32pkg}/custom.sh
|
|
||||||
echo "${GLOBAL_DIR}\\hh" | sed -e 's/\\/\\\\/g' >> ${w32pkg}/custom.sh
|
|
||||||
|
|
||||||
# Now build the tag! (this will upload it too)
|
|
||||||
# Use the build_package script from trunk (cwd), not from the tag
|
|
||||||
qpushd ${w32pkg}
|
|
||||||
${pkgdir}/build_package.sh ${tag}
|
|
||||||
qpopd
|
|
||||||
done
|
|
@ -1,46 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# Notes:
|
|
||||||
# 1. for this script to work, you need to make sure bash can
|
|
||||||
# find svn on your system. If it's not in the default
|
|
||||||
# Windows path, you will have to add it yourself, for
|
|
||||||
# example like this:
|
|
||||||
# - create a file /etc/profile.d/svn.sh
|
|
||||||
# - add this line: export PATH=/c/soft/svn/bin:$PATH
|
|
||||||
# (Use the real path to your svn installation, obviously)
|
|
||||||
#
|
|
||||||
# 2. The recommended setup is to call this script from within the
|
|
||||||
# source code repository (packaging/win32 directory). This is
|
|
||||||
# different from before, where it was assumed to be called
|
|
||||||
# from outside the source code repository. To remain some
|
|
||||||
# compatibility with the old way, svn update is called twice
|
|
||||||
# - once for the repository (to update all)
|
|
||||||
# - once for the build scripts (to also update the build scripts
|
|
||||||
# using the old way)
|
|
||||||
# The second invocation is superfluous if this script was called
|
|
||||||
# from within the source code repository.
|
|
||||||
#
|
|
||||||
# 3. Should this script change in the source repository, then the
|
|
||||||
# svn update below will fail due to a limitation in Windows that
|
|
||||||
# won't allow to change a file that is "in use". So in the rare
|
|
||||||
# situation this script needs to be updated, you will need to
|
|
||||||
# run the svn update once yourself.
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
function qpushd() { pushd "$@" >/dev/null; }
|
|
||||||
function qpopd() { popd >/dev/null; }
|
|
||||||
function unix_path() { echo "$*" | sed 's,^\([A-Za-z]\):,/\1,;s,\\,/,g'; }
|
|
||||||
|
|
||||||
qpushd "$(dirname $(unix_path "$0"))"
|
|
||||||
. functions.sh
|
|
||||||
. defaults.sh
|
|
||||||
|
|
||||||
qpushd "$REPOS_DIR"
|
|
||||||
svn update
|
|
||||||
qpopd
|
|
||||||
|
|
||||||
svn update
|
|
||||||
|
|
||||||
./build_package.sh
|
|
||||||
qpopd
|
|
@ -1,41 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# Notes:
|
|
||||||
# 1. for this script to work, you need to make sure bash can
|
|
||||||
# find svn on your system. If it's not in the default
|
|
||||||
# Windows path, you will have to add it yourself, for
|
|
||||||
# example like this:
|
|
||||||
# - create a file /etc/profile.d/svn.sh
|
|
||||||
# - add this line: export PATH=/c/soft/svn/bin:$PATH
|
|
||||||
# (Use the real path to your svn installation, obviously)
|
|
||||||
#
|
|
||||||
# 2. The recommended setup is to call this script from within the
|
|
||||||
# source code repository (packaging/win32 directory). This is
|
|
||||||
# different from before, where it was assumed to be called
|
|
||||||
# from outside the source code repository. To remain some
|
|
||||||
# compatibility with the old way, svn update is called twice
|
|
||||||
# - once for the repository (to update all)
|
|
||||||
# - once for the build scripts (to also update the build scripts
|
|
||||||
# using the old way)
|
|
||||||
# The second invocation is superfluous if this script was called
|
|
||||||
# from within the source code repository.
|
|
||||||
#
|
|
||||||
# 3. Should this script change in the source repository, then the
|
|
||||||
# svn update below will fail due to a limitation in Windows that
|
|
||||||
# won't allow to change a file that is "in use". So in the rare
|
|
||||||
# situation this script needs to be updated, you will need to
|
|
||||||
# run the svn update once yourself.
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
## Only run this script on Monday night (first day of the week)
|
|
||||||
if [ `date +%u` != 1 ] ; then exit ; fi
|
|
||||||
|
|
||||||
function qpushd() { pushd "$@" >/dev/null; }
|
|
||||||
function qpopd() { popd >/dev/null; }
|
|
||||||
function unix_path() { echo "$*" | sed 's,^\([A-Za-z]\):,/\1,;s,\\,/,g'; }
|
|
||||||
|
|
||||||
qpushd "$(dirname $(unix_path "$0"))"
|
|
||||||
svn update
|
|
||||||
./build_package.sh
|
|
||||||
qpopd
|
|
Loading…
Reference in New Issue
Block a user