From 339d1e32dc59c0cb5b3b32bef8b7e90f75f69908 Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Wed, 26 Jan 2022 23:09:00 -0500 Subject: version 3.24.31 --- Makefile | 6 +++++ get-latest-versions.sh | 23 ++++++++++++++++++ gtk-classic-build-deb.sh | 62 +++++++++++++++++++++++++++++++----------------- 3 files changed, 69 insertions(+), 22 deletions(-) create mode 100755 get-latest-versions.sh diff --git a/Makefile b/Makefile index a93c55c..f8a310f 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,10 @@ +# File: Makefile +# Location: https://gitlab.com/bgstack15/gtk3-classic-build +# Author: bgstack15 # Startdate: 2021-08-04 09:51 +# Title: Makefile for gtk3-classic-build debuild task +# Improve: +# add rpm option? all: gtk3 diff --git a/get-latest-versions.sh b/get-latest-versions.sh new file mode 100755 index 0000000..ad1ba19 --- /dev/null +++ b/get-latest-versions.sh @@ -0,0 +1,23 @@ +#!/bin/sh +oldx="$( printf %s\\n "$-" | grep -q -e 'x' && echo YES )" +set +x # hide this cruft +test -z "${WORKDIR}" && WORKDIR="$( readlink -f . )" +export WORKDIR +RAW_DEB="$( rmadison gtk+3.0 | awk --field-separator='|' '{gsub(" ","");print $2,$2,$3}' | awk '{gsub("-[0-9]+","",$1);print}' | sort -r --sort=version | grep -v debug | head -n1)" +RAW="$( echo "${RAW_DEB}" | awk '{print $1}' )" +DEB="$( echo "${RAW_DEB}" | awk '{print $2}' )" +if ! test "$( cd "${WORKDIR}/gtk3classic" 2>/dev/null && git remote -v | grep -o 'origin https://github.com/lah7/gtk3-classic' | head -n1 )" = "origin https://github.com/lah7/gtk3-classic" ; then + git clone "${GTK3CLASSIC_GIT}" "${WORKDIR}/gtk3classic" +else + ( + cd "${WORKDIR}/gtk3classic" + git checkout master + git pull --all + ) 1>/dev/null 2>&1 +fi +CLASSIC="$( cd "${WORKDIR}/gtk3classic" ; git tag | sort -r --sort=version | head -n 1 )" +export DEB RAW CLASSIC +echo "CLASSIC=${CLASSIC}" +echo "DEB=${DEB}" +echo "RAW=${RAW}" +test "${oldx}" = "YES" && set -x diff --git a/gtk-classic-build-deb.sh b/gtk-classic-build-deb.sh index d67001c..0e8dd4e 100755 --- a/gtk-classic-build-deb.sh +++ b/gtk-classic-build-deb.sh @@ -25,30 +25,47 @@ export WORKDIR GTK3CLASSIC_GIT=https://github.com/lah7/gtk3-classic cd "${WORKDIR}" -#### Find versions of gtk3-classic available, which involves fetching the repo -if ! test "$( cd "${WORKDIR}/gtk3classic" 2>/dev/null && git remote -v | grep -o 'origin https://github.com/lah7/gtk3-classic' | head -n1 )" = "origin https://github.com/lah7/gtk3-classic" ; then - git clone "${GTK3CLASSIC_GIT}" "${WORKDIR}/gtk3classic" -else +if test -n "${RAW}" && test -n "${CLASSIC}" && test -n "${DEB}" ; +then + echo "Using env vars:" ; ( - cd "${WORKDIR}/gtk3classic" - git checkout master - git pull --all + set -x + deb_version="${DEB}" + raw_version="${RAW}" + classic_version="${CLASSIC}" ) -fi -classic_vers="$( cd "${WORKDIR}/gtk3classic" ; git tag | sort -r --sort=version | head -n 20 )" -echo "${classic_vers}" > "${WORKDIR}/classic_vers" + deb_version="${DEB}" + raw_version="${RAW}" + classic_version="${CLASSIC}" +else + # original logic does all this comparison lookup, but it obviously fails when debian or gtk3-classic is behind/mismatched. + #### Find versions of gtk3-classic available, which involves fetching the repo + if ! test "$( cd "${WORKDIR}/gtk3classic" 2>/dev/null && git remote -v | grep -o 'origin https://github.com/lah7/gtk3-classic' | head -n1 )" = "origin https://github.com/lah7/gtk3-classic" ; then + git clone "${GTK3CLASSIC_GIT}" "${WORKDIR}/gtk3classic" + else + ( + cd "${WORKDIR}/gtk3classic" + git checkout master + git pull --all + ) + fi + classic_vers="$( cd "${WORKDIR}/gtk3classic" ; git tag | sort -r --sort=version | head -n 20 )" + echo "${classic_vers}" > "${WORKDIR}/classic_vers" -#### Find versions of gtk+3.0 available to debian -debian_vers="$( rmadison gtk+3.0 | awk --field-separator='|' '{gsub(" ","");print $2,$2,$3}' | awk '{gsub("-[0-9]+","",$1);print}' | sort -r --sort=version | grep -v debug )" -echo "${debian_vers}" > "${WORKDIR}/debian_vers" + #### Find versions of gtk+3.0 available to debian + debian_vers="$( rmadison gtk+3.0 | awk --field-separator='|' '{gsub(" ","");print $2,$2,$3}' | awk '{gsub("-[0-9]+","",$1);print}' | sort -r --sort=version | grep -v debug )" + echo "${debian_vers}" > "${WORKDIR}/debian_vers" -#### Find highest matching version -# the head -n1 makes it only the highest one. But anything in this list is a match between the two files. -highest_ver="$( awk 'NR==FNR{a[$0];next} NR!=FNR{if($1 in a){print}}' "${WORKDIR}/classic_vers" "${WORKDIR}/debian_vers" | head -n1 )" -raw_version="$( echo "${highest_ver}" | awk '{print $1}' )" -deb_version="$( echo "${highest_ver}" | awk '{print $2}' )" -# and $3 is the distro name like "experimental" which is not needed. -echo "Found highest version: ${highest_ver}" + #### Find highest matching version + # the head -n1 makes it only the highest one. But anything in this list is a match between the two files. + highest_ver="$( awk 'NR==FNR{a[$0];next} NR!=FNR{if($1 in a){print}}' "${WORKDIR}/classic_vers" "${WORKDIR}/debian_vers" | head -n1 )" + raw_version="$( echo "${highest_ver}" | awk '{print $1}' )" + deb_version="$( echo "${highest_ver}" | awk '{print $2}' )" + classic_version="${raw_version}" + + # and $3 is the distro name like "experimental" which is not needed. + echo "Found highest version: ${highest_ver}" +fi #### Fetch debian sources cd "${WORKDIR}" @@ -60,7 +77,7 @@ done #### Fetch gtk3-classic sources ( cd "${WORKDIR}/gtk3classic" - git checkout "${raw_version}" + git checkout "${classic_version}" ) #### Combine @@ -86,9 +103,10 @@ sed -r -i 's/env -u LD_PRELOAD xvfb-run -a dh_auto_test/#env -u LD_PRELOAD xvfb- sed -r -i 's/Build-Depends: /Build-Depends: libjpeg62-turbo-dev, /' debian/control # remove patch for all case "${raw_version}" in - 3.24.29) + 3.24.29|3.24.31) rm debian/patches/appearance__smaller-statusbar.patch debian/patches/file-chooser__places-sidebar.patch || : sed -r -i 's/(appearance__smaller-statusbar.patch|file-chooser__places-sidebar.patch)//g;' debian/patches/series + sed -i -r debian/rules -e '2aDEB_BUILD_OPTIONS := nocheck' ;; esac -- cgit