X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/cc1b834fe966d40206d148e1f27f0502463ac69f..5832913a49d4f7c75527264a935cc0ce00627f1d:/prepare-release diff --git a/prepare-release b/prepare-release index 77d8580d9..0004de310 100755 --- a/prepare-release +++ b/prepare-release @@ -11,7 +11,7 @@ VERSION=$(dpkg-parsechangelog | sed -n -e '/^Version:/s/^Version: //p') DISTRIBUTION=$(dpkg-parsechangelog | sed -n -e '/^Distribution:/s/^Distribution: //p') LIBAPTPKGVERSION="$(awk -v ORS='.' '/^\#define APT_PKG_M/ {print $3}' apt-pkg/contrib/macros.h | sed 's/\.$//')" -LIBAPTINSTVERSION="$(grep '^MAJOR=' apt-inst/makefile |cut -d '=' -f 2)" +LIBAPTINSTVERSION="$(sed -nr 's/set\(MAJOR ([^)]*)\)/\1/p' apt-inst/CMakeLists.txt)" librarysymbolsfromfile() { local MISSING="$(grep '^+#MISSING' "$1")" @@ -26,6 +26,26 @@ librarysymbolsfromfile() { done | sort -u } +test_deb_control() { + echo "Package: apt-test-depends" + echo "Version: 1.0" + echo "Architecture: all" + printf "Depends:" + ( + for i in Build-Depends Build-Depends-Indep Build-Depends-Arch; do + grep-dctrl -ns $i -S apt ./debian/control && echo , + done + grep-dctrl -ns Depends -F Tests run-tests ./debian/tests/control + ) | tr '\n' ' '\ + | sed -r -e 's#<[^,<>()@]*>##g' \ + -e 's#@[^,<>()@]*@##g' \ + -e 's#dpkg-dev \([^)]*\)#dpkg-dev#g' \ + -e 's#debhelper \([^)]*\)#debhelper#g' \ + -e 's#@##g' \ + -e 's#,(\s+,)+#, #g' \ + -e 's#\s+# #g' +} + if [ "$1" = 'pre-export' ]; then libraryversioncheck() { local LIBRARY="$1" @@ -53,7 +73,7 @@ if [ "$1" = 'pre-export' ]; then VERSION="$VERSION~$(date +%Y%m%d)" fi - sed -i -e "s/^PACKAGE_VERSION=\".*\"$/PACKAGE_VERSION=\"${VERSION}\"/" configure.ac + sed -i -e "s/^set(PACKAGE_VERSION \".*\")$/set(PACKAGE_VERSION \"${VERSION}\")/" CMakeLists.txt sed -i -e "s/^$//" doc/apt-verbatim.ent # update the last-modification field of manpages based on git changes @@ -68,15 +88,17 @@ Git-Dch: Ignore' "$file")" '+%Y-%m-%dT00:00:00Z')" if [ "$(date +%Y-%m-%d)" != "$(grep --max-count=1 '^"POT-Creation-Date: .*\n"$' po/apt-all.pot | cut -d' ' -f 2)" -o \ "$(date +%Y-%m-%d)" != "$(grep --max-count=1 '^"POT-Creation-Date: .*\n"$' doc/po/apt-doc.pot | cut -d' ' -f 2)" ]; then echo >&2 'POT files are not up-to-date. Execute »make update-po« for you…' - make update-po + [ -e build ] || mkdir build + ( cd build && cmake .. ) + cmake --build build --target update-po -- -j 4 fi elif [ "$1" = 'pre-build' ]; then if [ "$DISTRIBUTION" = "UNRELEASED" ]; then echo 'BUILDING AN UNRELEASED VERSION' else - CONFVERSION="$(sed -ne "s/^PACKAGE_VERSION=\"\(.*\)\"$/\1/p" configure.ac)" + CONFVERSION="$(sed -ne "s/^set(PACKAGE_VERSION \"\(.*\)\")$/\1/p" CMakeLists.txt)" if [ "$VERSION" != "$CONFVERSION" ]; then - echo "changelog (${VERSION}) and configure (${CONFVERSION}) talk about different versions!" + echo "changelog (${VERSION}) and CMakeLists.txt (${CONFVERSION}) talk about different versions!" echo "You probably want to run »./prepare-release pre-export« to fix this." exit 1 fi @@ -115,9 +137,11 @@ elif [ "$1" = 'post-build' ]; then fi done # lets assume we will always have a german manpage translation - if [ -e 'doc/de/' ]; then + if [ -e */doc/de/ -o -e doc/de ]; then # … but check the translations only with one vendor for translation-specific errors - if ! xmllint --nonet --valid --noout $(find doc/ -mindepth 2 -maxdepth 2 -name '*.xml'); then + if ! xmllint --path /vendor/$(./vendor/getinfo current)/ \ + --path doc/ \ + --nonet --valid --noout $(find doc/ */doc/ -mindepth 2 -maxdepth 2 -name '*.xml'); then echo >&2 "WARNING: translated docbook manpages have errors!" fi else @@ -154,8 +178,11 @@ elif [ "$1" = 'buildlog' ]; then shift done elif [ "$1" = 'travis-ci' ]; then - apt-get install -qy --no-install-recommends $(sed -n -e '/^Build-Depends: /,/^Build-Depends-Indep: / {p}' debian/control | sed -e 's#([^)]*)##g' -e 's#^Build-Depends\(-Indep\)\?: ##' -e 's#<.*>##g' | tr -d ',') - apt-get install -qy --no-install-recommends $(sed -n 's#^Depends: .*@, \(.*\)$#\1#p' debian/tests/control | tr -d ',') + apt-get install -qy --no-install-recommends dctrl-tools equivs gdebi-core moreutils + + test_deb_control > test-control + equivs-build test-control + gdebi -n apt-test-depends_1.0_all.deb elif [ "$1" = 'coverage' ]; then DIR="${2:-./coverage}" git clean -dfX # remove ignored build artefacts for a clean start