Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 477728

Summary: repoman ci fails to signed commit with pinentry-curses
Product: Portage Development Reporter: Azamat H. Hackimov <azamat.hackimov>
Component: RepomanAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: alonbl, zlogene
Priority: Normal Keywords: InVCS
Version: 2.1   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 472632    
Attachments: emerge-info.txt

Description Azamat H. Hackimov 2013-07-22 11:31:26 UTC
When I switch to pinentry-curses, I cannot sign commits in git-based overlay:

LANG=en repoman ci

RepoMan scours the neighborhood...
>>> Creating Manifest for /home/winterheart/gentoo/overlay/foo/bar

Note: use --include-dev (-d) to check dependencies for 'dev' profiles

* 1 files being committed...

You need a passphrase to unlock the secret key for
user: "Azamat H. Hackimov <azamat.hackimov@gmail.com>"
2048-bit DSA key, ID A018DE8C, created 2011-01-18

[there should be appear pinentry-curses window]

gpg: problem with the agent: End of file
gpg: skipped "0xA018DE8C": Operation cancelled
gpg: signing failed: Operation cancelled
error: gpg failed to sign the data
fatal: failed to write commit object
!!! Exiting on git (shell) error code: 128

When I switch back to pinentry-qt4 or pinentry-gtk2, window with passphrase request normally appears.
Comment 1 Azamat H. Hackimov 2013-07-22 11:35:30 UTC
Created attachment 353854 [details]
emerge-info.txt
Comment 2 Zac Medico gentoo-dev 2013-07-22 15:16:37 UTC
It seems like you have a problem with your gpg, gpg-agent, or how you have them configured.

We use python's subprocess.call() function to execute gpg, and it is the simplest possible way to do so. The subprocess inherits all three stdin, stdout, and stderr streams.
Comment 3 Agostino Sarubbo gentoo-dev 2013-07-22 15:29:48 UTC
Fine for me, paste you configs without the comments
Comment 4 Azamat H. Hackimov 2013-07-22 16:40:21 UTC
egrep -v "^(#|$)" ~/.gnupg/gpg.conf
default-key A018DE8C
require-cross-certification
charset utf-8
keyserver hkp://keys.gnupg.net
use-agent

I use net-misc/keychain for gpg-agent.
Comment 5 Alon Bar-Lev (RETIRED) gentoo-dev 2013-07-27 21:53:45 UTC
I can reproduce the same, using plain gpg configuration:

$ repoman commit -m "a1"

RepoMan scours the neighborhood...
>>> Creating Manifest for /usr/local/portage/ovirt-overlay/app-admin/x1

Note: use --include-dev (-d) to check dependencies for 'dev' profiles

* 3 files being committed... 

You need a passphrase to unlock the secret key for
user: "Alon Bar-Lev <alonbl@gentoo.org>"
2048-bit DSA key, ID BF20DC51, created 2013-02-13

gpg-agent[8791]: enabled debug flags: command mpi crypto memory cache memstat hashing assuan
pinentry-curses: no LC_CTYPE known - assuming UTF-8
                                                   pinentry-curses: no LC_CTYPE known - assuming UTF-8
                                                                                                      pinentry-curses: no LC_CTYPE known - assuming UTF-8
                                                                                                                                                         pinentry-curses: no LC_CTYPE known - assuming UTF-8

However it is not repoman fault but git fault... I get the same using:

$ git commit -m "a1" --gpg-sign
Comment 6 Alon Bar-Lev (RETIRED) gentoo-dev 2013-07-27 21:59:00 UTC
The following does work:

$ GPG_TTY=$(tty) repoman commit -m "a1"
Comment 8 Zac Medico gentoo-dev 2013-07-30 07:06:41 UTC
This is fixed in 2.1.13.2 and 2.2.0_alpha191.