[PATCH] deb-pkg: Beautify changelog

maximilian attems
2008-09-17T20:58:04Z

Try harder to find email and maintainer name.
Debian's own devscripts all use DEBEMAIL or DEBFULLNAME
prior to an eventual EMAIL or NAME environment variable.
Match their logic.

"Anonymous Maintainer" sounds nicer then Kernel compiler
if no name is found. As bonus add more descriptive changelog
entry.

Cc: Andres Salomon <dilinger@debian.org>
Signed-off-by: maximilian attems <max@stro.at>
---
scripts/package/builddeb | 25 ++++++++++++++++++++-----
1 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index ba6bf5d..9889a73 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -63,14 +63,29 @@ EOF
chmod 755 "$tmpdir/DEBIAN/$script"
done

-name="Kernel Compiler <$(id -nu)@$(hostname -f)>"
+# Try to determine maintainer and email values
+if [ -n "${DEBEMAIL}" ]; then
+ email=${DEBEMAIL}
+elif [ -n "${EMAIL}" ]; then
+ email=${EMAIL}
+else
+ email=$(id -nu)@$(hostname -f)
+fi
+if [ -n "${DEBFULLNAME}" ]; then
+ name=${DEBFULLNAME}
+elif [ -n "${NAME}" ]; then
+ name=${NAME}
+else
+ name="Anonymous Maintainer"
+fi
+maintainer="${name} <${email}>"
# Generate a simple changelog template
cat <<EOF > debian/changelog
linux ($version-$revision) unstable; urgency=low

- * A standard release
+ * New upstream release

- -- $name $(date -R)
+ -- ${maintainer} $(date -R)
EOF

# Generate a control file
@@ -80,7 +95,7 @@ cat <<EOF > debian/control
Source: linux
Section: base
Priority: optional
-Maintainer: $name
+Maintainer: $maintainer
Standards-Version: 3.6.1

Package: $packagename
@@ -102,7 +117,7 @@ cat <<EOF > debian/control
Source: linux
Section: base
Priority: optional
-Maintainer: $name
+Maintainer: $maintainer
Standards-Version: 3.6.1

Package: $packagename
--
1.5.6.5