Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #235486 > unrolled thread

How to injecting user-defined fields in binary package control files

Started byNicholas Brown <nickbroon@gmail.com>
First post2021-05-24 12:40 +0200
Last post2021-05-24 12:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.debian.user


Contents

  How to injecting user-defined fields in binary package control files Nicholas Brown <nickbroon@gmail.com> - 2021-05-24 12:40 +0200

#235486 — How to injecting user-defined fields in binary package control files

FromNicholas Brown <nickbroon@gmail.com>
Date2021-05-24 12:40 +0200
SubjectHow to injecting user-defined fields in binary package control files
Message-ID<Ciga5-88n-3@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

It's possible to add user-defined fields in the debian/control file using
the `XBS-` method, as defined in the Policy Manual[1].

Something like this before calling dpkg-buildpackage will work to inject a
new field into both the Source and Binary packages. But some packages don't
contain debian/control as they generate it (kernel etc) so this is not
always reliable.
```
sed -i "0,/^\s*$/s//XBS-Git-Branch: ${CI_COMMIT_BRANCH}\n/" debian/control
dpkg-buildpackage
```

It's possible to inject the user-defined field into the generated source
package using options passed to dpkg-source[2]:
```
dpkg-buildpackage --source-option=-DGit-Branch=${CI_COMMIT_BRANCH}
```

However, that will only inject the field into the generated source package,
not the generated binary packages. Is there a method to reliably inject
fields into the binary packages?

Thanks,
Nick

  [1]:
https://www.debian.org/doc/debian-policy/ch-controlfields.html#user-defined-fields
  [2]:
https://manpages.debian.org/buster/dpkg-dev/dpkg-buildpackage.1.en.html

[toc] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web