without DEBEMAIL invalid mail address put in changelog

Bug #458768 reported by Robert Collins
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bzr-builder
Fix Released
High
James Westby

Bug Description

bzr dailydeb ...

< Changed-By: bzr-builder <email address hidden>
---
> Changed-By: Bob The Builder </var/mail/bobthebuilder>

 affects bzr-builder
 done

The first line was from 0.1-0ubuntu1, the second from trunk.

-Rob

Related branches

Revision history for this message
James Westby (james-w) wrote :

What's the bug? That /var/mail/bobthebuilder is used?

Here's the code, which is a translation of what dch does.
Can you confirm that dch does something different in that
environment?

def get_maintainer():
    """
    Create maintainer string using the same algorithm as in dch
    """
    env = os.environ
    regex = re.compile(r"^(.*)\s+<(.*)>$")

    # Split email and name
    if 'DEBEMAIL' in env:
        match_obj = regex.match(env['DEBEMAIL'])
        if match_obj:
            if not 'DEBFULLNAME' in env:
                env['DEBFULLNAME'] = match_obj.group(1)
            env['DEBEMAIL'] = match_obj.group(2)
    if 'DEBEMAIL' not in env or 'DEBFULLNAME' not in env:
        if 'EMAIL' in env:
            match_obj = regex.match(env['EMAIL'])
            if match_obj:
                if not 'DEBFULLNAME' in env:
                    env['DEBFULLNAME'] = match_obj.group(1)
                env['EMAIL'] = match_obj.group(2)

    # Get maintainer's name
    if 'DEBFULLNAME' in env:
        maintainer = env['DEBFULLNAME']
    elif 'NAME' in env:
        maintainer = env['NAME']
    else:
        # Use password database if no data in environment variables
        try:
            maintainer = re.sub(r',.*', '', pwd.getpwuid(os.getuid()).pw_gecos)
        except KeyError, AttributeError:
            # TBD: Use last changelog entry value
            maintainer = "bzr-builder"

    # Get maintainer's mail address
    if 'DEBEMAIL' in env:
        email = env['DEBEMAIL']
    elif 'MAIL' in env:
        email = env['MAIL']
    else:
        addr = None
        if os.path.exists('/etc/mailname'):
            f = open('/etc/mailname')
            try:
                addr = f.readline().strip()
            finally:
                f.close()
        if not addr:
            addr = socket.getfqdn()
        if addr:
            user = pwd.getpwuid(os.getuid()).pw_name
            if not user:
                addr = None
            else:
                addr = "%s@%s" % (user, addr)

        if addr:
            email = addr
        else:
            # TBD: Use last changelog entry value
            email = "<email address hidden>"

    return (maintainer, email)

I can't really see how you get an email without an "@".

Thanks,

James

Changed in bzr-builder:
status: New → Incomplete
importance: Undecided → Medium
Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 458768] Re: without DEBEMAIL invalid mail address put in changelog

On Fri, 2009-10-23 at 09:22 +0000, James Westby wrote:
> What's the bug? That /var/mail/bobthebuilder is used?
>
> Here's the code, which is a translation of what dch does.
> Can you confirm that dch does something different in that
> environment?

dch -a uses bobthebuilder@localhost in that environment.

-Rob

Revision history for this message
James Westby (james-w) wrote :

from IRC:

$MAIL is wrongly used, it doesn't mean what we think it means. Dropping
that code should fix this.

Thanks,

James

Changed in bzr-builder:
status: Incomplete → Triaged
importance: Medium → High
James Westby (james-w)
Changed in bzr-builder:
status: Triaged → Fix Committed
assignee: nobody → James Westby (james-w)
James Westby (james-w)
Changed in bzr-builder:
milestone: none → 0.3
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.