]> git.proxmox.com Git - debcargo-conf.git/blobdiff - update.sh
new upstream release of fd-find
[debcargo-conf.git] / update.sh
index 68975c949452512eaad4677cf2666fbb98b4cba9..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,7 +33,18 @@ 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 || true
@@ -96,3 +100,12 @@ 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