Require 2.2.7 and try to auto-fill in "uploaders" in future
Ximin Luo
5 years ago
13 | 13 |
fi
|
14 | 14 |
if [ ! -d "$PKGDIR/debian" ]; then
|
15 | 15 |
mkdir -p "$PKGDIR/debian"
|
16 | |
echo 'overlay = "."' > "$PKGCFG"
|
|
16 |
cat <<-eof > "$PKGCFG"
|
|
17 |
overlay = "."
|
|
18 |
uploaders = ["$DEBFULLNAME <$DEBEMAIL>"]
|
|
19 |
eof
|
17 | 20 |
git add "$PKGDIR"
|
18 | 21 |
fi
|
19 | 22 |
if [ ! -f "$PKGDIR/debian/copyright" ]; then
|
20 | 23 |
cat <<-eof > "$PKGDIR/debian/copyright"
|
21 | 24 |
FIXME fill me in using ./copyright.debcargo.hint as a guide
|
22 | |
|
23 | |
You may find the following useful too:
|
24 | |
|
25 | |
Files: debian/*
|
26 | |
Copyright:
|
27 | |
2018 Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
|
28 | |
2018 $DEBFULLNAME <$DEBEMAIL>
|
29 | |
|
30 | |
The reason we don't put this in debian/copyright.debcargo.hint itself is
|
31 | |
documented here: https://salsa.debian.org/rust-team/debcargo-conf/issues/5
|
32 | 25 |
eof
|
33 | 26 |
fi
|
34 | 27 |
if [ -n "$VER" -a "$(sed -ne 's/^semver_suffix\s*=\s*//p' "$PKGCFG")" != "true" ]; then
|
|
36 | 29 |
sed -i -e 's/^\(semver_suffix\s*=\s*\).*/\1true/' "$PKGCFG"
|
37 | 30 |
else
|
38 | 31 |
sed -i -e '1isemver_suffix = true' "$PKGCFG"
|
|
32 |
fi
|
|
33 |
fi
|
|
34 |
|
|
35 |
if ! grep -q uploaders "$PKGCFG"; then
|
|
36 |
# try to auto-fill in uploaders if debcargo.toml doesn't have it
|
|
37 |
uploader="$(grep -A1 "[0-9][0-9]* Debian Rust Maintainers" "$PKGDIR/debian/copyright" | tail -n1 | sed -re 's/^\s*[0-9]+\s*//g')"
|
|
38 |
sed -i -e 's/^\(overlay.*\)$/\1\nuploaders = ["'"$uploader"'"]/' "$PKGCFG"
|
|
39 |
if [ "$uploader" != "$DEBFULLNAME <$DEBEMAIL>" ]; then
|
|
40 |
echo >&2 "$0: Auto-added $uploader to uploaders in debcargo.toml, based on d/copyright"
|
|
41 |
read >&2 -p "$0: You may also want to add yourself; ctrl-c if you want to do that, or press enter to continue... " x
|
39 | 42 |
fi
|
40 | 43 |
fi
|
41 | 44 |
|
34 | 34 |
test -x "$DEBCARGO" || abort 1 "debcargo found but not executable: $DEBCARGO"
|
35 | 35 |
dcver=$($DEBCARGO --version | sed -ne 's/debcargo //p')
|
36 | 36 |
case $dcver in
|
37 | |
2.0.*|2.1.*|2.2.[012345]|2.2.[012345]-*) abort 1 "unsupported debcargo version $dcver. try reinstalling with \`cargo install debcargo --force\`";;
|
|
37 |
2.0.*|2.1.*|2.2.[0123456]|2.2.[0123456]-*) abort 1 "unsupported debcargo version $dcver. try reinstalling with \`cargo install debcargo --force\`";;
|
38 | 38 |
2.2.*) true;;
|
39 | 39 |
*) abort 1 "unsupported debcargo version: $dcver";;
|
40 | 40 |
esac
|