Skip to content

Commit

Permalink
Add support for Deb-o-Matic binnmu command
Browse files Browse the repository at this point in the history
  • Loading branch information
dktrkranz committed Feb 13, 2015
1 parent 2167ea2 commit 2e7a465
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
4 changes: 4 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
dput-ng (1.9) UNRELEASED; urgency=medium

[ Sebastian Ramacher ]
* Remove obsolete conffile /etc/dput.d/profiles/backports.json. Thanks to
Jakub Wilk for spotting the obsolete conffile.

[ Luca Falavigna ]
* Add support for Deb-o-Matic binnmu command.

-- Sebastian Ramacher <sramacher@debian.org> Sat, 08 Nov 2014 23:17:44 +0100

dput-ng (1.8) unstable; urgency=low
Expand Down
49 changes: 49 additions & 0 deletions dput/commands/contrib/debomatic.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,55 @@
class DebomaticCommandError(DcutError):
pass

class BinNMUCommand(AbstractCommand):
def __init__(self, interface):
super(BinNMUCommand, self).__init__(interface)
self.cmd_name = "debomatic-binnmu"
self.cmd_purpose = ("generate a binNMU upload with Deb-o-Matic")

def generate_commands_name(self, profile):
return generate_debianqueued_commands_name(profile)

def register(self, parser, **kwargs):
parser.add_argument('-s', '--source', metavar="SOURCE", action='store',
default=None, help="source pacakge to rebuild. ",
required=True)
parser.add_argument('-v', '--version', metavar="VERSION",
action='store', default=None, help="version of "
"the source package to rebuild. ", required=True)
parser.add_argument('-d', '--distribution', metavar="DISTRIBUTION",
action='store', default=None, help="distribution "
"which rebuild the package for. ", required=True)
parser.add_argument('-b', '--binnmu-version', metavar="PACKAGES",
action='store', default=None,
help="binNMU version", required=True)
parser.add_argument('-c', '--changelog', metavar="PACKAGES",
action='store', default=None,
help="binNMU changelog entry", required=True)
parser.add_argument('-m', '--maintainer', metavar="MAINTAINER",
action='store', default=None, help="contact to be "
"listed in the Maintainer field. ", required=True)

def produce(self, fh, args):
fh.write("Commands:\n")
fh.write(" binnmu %s_%s %s %s \"%s\" %s\n" % (args.source,
args.version,
args.distribution,
args.binnmu_version,
args.changelog,
args.maintainer))

def validate(self, args):
profile = load_profile(args.host)
if (not 'allow_debomatic_commands' in profile
or not profile['allow_debomatic_commands']):
raise DebomaticCommandError(
"Deb-o-Matic commands not supported for this profile"
)

def name_and_purpose(self):
return (self.cmd_name, self.cmd_purpose)

class BuilddepCommand(AbstractCommand):
def __init__(self, interface):
super(BuilddepCommand, self).__init__(interface)
Expand Down
4 changes: 4 additions & 0 deletions skel/commands/debomatic-binnmu.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"description": "Deb-o-Matic binnmu command",
"path": "dput.commands.contrib.debomatic.BinNMUCommand"
}
1 change: 1 addition & 0 deletions skel/metas/debomatic.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"suite-mismatch"
],
"valid_commands": [
"debomatic-binnmu",
"debomatic-builddep",
"debomatic-porter",
"debomatic-rebuild",
Expand Down

0 comments on commit 2e7a465

Please sign in to comment.