Config...l::Dpkg(3pm)
πΈ Config::Model::Dpkg πΈ
okay bestie, so this is a page from the User Contributed Perl Documentation, and it's about a Perl module called Config::Model::Dpkg β the 3pm girlie of the Config::Model family π
. Think of it as a whole toolkit for poking at Debian source package files, but make it glamorous. Let's get into it π«Ά
β¨ NAME β¨
Config::Model::Dpkg β Edit and validate Dpkg source files π
π SYNOPSIS π
π» invoke editor
okay so, hear me out: this command has to be run inside a package source directory. When you run it, cme is gonna load basically most of the files from the debian directory and then pop open a graphical editor for you. iconic behaviour honestly π
cme edit dpkg
Or, if you're feeling selective, you can choose to edit only debian/control or debian/copyright:
cme edit dpkg-control
cme edit dpkg-copyright
Or β and this is the multitasking queen move β edit debian patches headers, all at once:
cme edit dpkg-patches # note patches with 'es'
Or one single patch at a time, main character energy:
cme edit dpkg-patch debian/patches/foo
You can also specify a patch by just using the patch name, no path needed:
cme edit dpkg-patch foo
π§ Just check dpkg files
You can also use cme to run sanity checks on the source files, no editing, just vibes and judgement:
cme check dpkg
π§ Fix warnings
When it runs, cme may issue several warnings regarding the content of your file. Not to worry bestie π
you can choose to fix (most of) these warnings with the command:
cme fix dpkg
π check and arbitrary file
You can specify another file to check too:
cme check dpkg-copyright foobar
β οΈ just so you know: this applies only todpkg-control,dpkg-copyrightordpkg-patch. No sneaking it in anywhere else, okay?
π§ programmatic
This code snippet will change the maintainer address in control file β yes, programmatically, we're that girl:
use Config::Model ;
use Log::Log4perl qw(:easy) ;
my $model = Config::Model -> new ( ) ;
my $inst = $model->instance (root_class_name => 'Dpkg');
$inst -> config_root ->load("control source Maintainer=foo@bedian.arg") ;
$inst->write_back() ;
π DESCRIPTION π
This module provides a configuration editor (and models) for the files of a Debian source package. (i.e. most of the files contained in the debian directory of a source package). It's giving "I know every file in here personally" π
This module can also be used to modify safely the content of these files from a Perl programs. yep, safely. no cap.
π₯οΈ user interfaces
As mentioned in cme, several user interfaces are available:
- A graphical interface is proposed by default if
Config::Model::TkUIis installed. β¨ default slay - A Fuse virtual file system with option
cme fusefs dpkg -fuse_dir <mountpoint>if Fuse is installed (Linux only). lowkey niche but we love her
π¦ package dependency checks
Package dependencies are checked on several points:
- Whether the package is available in Debian (from sid to old-stable)
- If the package is a known virtual package. Known means listed in Debian packaging manual or known by the author. Feel free to log a bug against
libconfig-model-dpkg-perlif a virtual package is missing. But please don't log a bug if the virtual package is used only during a transition. π (we're being nice about it okay) - If a package older that the required version are available in Debian (from sid to old-stable). If not,
cmewill offer you the possibility to clean up the versioned dependency withcme fix dpkgcommand. - The syntax of the dependency (including version requirement and arch specification). grammar check but for deps π
- Consistency of alternate dependency for Perl libraries
heads up bestie: These checks only generate warnings. Most of these checks can be fixed with cme fix dpkg command.
π Examples π
π¦ Migrate old package file
Most of old syntax can be automatically migrated to newer parameters with:
cme migrate dpkg
This migration can be limited to control or copyright files:
cme migrate dpkg-control
cme migrate dpkg-copyright
Restore GPL summary to default value (factory reset but make it legal):
cme modify dpkg-copyright ~~ 'License:GPL text~'
Dump copyright file content in a format usable with cme modify:
$ cme dump dpkg-copyright
Comment="Native package. This package is a spin-off from
libconfig-model-perl. Upstream (who is also the debian packager)
decided to create a Debian native package for the Debian specific
parts of Config::Model"
Files:"*"
Copyright="2005-2013, Dominique Dumont <dod@debian.org>"
License
short_name=LGPL-2.1+ - -
License:LGPL-2.1+
text=" This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.
On Debian GNU/Linux systems, the complete text of version 2.1 of the GNU
Lesser General Public License can be found in `/usr/share/common-licenses/LGPL-2.1'" - -
βοΈ modify a value with the command line:
cme modify dpkg-copyright ~~ 'Comment="Modified with cme"'
Or apply more systematic changes. This example updates copyright years for all Files entries in debian/copyright:
cme modify dpkg-copyright ~~ 'Files:~/./ Copyright=~"s/2013/2014/"'
π remove an uploader from control files
cme modify dpkg control source Uploaders:-~/johndoe/
or
cme modify dpkg-control ~~ source Uploaders:-~/dod/
If you want to remove a guy named Ian, you'll have to be a little more specific to avoid removing all debian developers. (yes really, the regex will sweep everyone, be careful bestie π«£)
cme modify dpkg-control ~~ source Uploaders:-="Ian Smith<iansmith@debian.org>"
π«Ά add a new uploader
The quotes are required otherwise bash will complain. (bash is dramatic like that π) These 2 commands give the same results:
cme modify dpkg-control ~~ 'source Uploaders:<"John Doe<johndoe@foo.com>"'
cme modify dpkg-control ~~ 'source Uploaders:.push("John Doe<johndoe@foo.com>")'
Add an uploader to a sorted list of Uploaders (yes, insort, with a 'o', not insert with a 'e' β I know, I know, but that's literally the name π
):
cme modify dpkg-control ~~ 'source Uploaders:.insort("John Doe<johndoe@foo.com>")'
The above command make sense only if the list is sorted. Let's sort the list of uploaders:
cme modify dpkg-control ~~ 'source Uploaders:@'
cme modify dpkg-control ~~ 'source Uploaders:.sort'
The 2 commands can be combined:
cme modify dpkg-control ~~ 'source Uploaders:.sort Uploaders:.insort("John Doe<johndoe@foo.com>")'
The modify command of cme uses the syntax defined by Config::Model::Loader. See "load string syntax" in Config::Model::Loader π§
π BUGS π
Config::Model design does not really cope well with some details of Debian patch header specification http://dep.debian.net/deps/dep3/ (aka DEP-3). not me exposing the messy parts of the design π
Description and subject are both authorized, but only one of them is required and using the 2 is forbidden. So, both fields are accepted, but subject is stored as description in the configuration tree. cme fix or cme edit will write back a description field. periodt.
π CONTRIBUTORS π
In alphabetical order:
Andrej Shadura
Axel Beckert
Bas Couwenberg
Cyrille Bollu
Gregor Herrmann
Guillem Jover
Josh Triplett
Paul Wise
Ross Vandegrift
Salvatore Bonaccorso
Victor Westerhuis
Walter Lozano
Xavier Guimard
Many thanks to all. absolute legends, every single one π
π AUTHOR π
Dominique Dumont, (dod at debian dot org)
π SEE ALSO π
- cme
Config::Modelhttp://github.com/dod38fr/config-model/wiki/Using-config-model
and that's the whole page bestie π
this lil doc is perl v5.42.3, dated 2026-08-30, and it lives under Config...l::Dpkg(3pm) in the User Contributed Perl Documentation. go forth and validate your dpkg files, you've got this πβ¨π¦
π¦ where this page comes from
- ubuntu stonking: libconfig-model-dpkg-perl 3.026 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms