Skip to main content

yet another library of debsign

Project description

Status

https://secure.travis-ci.org/mkouhei/pydebsign.png?branch=devel https://coveralls.io/repos/mkouhei/pydebsign/badge.png?branch=devel https://pypip.in/v/pydebsign/badge.png

Motivation

debsign is a command of devscripts that sign a Debian .changes and .dsc file pare using GPG, the command cannot use in environment witout TTY, for example invokeking by CI.

I had tried to use debsign from subprocess module of Python as follow, but entering passphrase prompt is always returned. It was the same in the case of using gnupg-agent and keyring.:

>>> import subprocess
>>> import shlex
>>> command = '/usr/bin/debsign -k %s %s' % (`keyid`, `.changes`)'
>>> process = subprocess.Popen(shlex.split(command),
...                            stdin=subprocess.PIPE,
...                            stdout=subprocess.PIPE,
...                            stderr=subprocess.PIPE)
>>> stdout, stderr = process.communicate('%s\n%s\n') % (`passphrase`, `passphrase`)

So, I decided to make a python library to do the same behavior debsign.

Goal

  • It is enable to sign .changes and .dsc files with GPG without the input of interactive passphrase.

  • It can also be used by a user can not login shell on the CI, such as Jenkins.

Requires

  • Debian system, or the system derived from Debian.

  • Debian package as follows;

    • gnupg

    • dput

    • lintian

    • python (= python2.7) or python3

  • Python packages as follows;

    • python_gnupg (as debian package is python-gnupg or python3-gnupg)

    • python_debian (as debian package is python-debian or python3-debian)

    • chardet (as debian package is python-chardet or python3-chardet)

Usage

Generic usage;:

>>> from pydebsign import debsign
>>> debsign.debsign_process('/path/to/some.changes', passphrase='secretkey')

When use another GPG Keyring instead of default GPG keyring;:

>>> from pydebsign import debsign
>>> debsign.debsign_process('/path/to/some.changes', passphrase='secretkey',
...                         keyid='keyid', gnupghome='/path/to/gpghome')

History

0.1.0 (2014-05-26)

  • Initial release

TODO

  • Adding command line interface.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydebsign-0.1.0.tar.gz (27.0 kB view details)

Uploaded Source

File details

Details for the file pydebsign-0.1.0.tar.gz.

File metadata

  • Download URL: pydebsign-0.1.0.tar.gz
  • Upload date:
  • Size: 27.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pydebsign-0.1.0.tar.gz
Algorithm Hash digest
SHA256 aa9e8bf7218073c7083957a008769a6ffc4e76b51a31662bb66f326a8986b039
MD5 23fc031af050e61193537a910a8cdbf5
BLAKE2b-256 a728a899c94be1ed77187374b4eac040d5a1d69a1b5d841949fe2daf2b86bf9a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page