From 575bae4af220b1bf4d433996c5d2ef44056068dc Mon Sep 17 00:00:00 2001 From: Ward from fusion-voyager-3 Date: Sat, 27 Jul 2024 23:28:56 +0300 Subject: [PATCH] add patch and reversion system --- main.sh | 34 +++++++++++++++++++++++++++++----- patches/.keep | 0 pika-build-config/lto.sh | 4 ++-- release.sh | 1 + 4 files changed, 32 insertions(+), 7 deletions(-) mode change 100644 => 100755 patches/.keep diff --git a/main.sh b/main.sh index 422226731..e918e4d0a 100755 --- a/main.sh +++ b/main.sh @@ -10,22 +10,46 @@ echo "$PIKA_BUILD_ARCH" > pika-build-arch apt-get source "$PIKA_PACKAGE_NAME=$VERSION" -y -if [ "$PIKA_REBUILD" = true ] ; then +if [ "$PIKA_REBUILD" = true ] +then VERSION="$VERSION+$PIKA_REBUILD_VERSION" fi -#TODO - DO PATCHING -#TODO - DO REVERSIONING FOR REBUILD - # Get build deps #LOGNAME=root dh_make --createorig -y -l -p src-pkg-name_"$VERSION" || echo "dh-make: Ignoring Last Error" # Get build deps apt-get build-dep "$PIKA_PACKAGE_NAME=$VERSION" -y +# Enter build dir cd $(find ./ -maxdepth 1 -name "$PIKA_PACKAGE_NAME*" -type d | head -1) -dpkg-buildpackage --no-sign +# DO PATCHING +if [ "$PIKA_PACKAGE_PATCH" = true ] +then + if cat ./debian/source/format | grep 'quilt' + then + cp -vf ../patches ./debian/ + cat ../series >> ./debian/patches/series + else + for i in $(cat ../series) + do + echo "Applying Patch: $i" + patch -Np1 -i ../patches/$i || bash -c "echo "Applying Patch $i Failed!" && exit 2" + done + fi +fi + +# Reversion changelog +if [ "$PIKA_REBUILD" = true ] +then + CHANGELOG_DATE=$(date '+%a, %d %b %Y %H:%M:%S %z') + CHANGELOG_APPEND="$PIKA_PACKAGE_NAME ($VERSION) pika; urgency=medium\n\n * PikaOS 4 Rebuild.\n\n -- Ward Nakchbandi $CHANGELOG_DATE\n" + sed -i "1s/^/$CHANGELOG_APPEND\n/" changelog +fi + +# Build Binary Packages +dpkg-buildpackage --no-sign # Move the debs to output cd ../ diff --git a/patches/.keep b/patches/.keep old mode 100644 new mode 100755 diff --git a/pika-build-config/lto.sh b/pika-build-config/lto.sh index 4684154c5..2b96ba50e 100644 --- a/pika-build-config/lto.sh +++ b/pika-build-config/lto.sh @@ -1,6 +1,6 @@ export PIKA_PACKAGE_VERSION="1:3.6.1-dmo1" export PIKA_PACKAGE_NAME="audacity-dmo" export PIKA_PACKAGE_PATCH=false -export PIKA_REBUILD=false +export PIKA_REBUILD=true export PIKA_REBUILD_VERSION="b2" -export PIKA_BUILD_ATTEMPT="1" \ No newline at end of file +export PIKA_BUILD_ATTEMPT="1" diff --git a/release.sh b/release.sh index 460e9dd7b..f2ea9c9b3 100755 --- a/release.sh +++ b/release.sh @@ -1,3 +1,4 @@ +exit 0 # send debs to server rsync -azP --include './' --include '*.deb' --exclude '*' ./output/ ferreo@direct.pika-os.com:/srv/www/canary-incoming/