diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f1d1299afa98f2493abd8d676acca577d6b16359..5c1de1f8f5e29ec9bf58c344ff9125cbe9157bbf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -155,7 +155,8 @@ install:upgrade: - apt-get -qq update; apt-get -qq -y upgrade - wget -qO- http://mirror.mythic-beasts.com/mythic/support@mythic-beasts.com.gpg.key | apt-key add - - echo deb http://packages.mythic-beasts.com/mythic/ stretch-testing main > /etc/apt/sources.list.d/sympl_mythic-beasts.list - - apt-get -qq update; apt-get -qq install --install-recommends sympl-core + - apt-get -qq update + - apt-get -qq install $( autotest/get_previous_versions stretch-testing | tr ' ' '=' | tr '\n' ' ' ) - dpkg -l 'sympl-*' | grep '^ii' | awk '{ print $2 " " $3 }' | sort > pre-upgrade - cp -r repo/ / - chmod -R 664 /repo ; chmod -R +X /repo diff --git a/autotest/checkupgrade b/autotest/checkupgrade index 85ed567b41ebd88e17b27770c176eadcc58e6532..82f4ef63e8abcd3b735e66bbcd04a6eb2a41ecad 100755 --- a/autotest/checkupgrade +++ b/autotest/checkupgrade @@ -1,12 +1,8 @@ #!/bin/bash if [ $( diff pre-upgrade post-upgrade | wc -l ) -eq 0 ]; then - if [ "$(git branch | sed -n '/\* /s///p')" != "master" ]; then - echo 'E: Versions not changed' - exit 1 - else - echo 'W: Versions not changed, but on we are on a protected branch so they may have been built already.' - fi + echo 'E: Versions not changed' + exit 1 fi diff pre-upgrade post-upgrade diff --git a/autotest/get_previous_versions b/autotest/get_previous_versions new file mode 100755 index 0000000000000000000000000000000000000000..9aed0c320eb745f5e9b88a75c6185ce7a1e47720 --- /dev/null +++ b/autotest/get_previous_versions @@ -0,0 +1,48 @@ +#!/bin/bash + +if [ "$1" == "" ]; then + echo "Error: need a distro name, such as 'stretch-testing'" + exit 1 +fi + +# Get the current versions +head -n 1 ./*/debian/changelog | grep '^sympl' | sed -e 's|(||' -e 's|).*||' > .built +touch .install-ver + +# While we don't have a list +while [ "$( cat .install-ver | wc -l )" != "$( cat .built | wc -l )" ]; do + + # Sleep for a bit if it's not the first time + if [ -s .install-ver ]; then + echo -n '.' + sleep 10 + fi + + # Pull the list of packages + wget -q -O - "http://packages.mythic-beasts.com/mythic/dists/$1/main/source/Sources.gz" \ + | gunzip \ + | grep -A 2 '^Package: sympl' \ + | grep -v ^Binary \ + | sed -e 's|^Package: ||' -e 's|^Version: ||' \ + | tr '\n' ' ' \ + | sed -e 's| -- |\n|g' \ + > .packages + + # Get the newest version of each package + cat .packages .built \ + | sort -r \ + | uniq -u \ + | awk '!seen[$1] { print $1 " " $2 } {++seen[$1]}' \ + > .install + + # Filter for only packages in the repo + rm .install-ver + for package in $( find . -type f -name 'changelog' | sed -e 's|^\./||' -e 's|/.*||' | tr '\n' ' ' ); do + grep "^sympl-${package} " .install >> .install-ver + done + +done + +cat .install-ver + +rm .install-ver .install .packages .built