Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
25
rated 0 times [  25] [ 0]  / answers: 1 / hits: 10144  / 2 Years ago, wed, december 1, 2021, 12:11:15

What's the most robust way to parse a source package's debian/changelog file (or debian/control?) to get the package's version number? Something like:



pkgver=$(dpkg-parsechangelog | magic_goes_here)


I want to extract the version number (and only the version number) so that I can manipulate it in a script.



I was expecting to find a dpkg-* utility for this purpose, but I haven't found one yet.


More From » packaging

 Answers
7

If you have version 1.17.0 or later, you can use



dpkg-parsechangelog --show-field Version


No need to process the output further then. This version is currently (February 2014) available in Debian Testing.


[#29942] Thursday, December 2, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
vigorousom

Total Points: 394
Total Questions: 96
Total Answers: 110

Location: Pitcairn Islands
Member since Fri, Oct 15, 2021
3 Years ago
;