]> git.proxmox.com Git - debcargo-conf.git/blobdiff - update.sh
new upstream release of fd-find
[debcargo-conf.git] / update.sh
index a197fbeb88baf697f417b4033af35742cb1f6f3e..181663ced8f9d4c91f8e3af7c29d970541f55cae 100755 (executable)
--- a/update.sh
+++ b/update.sh
@@ -14,22 +14,15 @@ if [ -n "$VER" ]; then
 fi
 if [ ! -d "$PKGDIR/debian" ]; then
        mkdir -p "$PKGDIR/debian"
-       echo 'overlay = "."' > "$PKGCFG"
+       cat <<-eof > "$PKGCFG"
+       overlay = "."
+       uploaders = ["$DEBFULLNAME <$DEBEMAIL>"]
+       eof
        git add "$PKGDIR"
 fi
 if [ ! -f "$PKGDIR/debian/copyright" ]; then
        cat <<-eof > "$PKGDIR/debian/copyright"
        FIXME fill me in using ./copyright.debcargo.hint as a guide
-
-       You may find the following useful too:
-
-       Files: debian/*
-       Copyright:
-        2018 Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
-        2018 $DEBFULLNAME <$DEBEMAIL>
-
-       The reason we don't put this in debian/copyright.debcargo.hint itself is
-       documented here: https://salsa.debian.org/rust-team/debcargo-conf/issues/5
        eof
 fi
 if [ -n "$VER" -a "$(sed -ne 's/^semver_suffix\s*=\s*//p' "$PKGCFG")" != "true" ]; then
@@ -40,10 +33,21 @@ if [ -n "$VER" -a "$(sed -ne 's/^semver_suffix\s*=\s*//p' "$PKGCFG")" != "true"
        fi
 fi
 
+if ! grep -q uploaders "$PKGCFG"; then
+       # try to auto-fill in uploaders if debcargo.toml doesn't have it
+       uploader="$(egrep -A1 "[0-9][0-9]*( Debian)? Rust Maintainers" "$PKGDIR/debian/copyright" | tail -n1 | sed -re 's/^\s*[0-9]+\s*//g')"
+       sed -i -e 's/^\(overlay.*\)$/\1\nuploaders = ["'"$uploader"'"]/' "$PKGCFG"
+       if [ "$uploader" != "$DEBFULLNAME <$DEBEMAIL>" ]; then
+               echo >&2 "$0: Auto-added $uploader to uploaders in debcargo.toml, based on d/copyright"
+               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
+       fi
+fi
+
 run_debcargo
+git add -N "$PKGDIR"
 
 if ! git diff --quiet -- "$PKGDIR_REL"; then
-       read -p "Update wrote some changes to $PKGDIR_REL, press enter to git diff..." x
+       read -p "Update wrote some changes to $PKGDIR_REL, press enter to git diff..." x || true
        git diff -- "$PKGDIR_REL"
        echo >&2 "-- end of git diff --"
 fi
@@ -79,10 +83,29 @@ If there was a \`git diff\` above, check it to see if debcargo made changes to
 any auto-generated hint files. If so, you should make the equivalent changes to
 the non-hint files, and git-add these too.
 
-When satisfied with the output, you can commit and push all your changes. Then,
-ask a Debian Developer to run \`./release.sh $*\` to finalise your changes in
-the changelog and build a release-ready .dsc in build/. Assuming it runs
-successfully, they may \`dput\` the results afterwards. If you're not a Debian
-Developer and are unable to upload, please don't run that script because it
-will add inaccurate commits to git stating that the package has been uploaded.
+You can test-build your package by running:
+
+  cd build && ./build.sh $CRATE $VER
+
+This assumes that you have set up sbuild; see "DD instructions" in README.rst
+for details. Try to fix any lintian errors, but note that some errors are due
+to lintian being out-of-date and/or are expected at this stage of the process
+(e.g. bad-distribution-in-changes-file). Ask on IRC when in doubt.
+
+When satisfied with the output (both of debcargo after running ./update.sh, and
+of lintian after running ./build.sh), you can commit and push all your changes.
+
+Then, ask a Debian Developer to run \`./release.sh $*\`. This finalises your
+changes in the changelog, and allows them to build and upload the package. If
+you're not a Debian Developer and are unable to upload, please don't run that
+script or else you will need to revert the changes that it makes to your git.
+eof
+if [ -n "$VER" ]; then
+cat >&2 <<eof
+
+You are packaging an older version of a crate. Please document why it's needed,
+by adding comments to src/$PKGNAME/debian/debcargo.toml. For example because it
+is a dependency of other crate(s), and it is not possible to update them to use
+the latest version of $CRATE. Please also mention the names of these crate(s).
 eof
+fi