From 4ea449e328d4376ab6c7437a096d0943dd2f0be4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maty=C3=A1=C5=A1=20Kopp?= Date: Tue, 28 May 2024 19:51:36 +0200 Subject: [PATCH] remove svn dependency from dep package build #3 --- admin/release-deb.sh | 6 +++--- unix_install_pkgs/deb/prepare_deb_pkg.sh | 13 ++++++++----- unix_install_pkgs/deb/tred-2.0/debian/changelog | 4 ++-- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/admin/release-deb.sh b/admin/release-deb.sh index 9b49c883b..2095018bf 100755 --- a/admin/release-deb.sh +++ b/admin/release-deb.sh @@ -6,7 +6,7 @@ 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 @@ -14,7 +14,7 @@ cd "$PROJECT_DIR/unix_install_pkgs/deb" || exit 1 # 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/" @@ -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 diff --git a/unix_install_pkgs/deb/prepare_deb_pkg.sh b/unix_install_pkgs/deb/prepare_deb_pkg.sh index 844ef08a8..bd7d17876 100755 --- a/unix_install_pkgs/deb/prepare_deb_pkg.sh +++ b/unix_install_pkgs/deb/prepare_deb_pkg.sh @@ -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 diff --git a/unix_install_pkgs/deb/tred-2.0/debian/changelog b/unix_install_pkgs/deb/tred-2.0/debian/changelog index 7aca35a40..de75e7ed6 100644 --- a/unix_install_pkgs/deb/tred-2.0/debian/changelog +++ b/unix_install_pkgs/deb/tred-2.0/debian/changelog @@ -1,5 +1,5 @@ -tred (2.%SVN_VERSION%) unstable; urgency=low +tred (3.%GIT_DATE%) unstable; urgency=low * Initial Release. - -- TrEd Developers Team %DATE% + -- TrEd Developers Team %DATE%