Debian Codegraph @

debian/dh_gencontrol

raw
1 #!/bin/sh
2
3 set -eu
4
5 run() {
6 echo "${@}"
7 "$@"
8 }
9
10 debrev=$(dpkg-parsechangelog -SVersion | sed -e 's/.*-//')
11 debsrc=$(dpkg-parsechangelog -SVersion | sed -e 's/-.*//')
12
13 for pkg in $(dh_listpackages); do
14 root=$(grep-dctrl -F Package -n -s X-DhRuby-Root -X "${pkg}" debian/control)
15 v=$(cd "${root}" && ruby -Ilib -e "puts Gem::Specification.load('${root}.gemspec').version")
16
17 if [ "${v}" != "${debsrc}" ]; then
18 # Add as a suffix the source version for all binary packages
19 # with version number different from the source (See #1004505)
20 v="$v+$debsrc"
21 fi
22
23 if [ "${pkg}" = 'ruby-nanoc-live' ]; then
24 # special case: ruby-nanoc-live has been uploaded with a higher version
25 # copied from the main nanoc version
26 if dpkg --compare-versions ${v} lt '4.11.14'; then
27 v="4.11.14.really${v}"
28 fi
29 fi
30
31 run dh_gencontrol -p${pkg} -- -v${v}-${debrev}
32 done