]> git.proxmox.com Git - debcargo-conf.git/blob - update.sh
Merge branches 'pending-vec-map', 'pending-regex-syntax', 'pending-winapi', 'pending...
[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 rm -rf "$BUILDDIR" "$(dirname "$BUILDDIR")/rust-${PKGNAME}_$VER"*.orig.tar.*
44 $DEBCARGO package --config "$PKGCFG" --directory "$BUILDDIR" "$CRATE" "$VER"
45
46 if ! git diff --quiet -- "$PKGDIR_REL"; then
47 read -p "Update wrote some changes to $PKGDIR_REL, press enter to git diff..." x
48 git diff -- "$PKGDIR_REL"
49 echo >&2 "-- end of git diff --"
50 fi
51
52 cat >&2 <<eof
53 Automatic update of $CRATE finished; now it's your turn to manually review it.
54
55 Deal with any FIXMEs mentioned above, by editing any corresponding source files
56 in $PKGDIR_REL. If a hint file is listed, indicated by (•), you should edit the
57 *NON*-hint file, without the suffix .debcargo.hint, and git-add the hint file
58 exactly as output by debcargo. So for example:
59
60 to deal with a FIXME in:
61 build/$PKGNAME/debian/copyright.debcargo.hint
62 you should edit (and git-add when ready):
63 src/$PKGNAME/debian/copyright
64 and directly git-add without editing:
65 src/$PKGNAME/debian/copyright.debcargo.hint
66
67 When done, git-add all your changes plus any unmodified hint files, and re-run
68 this command (\`./update.sh $*\`).
69
70 For issues with debian/control, edit src/$PKGNAME/debian/debcargo.toml instead.
71 You can find docs for that in debcargo.toml.example in the debcargo git repo.
72
73 Check that your fixes actually get rid of the FIXMEs. Of course, you can ignore
74 FIXMEs listed in hint files, assuming you actually fixed the issues in the
75 corresponding non-hint files. (We have no way to auto-detect this so you have
76 to be honest!) You should also ignore the FIXME in the Distribution field in
77 the top entry of debian/changelog, that will be dealt with in the next step.
78
79 If there was a \`git diff\` above, check it to see if debcargo made changes to
80 any auto-generated hint files. If so, you should make the equivalent changes to
81 the non-hint files, and git-add these too.
82
83 When satisfied with the output, you can commit and push all your changes. Then,
84 ask a Debian Developer to run \`./release.sh $*\` to finalise your changes in
85 the changelog and build a release-ready .dsc in build/. Assuming it runs
86 successfully, they may \`dput\` the results afterwards. If you're not a Debian
87 Developer and are unable to upload, please don't run that script because it
88 will add inaccurate commits to git stating that the package has been uploaded.
89 eof