How can I modify Debian control file build depends version?

356 Views Asked by At

There is a simple control file:

Source: my-package
Section: non-free
Priority: extra
Maintainer: Some one <[email protected]>
Uploaders: Some one <[email protected]>
Build-Depends: dh-autoreconf, pkg-config, debhelper, autotools-dev, dh-buildinfo,
 dh-systemd,
 packageA (>= 1.42),
 libpackage-dev (>= 1.5-32), libpackage-dev (<= 1.5-999),

Standards-Version: 1.0.0
Homepage: http://www.google.com

Package: my-package
Section: non-free
Architecture: any
Depends: lib-bla
Description: my awesome package

also, I have a Map<> that contains: package : version

I need to modify this file's Build-Depends property (Via groovy/Jenkins/shell) and replace each build dependency that doesn't contains version restriction at all (For example pkg-config) to contain a specific version: (= 1.0)

the version should be taken from the Map

file after modification should be like:

..
..
Build-Depends: dh-autoreconf (= 1.0), pkg-config (= 2.0-10), debhelper(= 10.0-9), 
  autotools-dev (= 7.2.3-1), dh-buildinfo(= 3.0),
..
..

In the bottom line, need some way to iterate over the Build-Depends check if contains version restriction, if no, put the version from the Map

Any idea? I can do it using text processing method but I search for more official way to mess with Debian's control file modification

0

There are 0 best solutions below