Closed guimard closed 5 years ago
Here is a simple way to do it (in shell):
#!/bin/sh
set -e
if test -e debian/upstream/metadata; then
echo "debian/upstream/metadata found" >&2
exit 1
fi
upstream=`perl -ne 'if(s@.*github.com/([^/]+)/([^/#]+).*$@$1/$2@){print;exit}' debian/copyright`
if test "$upstream" = ""; then
echo "Trying control" >&2
upstream=`perl -ne 'if(s@.*github.com/([^/]+)/([^/#]+).*$@$1/$2@){print;exit}' debian/control`
fi
if test "$upstream" = ""; then
echo Not found >&2
exit 1
fi
name=${upstream#*/}
mkdir -p debian/upstream
cat >debian/upstream/metadata <<EOF
---
Archive: GitHub
Bug-Database: https://github.com/$upstream/issues
Contact: https://github.com/$upstream/issues
Name: $name
Repository: https://github.com/$upstream.git
Repository-Browse: https://github.com/$upstream
EOF
Hello, please provide debian/upstream/metadata during creation. It is now required by policy. Regards, Xavier