Skip to content

Commit

Permalink
remove svn dependency from dep package build #3
Browse files Browse the repository at this point in the history
  • Loading branch information
matyaskopp committed May 28, 2024
1 parent d37101b commit 4ea449e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
6 changes: 3 additions & 3 deletions admin/release-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
EXTDIR=`dirname $(readlink -fen $0)`
. $EXTDIR/env.sh

SVN_VERSION=`svn info . | grep 'Revision:' | sed -E 's/[^0-9]+//g'`
GIT_DATE=`git log -1 --date=format:"%Y%m%d" --format="%ad"|tr -d "\n"`

# Prepare the deb package
cd "$PROJECT_DIR/unix_install_pkgs/deb" || exit 1
./prepare_deb_pkg.sh || exit 2

# Copying the package to the local www
echo "Copying the package to local www ..."
DEB_FILE="tred_2.${SVN_VERSION}_all.deb"
DEB_FILE="tred_3.${GIT_DATE}_all.deb"
cp "./${DEB_FILE}" "${TREDWWW}/tred/${DEB_FILE}"
d=`pwd`
cd "${TREDWWW}/tred/"
Expand All @@ -29,7 +29,7 @@ ssh ${LOGIN_NAME}@${TESTING_SERVER} "rm -f /var/www/tred/testbed/*.deb"

# Upload the package to the testbed website
echo "Uploading the package to testbed web ..."
DEB_FILE="tred_2.${SVN_VERSION}_all.deb"
DEB_FILE="tred_3.${GIT_DATE}_all.deb"
scp "./${DEB_FILE}" "${LOGIN_NAME}@${REMOTE_WWW}/${DEB_FILE}"

# Make sure tred.deb link points to the newest deb package
Expand Down
13 changes: 8 additions & 5 deletions unix_install_pkgs/deb/prepare_deb_pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,21 @@ cd `dirname "$0"` || exit 1

rm -f ./*.deb

SVN_VERSION=`svn info . | grep 'Revision:' | sed -E 's/[^0-9]+//g'`
GIT_DATE=`git log -1 --date=format:"%Y%m%d" --format="%ad"|tr -d "\n"`


# Prepare fresh checkout
echo "Export package config dir from SVN so we can work with it ..."
TRED_DEB_DIR="./tred-2.$SVN_VERSION"
svn export ./tred-2.0 "$TRED_DEB_DIR" || exit 2
echo "Export package config dir from GIT so we can work with it ..."
TRED_DEB_DIR="./tred-3.$GIT_DATE"
git -C ./tred-2.0 archive --output ../$TRED_DEB_DIR.zip HEAD && \
unzip $TRED_DEB_DIR.zip -d "$TRED_DEB_DIR" && \
rm $TRED_DEB_DIR.zip || exit 2


# Fix changelog
echo "Fix version and release date in the configuration ..."
DATE=`LC_TIME=en_US.UTF-8 date '+%a, %d %b %Y %T %z'`
sed -i "s/%SVN_VERSION%/${SVN_VERSION}/g" "$TRED_DEB_DIR/debian/changelog" || exit 3
sed -i "s/%GIT_DATE%/${GIT_DATE}/g" "$TRED_DEB_DIR/debian/changelog" || exit 3
sed -i "s/%DATE%/${DATE}/g" "$TRED_DEB_DIR/debian/changelog" || exit 3

# Build the package
Expand Down
4 changes: 2 additions & 2 deletions unix_install_pkgs/deb/tred-2.0/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tred (2.%SVN_VERSION%) unstable; urgency=low
tred (3.%GIT_DATE%) unstable; urgency=low

* Initial Release.

-- TrEd Developers Team <tred@ksi.mff.cuni.cz> %DATE%
-- TrEd Developers Team <tred@ufal.mff.cuni.cz> %DATE%

0 comments on commit 4ea449e

Please sign in to comment.