debcargo-conf/dev/grant-dm-perms.sh
Ian Jackson 87c0930c70 Make scripts all be #!/bin/bash
sh is rather inconvenient.  I am about to introduce a bashism in
vars.sh.frag and various others.
2021-09-03 11:47:40 +01:00

17 lines
405 B
Bash
Executable File

#!/bin/bash
# Grant DM upload permissions on all crates maintained by a DM.
if [ "$#" -ne 1 ]; then
echo "Syntax: $0 <email>"
exit 1
fi
m="$1"
shift
grep -l "$m" src/*/debian/copyright src/*/debian/debcargo.toml \
| sed -nre 's,src/(.*)/debian/.*,\1,gp' \
| sort -u \
| dev/filter-package-in-debian.sh \
| sed -nre 's/^(.*)\s[1-9][0-9]*$/rust-\1/gp' \
| xargs -r dcut "$@" dm --uid "$m" --allow