diff mbox series

[v2,2/3] kbuild: deb-pkg: remove support for "name <email>" form for DEBEMAIL

Message ID 20240702180332.398978-2-masahiroy@kernel.org (mailing list archive)
State New
Headers show
Series [v2,1/3] kbuild: deb-pkg: remove support for EMAIL environment variable | expand

Commit Message

Masahiro Yamada July 2, 2024, 6:02 p.m. UTC
Commit d5940c60e057 ("kbuild: deb-pkg improve maintainer address
generation") supported the "name <email>" form for DEBEMAIL, with
behavior slightly different from devscripts.

In Kbuild, if DEBEMAIL has the form "name <email>", it will be used
as-is for debian/changelog. DEBFULLNAME will be ignored.

In contrast, debchange takes the name from DEBFULLNAME (or NAME) if set,
as described in 'man debchange':

  If this variable has the form "name <email>", then the maintainer name
  will also be taken from here if neither DEBFULLNAME nor NAME is set.

This commit removes support for the "name <email> form for DEBEMAIL,
as the current behavior is already different from debchange, and the
Debian manual suggests setting the email address and name separately in
DEBEMAIL and DEBFULLNAME. [1]

If there are any complaints about this removal, we can re-add it,
with better alignment with the debchange implementation. [2]

[1]: https://www.debian.org/doc/manuals/debmake-doc/ch03.en.html#email-setup
[2]: https://salsa.debian.org/debian/devscripts/-/blob/v2.23.7/scripts/debchange.pl#L802

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

Changes in v2:
 - New patch

 scripts/package/mkdebian | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

Comments

Masahiro Yamada July 3, 2024, 3:06 p.m. UTC | #1
+CC



On Wed, Jul 3, 2024 at 3:03 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> Commit d5940c60e057 ("kbuild: deb-pkg improve maintainer address
> generation") supported the "name <email>" form for DEBEMAIL, with
> behavior slightly different from devscripts.
>
> In Kbuild, if DEBEMAIL has the form "name <email>", it will be used
> as-is for debian/changelog. DEBFULLNAME will be ignored.
>
> In contrast, debchange takes the name from DEBFULLNAME (or NAME) if set,
> as described in 'man debchange':
>
>   If this variable has the form "name <email>", then the maintainer name
>   will also be taken from here if neither DEBFULLNAME nor NAME is set.
>
> This commit removes support for the "name <email> form for DEBEMAIL,
> as the current behavior is already different from debchange, and the
> Debian manual suggests setting the email address and name separately in
> DEBEMAIL and DEBFULLNAME. [1]
>
> If there are any complaints about this removal, we can re-add it,
> with better alignment with the debchange implementation. [2]
>
> [1]: https://www.debian.org/doc/manuals/debmake-doc/ch03.en.html#email-setup
> [2]: https://salsa.debian.org/debian/devscripts/-/blob/v2.23.7/scripts/debchange.pl#L802
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
>
> Changes in v2:
>  - New patch
>
>  scripts/package/mkdebian | 20 +++++++-------------
>  1 file changed, 7 insertions(+), 13 deletions(-)
>
> diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
> index 589f92b88c42..83c6636fadb8 100755
> --- a/scripts/package/mkdebian
> +++ b/scripts/package/mkdebian
> @@ -125,21 +125,15 @@ gen_source ()
>  rm -rf debian
>  mkdir debian
>
> -email=${DEBEMAIL}
> -
> -# use email string directly if it contains <email>
> -if echo "${email}" | grep -q '<.*>'; then
> -       maintainer=${email}
> +user=${KBUILD_BUILD_USER-$(id -nu)}
> +name=${DEBFULLNAME-${user}}
> +if [ "${DEBEMAIL:+set}" ]; then
> +       email=${DEBEMAIL}
>  else
> -       # or construct the maintainer string
> -       user=${KBUILD_BUILD_USER-$(id -nu)}
> -       name=${DEBFULLNAME-${user}}
> -       if [ -z "${email}" ]; then
> -               buildhost=${KBUILD_BUILD_HOST-$(hostname -f 2>/dev/null || hostname)}
> -               email="${user}@${buildhost}"
> -       fi
> -       maintainer="${name} <${email}>"
> +       buildhost=${KBUILD_BUILD_HOST-$(hostname -f 2>/dev/null || hostname)}
> +       email="${user}@${buildhost}"
>  fi
> +maintainer="${name} <${email}>"
>
>  if [ "$1" = --need-source ]; then
>         gen_source
> --
> 2.43.0
>
Nicolas Schier July 4, 2024, 9:28 a.m. UTC | #2
On Thu, Jul 04, 2024 at 12:06:13AM +0900, Masahiro Yamada wrote:
> +CC
> 
> 
> 
> On Wed, Jul 3, 2024 at 3:03 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
> >
> > Commit d5940c60e057 ("kbuild: deb-pkg improve maintainer address
> > generation") supported the "name <email>" form for DEBEMAIL, with
> > behavior slightly different from devscripts.
> >
> > In Kbuild, if DEBEMAIL has the form "name <email>", it will be used
> > as-is for debian/changelog. DEBFULLNAME will be ignored.
> >
> > In contrast, debchange takes the name from DEBFULLNAME (or NAME) if set,
> > as described in 'man debchange':
> >
> >   If this variable has the form "name <email>", then the maintainer name
> >   will also be taken from here if neither DEBFULLNAME nor NAME is set.
> >
> > This commit removes support for the "name <email> form for DEBEMAIL,
> > as the current behavior is already different from debchange, and the
> > Debian manual suggests setting the email address and name separately in
> > DEBEMAIL and DEBFULLNAME. [1]
> >
> > If there are any complaints about this removal, we can re-add it,
> > with better alignment with the debchange implementation. [2]
> >
> > [1]: https://www.debian.org/doc/manuals/debmake-doc/ch03.en.html#email-setup
> > [2]: https://salsa.debian.org/debian/devscripts/-/blob/v2.23.7/scripts/debchange.pl#L802
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> > ---
> >
> > Changes in v2:
> >  - New patch
> >
> >  scripts/package/mkdebian | 20 +++++++-------------
> >  1 file changed, 7 insertions(+), 13 deletions(-)
> >
> > diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
> > index 589f92b88c42..83c6636fadb8 100755
> > --- a/scripts/package/mkdebian
> > +++ b/scripts/package/mkdebian
> > @@ -125,21 +125,15 @@ gen_source ()
> >  rm -rf debian
> >  mkdir debian
> >
> > -email=${DEBEMAIL}
> > -
> > -# use email string directly if it contains <email>
> > -if echo "${email}" | grep -q '<.*>'; then
> > -       maintainer=${email}
> > +user=${KBUILD_BUILD_USER-$(id -nu)}
> > +name=${DEBFULLNAME-${user}}
> > +if [ "${DEBEMAIL:+set}" ]; then
> > +       email=${DEBEMAIL}
> >  else
> > -       # or construct the maintainer string
> > -       user=${KBUILD_BUILD_USER-$(id -nu)}
> > -       name=${DEBFULLNAME-${user}}
> > -       if [ -z "${email}" ]; then
> > -               buildhost=${KBUILD_BUILD_HOST-$(hostname -f 2>/dev/null || hostname)}
> > -               email="${user}@${buildhost}"
> > -       fi
> > -       maintainer="${name} <${email}>"
> > +       buildhost=${KBUILD_BUILD_HOST-$(hostname -f 2>/dev/null || hostname)}
> > +       email="${user}@${buildhost}"
> >  fi
> > +maintainer="${name} <${email}>"
> >
> >  if [ "$1" = --need-source ]; then
> >         gen_source
> > --
> > 2.43.0

Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
diff mbox series

Patch

diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index 589f92b88c42..83c6636fadb8 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -125,21 +125,15 @@  gen_source ()
 rm -rf debian
 mkdir debian
 
-email=${DEBEMAIL}
-
-# use email string directly if it contains <email>
-if echo "${email}" | grep -q '<.*>'; then
-	maintainer=${email}
+user=${KBUILD_BUILD_USER-$(id -nu)}
+name=${DEBFULLNAME-${user}}
+if [ "${DEBEMAIL:+set}" ]; then
+	email=${DEBEMAIL}
 else
-	# or construct the maintainer string
-	user=${KBUILD_BUILD_USER-$(id -nu)}
-	name=${DEBFULLNAME-${user}}
-	if [ -z "${email}" ]; then
-		buildhost=${KBUILD_BUILD_HOST-$(hostname -f 2>/dev/null || hostname)}
-		email="${user}@${buildhost}"
-	fi
-	maintainer="${name} <${email}>"
+	buildhost=${KBUILD_BUILD_HOST-$(hostname -f 2>/dev/null || hostname)}
+	email="${user}@${buildhost}"
 fi
+maintainer="${name} <${email}>"
 
 if [ "$1" = --need-source ]; then
 	gen_source