0

There is a simple control file:

Source: my-package
Section: non-free
Priority: extra
Maintainer: Some one <someone@gmail.com>
Uploaders: Some one <someone@gmail.com>
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

  • I do not understand the question: you have the initial file, you know how to format the final file, so it is just to read control file and write a new version with your modifications, right? Most programming languages can do it. So, I do not understand the problem? [This site is for programmers, so I assume you know the basic of programming] – Giacomo Catenazzi Feb 23 '22 at 15:52
  • I search for some tool that dedicated to Debian's control file modification – Barel Elbaz Feb 23 '22 at 16:30
  • I know I can do it using regex or just splitting and some conditions but I want a conventional way to do it (This file is processed by debian system after all - debian understands it's format) – Barel Elbaz Feb 23 '22 at 16:34
  • I do not know if there are tools. The file is supposed to be edited by humans, and by Debian design, the dependencies should be as wide as possible. I think there are other ways to require specific version, done when you create the temporary environment for building the package. – Giacomo Catenazzi Feb 24 '22 at 08:19

0 Answers0