]> git.proxmox.com Git - debcargo-conf.git/blob - update.sh
a197fbeb88baf697f417b4033af35742cb1f6f3e
[debcargo-conf.git] / update.sh
1 #!/bin/sh
2
3 . ./vars.sh.frag
4
5 case "$(git rev-parse --abbrev-ref HEAD)" in
6 pending-*) abort 1 "You are on a pending-release branch, $0 can only be run on another branch, like master";;
7 esac
8
9 if [ -n "$VER" ]; then
10 if [ ! -d "$PWD/src/$PKGBASE" ]; then
11 abort 1 "Using crate $CRATE with version $VER but default-version is not packaged." \
12 "Package that first by running this script without the explicit version."
13 fi
14 fi
15 if [ ! -d "$PKGDIR/debian" ]; then
16 mkdir -p "$PKGDIR/debian"
17 echo 'overlay = "."' > "$PKGCFG"
18 git add "$PKGDIR"
19 fi
20 if [ ! -f "$PKGDIR/debian/copyright" ]; then
21 cat <<-eof > "$PKGDIR/debian/copyright"
22 FIXME fill me in using ./copyright.debcargo.hint as a guide
23
24 You may find the following useful too:
25
26 Files: debian/*
27 Copyright:
28 2018 Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
29 2018 $DEBFULLNAME <$DEBEMAIL>
30
31 The reason we don't put this in debian/copyright.debcargo.hint itself is
32 documented here: https://salsa.debian.org/rust-team/debcargo-conf/issues/5
33 eof
34 fi
35 if [ -n "$VER" -a "$(sed -ne 's/^semver_suffix\s*=\s*//p' "$PKGCFG")" != "true" ]; then
36 if grep -q semver_suffix "$PKGCFG"; then
37 sed -i -e 's/^\(semver_suffix\s*=\s*\).*/\1true/' "$PKGCFG"
38 else
39 sed -i -e '1isemver_suffix = true' "$PKGCFG"
40 fi
41 fi
42
43 run_debcargo
44
45 if ! git diff --quiet -- "$PKGDIR_REL"; then
46 read -p "Update wrote some changes to $PKGDIR_REL, press enter to git diff..." x
47 git diff -- "$PKGDIR_REL"
48 echo >&2 "-- end of git diff --"
49 fi
50
51 cat >&2 <<eof
52 Automatic update of $CRATE finished; now it's your turn to manually review it.
53
54 Deal with any FIXMEs mentioned above, by editing any corresponding source files
55 in $PKGDIR_REL. If a hint file is listed, indicated by (•), you should edit the
56 *NON*-hint file, without the suffix .debcargo.hint, and git-add the hint file
57 exactly as output by debcargo. So for example:
58
59 to deal with a FIXME in:
60 build/$PKGNAME/debian/copyright.debcargo.hint
61 you should edit (and git-add when ready):
62 src/$PKGNAME/debian/copyright
63 and directly git-add without editing:
64 src/$PKGNAME/debian/copyright.debcargo.hint
65
66 When done, git-add all your changes plus any unmodified hint files, and re-run
67 this command (\`./update.sh $*\`).
68
69 For issues with debian/control, edit src/$PKGNAME/debian/debcargo.toml instead.
70 You can find docs for that in debcargo.toml.example in the debcargo git repo.
71
72 Check that your fixes actually get rid of the FIXMEs. Of course, you can ignore
73 FIXMEs listed in hint files, assuming you actually fixed the issues in the
74 corresponding non-hint files. (We have no way to auto-detect this so you have
75 to be honest!) You should also ignore the FIXME in the Distribution field in
76 the top entry of debian/changelog, that will be dealt with in the next step.
77
78 If there was a \`git diff\` above, check it to see if debcargo made changes to
79 any auto-generated hint files. If so, you should make the equivalent changes to
80 the non-hint files, and git-add these too.
81
82 When satisfied with the output, you can commit and push all your changes. Then,
83 ask a Debian Developer to run \`./release.sh $*\` to finalise your changes in
84 the changelog and build a release-ready .dsc in build/. Assuming it runs
85 successfully, they may \`dput\` the results afterwards. If you're not a Debian
86 Developer and are unable to upload, please don't run that script because it
87 will add inaccurate commits to git stating that the package has been uploaded.
88 eof