]>
git.saurik.com Git - apt.git/blob - prepare-release
4 cd "$(readlink -f $(dirname $0))"
6 if [ -n "${GBP_BUILD_DIR}" ]; then
10 VERSION
=$(dpkg-parsechangelog | sed -n -e '/^Version:/s/^Version: //p')
11 DISTRIBUTION
=$(dpkg-parsechangelog | sed -n -e '/^Distribution:/s/^Distribution: //p')
13 LIBAPTPKGVERSION
="$(awk -v ORS='.' '/^\#define APT_PKG_M/ {print $3}' apt-pkg/contrib/macros.h | sed 's/\.$//')"
14 LIBAPTINSTVERSION
="$(egrep '^MAJOR=' apt-inst/makefile |cut -d '=' -f 2)"
16 librarysymbolsfromfile
() {
17 local MISSING
="$(grep '^+#MISSING' "$1")"
18 echo '=== Missing optional symbols:'
19 echo -n "$MISSING" | grep '|optional=' || true
20 echo '=== Missing required symbols:'
21 echo -n "$MISSING" | grep -v '|optional=' || true
22 echo '=== New symbols:'
23 grep '^+ ' "$1" | cut
-d' ' -f 2 | cut
-d'@' -f 1 | c
++filt
| while read line
; do
24 echo " (c++)\"${line}@Base\" $VERSION"
28 if [ "$1" = 'pre-export' ]; then
29 libraryversioncheck
() {
32 if [ ! -e "debian/${LIBRARY}${VERSION}.symbols" ]; then
33 echo >&2 "Library ${LIBRARY} in version ${VERSION} has no symbols file! (maybe forgot to rename?)"
36 if [ "$(head -n1 "debian/${LIBRARY}${VERSION}.symbols")" != "${LIBRARY}.so.${VERSION} ${LIBRARY}${VERSION} #MINVER#" ]; then
37 echo >&2 "Library ${LIBRARY}${VERSION} has incorrect version in symbol header! (»$(head -n1 "debian/${LIBRARY}${VERSION}.symbols")«)"
42 libraryversioncheck
'libapt-pkg' "$LIBAPTPKGVERSION"
43 libraryversioncheck
'libapt-inst' "$LIBAPTINSTVERSION"
46 if [ "$DISTRIBUTION" = 'sid' ]; then
47 echo >&2 '»sid« is not a valid distribution. Replace it with »unstable« for you'
48 sed -i -e 's/) sid; urgency=/) unstable; urgency=/' debian
/changelog
49 DISTRIBUTION
='unstable'
50 elif [ "$DISTRIBUTION" = 'UNRELEASED' ]; then
51 echo >&2 'WARNING: Remember to change to a valid distribution for release'
52 VERSION
="$VERSION~$(date +%Y%m%d)"
55 if [ "$(date +%Y-%m-%d)" != "$(grep --max-count=1 '^"POT-Creation-Date: .*\n"$' po/apt-all.pot | cut -d' ' -f 2)" -o \
56 "$(date +%Y-%m-%d)" != "$(grep --max-count=1 '^"POT-Creation-Date: .*\n"$' doc/po/apt-doc.pot | cut -d' ' -f 2)" ]; then
57 echo >&2 'POT files are not up-to-date. Execute »make update-po« for you…'
61 sed -i -e "s/^PACKAGE_VERSION=\".*\"$/PACKAGE_VERSION=\"${VERSION}\"/" configure.ac
62 sed -i -e "s/^<!ENTITY apt-product-version \".*\">$/<!ENTITY apt-product-version \"${VERSION}\">/" doc
/apt
-verbatim.ent
63 elif [ "$1" = 'post-build' ]; then
64 if [ "$DISTRIBUTION" != "UNRELEASED" ]; then
65 echo >&2 "REMEMBER: Tag this release with »git tag ${VERSION}« if you are satisfied"
67 echo >&2 'REMEMBER: Change to a valid distribution before release'
70 dpkg
-checkbuilddeps -d 'libxml2-utils'
72 HEADERBLUEPRINT
="$(mktemp)"
73 sed -n '1,/^$/p' doc
/apt
.8.xml
> "$HEADERBLUEPRINT"
74 find doc
-mindepth 1 -maxdepth 1 -type f
-name '*.xml' | while read FILE
; do
75 if ! sed -n '1,/^$/p' "$FILE" | cmp "$HEADERBLUEPRINT" - >/dev
/null
2>&1; then
76 echo >&2 "WARNING: Manpage $FILE has not the usual header! (see diff below)"
77 sed -n '1,/^$/p' "$FILE" | diff -u "$HEADERBLUEPRINT" - || true
80 sed -n '1,/^$/p' doc
/guide.dbk
> "$HEADERBLUEPRINT"
81 find doc
-mindepth 1 -maxdepth 1 -type f
-name '*.dbk' | while read FILE
; do
82 if ! sed -n '1,/^$/p' "$FILE" | cmp "$HEADERBLUEPRINT" - >/dev
/null
2>&1; then
83 echo >&2 "WARNING: Documentation $FILE has not the usual header (see diff below)!"
84 sed -n '1,/^$/p' "$FILE" | diff -u "$HEADERBLUEPRINT" - || true
89 # check the manpages with each vendor for vendor-specific errors…
90 find vendor
-mindepth 1 -maxdepth 1 -type d
| cut
-d'/' -f 2 | while read DISTRO
; do
91 ln -sf ..
/vendor
/${DISTRO}/apt
-vendor.ent doc
92 if ! xmllint
--nonet --valid --noout $(find doc/ -maxdepth 1 -name '*.xml'); then
93 echo >&2 "WARNING: original docbook manpages have errors with vendor ${DISTRO}!"
96 # lets assume we will always have a german manpage translation
97 if [ -e 'doc/de/' ]; then
98 # … but check the translations only with one vendor for translation-specific errors
99 if ! xmllint
--nonet --valid --noout $(find doc/ -mindepth 2 -maxdepth 2 -name '*.xml'); then
100 echo >&2 "WARNING: translated docbook manpages have errors!"
103 echo >&2 "ERROR: translated manpages need to be build before they can be checked!"
105 rm -f doc
/apt
-vendor.ent
107 elif [ "$1" = 'library' ]; then
109 echo "Checking $1 in version $2"
110 local tmpfile
=$(mktemp)
111 dpkg
-gensymbols -p${1}${2} -ebuild/bin
/${1}.so.
${2} -Idebian/${1}${2}.symbols
-O/dev
/null
2> /dev
/null
> $tmpfile || true
112 librarysymbolsfromfile
"$tmpfile"
115 librarysymbols
'libapt-pkg' "${LIBAPTPKGVERSION}"
117 librarysymbols
'libapt-inst' "${LIBAPTINSTVERSION}"
118 elif [ "$1" = 'buildlog' ]; then
119 while [ -n "$2" ]; do
120 librarysymbolsfromfile
"$2"
123 elif [ "$1" = 'travis-ci' ]; then
124 apt
-get install -q --no-install-recommends $(sed -n -e '/^Build-Depends: /,/^Build-Depends-Indep: / {p}' debian/control | sed -e 's#([^)]*)##g' -e 's#^Build-Depends\(-Indep\)\?: ##' | tr -d ',')
125 apt
-get install -q --no-install-recommends $(sed -n 's#^Depends: .*@, \(.*\)$#\
1#p' debian/tests/control | tr -d ',')
127 echo >&1 "Usage:\t$0 pre-export
131 If you use »git buildpackage« you can leave this script alone as it will
132 be run at the right places auto-magically. Otherwise you should use
133 »pre-export« to update po and pot files as well as version numbering.
134 »post-build« can be used to run some more or less useful checks later on.
136 »library« isn't run automatically but can be useful for maintaining the
137 (more or less experimental) symbols files we provide"