diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2020-07-24 10:32:36 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2020-08-01 07:58:45 +0000 |
commit | d3072ba84e0232f80bb54cee01c936dff8975b34 (patch) | |
tree | 541074dbc8518e29d9567e36ba9a355c2168cf23 | |
parent | Initial commit. (diff) | |
download | packages-d3072ba84e0232f80bb54cee01c936dff8975b34.tar.xz packages-d3072ba84e0232f80bb54cee01c936dff8975b34.zip |
Updating.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
-rw-r--r-- | .gitignore | 2 | ||||
-rwxr-xr-x | check-missing-builds.sh | 19 | ||||
-rwxr-xr-x | update | 130 | ||||
l--------- | update.engywuck | 1 | ||||
l--------- | update.engywuck-backports | 1 |
5 files changed, 153 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c625e37 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +downstream.* +upstream.* diff --git a/check-missing-builds.sh b/check-missing-builds.sh new file mode 100755 index 0000000..35caa12 --- /dev/null +++ b/check-missing-builds.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +set -e + +DISTRIBUTION="engywuck" +DISTRIBUTION="engywuck-backports" + +PACKAGES="$(wget -q https://git.progress-linux.org/packages/${DISTRIBUTION}/ -O - | grep "sublevel-repo'><a title=" | sed -e "s|^.*<a title='||g" -e "s|'.*$||")" + +echo "Present in git, missing debs:" + +for PACKAGE in ${PACKAGES} +do + if ! wget -q https://apt.progress-linux.org/archive/${DISTRIBUTION}/${PACKAGE}/current_amd64 -O /dev/null 2>&1 && \ + ! wget -q https://apt.progress-linux.org/archive/${DISTRIBUTION}/${PACKAGE}/current_all -O /dev/null 2>&1 + then + echo " ${PACKAGE}" + fi +done @@ -0,0 +1,130 @@ +#!/bin/sh + +set -e + +# FIXME: getopt +# FIXME: -f for forced indices download + +MODE="$(basename ${0} | awk -F. '{ print $2 }')" + +case "${MODE}" in + engywuck) + UPSTREAM_DISTRIBUTIONS="buster buster-updates buster-proposed-updates" + DOWNSTREAM_DISTRIBUTION="engywuck" + ;; + + engywuck-backports) + UPSTREAM_DISTRIBUTIONS="sid experimental" + DOWNSTREAM_DISTRIBUTION="engywuck-backports" + ;; +esac + +UPSTREAM_SECTIONS="main contrib non-free" +UPSTREAM_MIRROR="http://debian.ethz.ch/debian" + +DOWNSTREAM_SECTIONS="main contrib non-free" +DOWNSTREAM_MIRROR="https://apt.progress-linux.org/packages" + +DOWNSTREAM_TAG="progress" + +Download_downstream_sources () +{ + # Download downstream sources +# if [ -e "downstream.${MODE}.sources" ] && [ "$(( $(stat -c %Y downstream.${MODE}.sources) + ( 4 * 3600 ) ))" -lt "$(date +%s)" ] +# then +# # file is older than 4 hours + rm -f "downstream.${MODE}.sources" +# fi + + if [ ! -e "downstream.${MODE}.sources" ] + then + for SECTION in ${DOWNSTREAM_SECTIONS} + do + wget -O - "${DOWNSTREAM_MIRROR}/dists/${DOWNSTREAM_DISTRIBUTION}/${SECTION}/source/Sources.xz" | xz -d >> "downstream.${MODE}.sources" + done + fi +} + +Download_upstream_sources () +{ + # Download upstream sources + if [ -e "upstream.${MODE}.sources" ] && [ "$(( $(stat -c %Y upstream.${MODE}.sources) + ( 4 * 3600 ) ))" -lt "$(date +%s)" ] + then + # file is older than 4 hours + rm -f "upstream.${MODE}.sources" + fi + + if [ ! -e "upstream.${MODE}.sources" ] + then + for DISTRIBUTION in ${UPSTREAM_DISTRIBUTIONS} + do + case "${DISTRIBUTION}" in + *-*) + ;; + + *) + if wget -q -O /dev/null "http://security.debian.org/dists/${DISTRIBUTION}/updates/Release" + then + for SECTION in ${UPSTREAM_SECTIONS} + do + wget -O - "http://security.debian.org/dists/${DISTRIBUTION}/updates/${SECTION}/source/Sources.xz" | xz -d >> "upstream.${MODE}.sources" + done + fi + ;; + esac + + for SECTION in ${UPSTREAM_SECTIONS} + do + wget -O - "${UPSTREAM_MIRROR}/dists/${DISTRIBUTION}/${SECTION}/source/Sources.xz" | xz -d >> "upstream.${MODE}.sources" + done + done + fi +} + +Debug () +{ + echo "${PACKAGE} ${UPSTREAM_VERSION} | ${DOWNSTREAM} [${DOWNSTREAM_VERSION}]" +} + +Download_downstream_sources +Download_upstream_sources + +# Process downstream sources +DOWNSTREAM_PACKAGES="$(awk '/^Package: / { print $2 }' downstream.${MODE}.sources | sort -u)" + +echo -n "Comparing versions... " + +for PACKAGE in ${DOWNSTREAM_PACKAGES} +do + DOWNSTREAM_VERSION="$(sed -n "/^Package: ${PACKAGE}$/,/^Version:/p" downstream.${MODE}.sources | awk '/^Version: / { print $2 }')" + UPSTREAM_VERSION="$(sed -n "/^Package: ${PACKAGE}$/,/^Version:/p" upstream.${MODE}.sources | awk '/^Version: / { print $2 }' | sort -rV | head -n1)" + + if echo ${UPSTREAM_VERSION} | grep -qs '-' + then + # package is non-native + DOWNSTREAM="$(echo ${DOWNSTREAM_VERSION} | sed -e "s|~${DOWNSTREAM_TAG}.*||" -e "s|${DOWNSTREAM_TAG}.*||")" + else + # package is native + DOWNSTREAM="$(echo ${DOWNSTREAM_VERSION} | sed -e "s|-0.0~${DOWNSTREAM_TAG}.*||" -e "s|-0.*${DOWNSTREAM_TAG}.*||")" + fi + + # comparing versions + if dpkg --compare-versions ${UPSTREAM_VERSION} eq ${DOWNSTREAM} + then + #echo "${PACKAGE}: upstream = downstream" + echo -n "." + elif dpkg --compare-versions ${UPSTREAM_VERSION} gt ${DOWNSTREAM} + then + echo "${PACKAGE}: upstream > downstream" + Debug + elif dpkg --compare-versions ${UPSTREAM_VERSION} lt ${DOWNSTREAM} + then + echo "${PACKAGE}: upstream < downstream" + Debug + else + echo "${PACKAGE}: internal error" + Debug + fi +done + +echo " done." diff --git a/update.engywuck b/update.engywuck new file mode 120000 index 0000000..77c430a --- /dev/null +++ b/update.engywuck @@ -0,0 +1 @@ +update
\ No newline at end of file diff --git a/update.engywuck-backports b/update.engywuck-backports new file mode 120000 index 0000000..77c430a --- /dev/null +++ b/update.engywuck-backports @@ -0,0 +1 @@ +update
\ No newline at end of file |