Commit edec611db0474e90503d46428e4f196d5e30c091
Committed by
Sam Ravnborg
1 parent
9461f666e4
Exists in
master
and in
39 other branches
kbuild, deb-pkg: improve maintainer identification
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" sounds nicer then "Kernel Compiler" if no name is found. Signed-off-by: maximilian attems <max@stro.at> Signed-off-by: Frans Pop <elendil@planet.nl> Cc: Andres Salomon <dilinger@debian.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Showing 1 changed file with 19 additions and 3 deletions Side-by-side Diff
scripts/package/builddeb
... | ... | @@ -95,14 +95,30 @@ |
95 | 95 | chmod 755 "$tmpdir/DEBIAN/$script" |
96 | 96 | done |
97 | 97 | |
98 | -name="Kernel Compiler <$(id -nu)@$(hostname -f)>" | |
98 | +# Try to determine maintainer and email values | |
99 | +if [ -n "$DEBEMAIL" ]; then | |
100 | + email=$DEBEMAIL | |
101 | +elif [ -n "$EMAIL" ]; then | |
102 | + email=$EMAIL | |
103 | +else | |
104 | + email=$(id -nu)@$(hostname -f) | |
105 | +fi | |
106 | +if [ -n "$DEBFULLNAME" ]; then | |
107 | + name=$DEBFULLNAME | |
108 | +elif [ -n "$NAME" ]; then | |
109 | + name=$NAME | |
110 | +else | |
111 | + name="Anonymous" | |
112 | +fi | |
113 | +maintainer="$name <$email>" | |
114 | + | |
99 | 115 | # Generate a simple changelog template |
100 | 116 | cat <<EOF > debian/changelog |
101 | 117 | linux ($packageversion) unstable; urgency=low |
102 | 118 | |
103 | 119 | * Custom built Linux kernel. |
104 | 120 | |
105 | - -- $name $(date -R) | |
121 | + -- $maintainer $(date -R) | |
106 | 122 | EOF |
107 | 123 | |
108 | 124 | # Generate copyright file |
... | ... | @@ -130,7 +146,7 @@ |
130 | 146 | Source: linux |
131 | 147 | Section: base |
132 | 148 | Priority: optional |
133 | -Maintainer: $name | |
149 | +Maintainer: $maintainer | |
134 | 150 | Standards-Version: 3.6.1 |
135 | 151 | EOF |
136 | 152 |