debian: Prepare for upload
[xz/debian.git] / debian / autogen.sh
blob05a3a9fde8f6cf53cdaec048963973920ba5789d
1 #!/bin/sh
2 # Generate debian/changelog.upstream, debian/generated-m4.list,
3 # and debian/generated-po.list.
5 # Uses debian/changelog, the git revision log, and .gitignore
6 # files from the current checkout.
8 set -e
10 changelog_needs_update() {
11 test -e debian/changelog.upstream &&
12 read line < debian/changelog.upstream ||
13 return 0
15 ver=${line#Version } &&
16 ver=${ver%;*} &&
17 test "$ver" != "" ||
18 return 0
20 read line < debian/changelog &&
21 rhs=${line#*(} &&
22 deb_ver=${rhs%)*} &&
23 new_ver=${deb_ver%-*} ||
24 return 0
26 test "$ver" != "$new_ver"
29 cp -f m4/.gitignore debian/generated-m4.list
30 cp -f po/.gitignore debian/generated-po.list
31 sed -n 's,^build-aux/,, p' .gitignore > debian/generated-build-aux.list
32 ! changelog_needs_update || exec sh debian/changelog.upstream.sh