Patch Set 1:

Patch Set 1:

This is certainly functional, but I think that the version strings spit out don't make sense for libflashrom. They include letters and are not monotonically increasing, even at tagged releases. So I think some sed magic is going to be needed to make it useful.

Understood, and I agree. But it's unrelated to this patch. This patch
changes the version of `project('flashromutils'...` it doesn't say
libflashrom. If libflashrom/pkg-config needs special handling, that
should be treated separately (I don't know how). If need be, I would
agree to remove the v prefix from releases. But versions between the
releases just don't have numbers...

Well further down in meson.build it pulls that number for pkg-config.

 version : meson.project_version(),

So I think some sanitization needs to happen rather than just picking that up. I would propose something like dropping the prefix and if there is a '-' sed everything from that into a .999

Here is the code to make that happen:

```
diff --git a/meson.build b/meson.build
index b475f64..0af6047 100644
--- a/meson.build
+++ b/meson.build
@@ -349,10 +349,19 @@ flashrom = shared_library(
link_depends : mapfile,
)

+version = meson.project_version()
+if version.startswith('v')
+ version = version.split('v')[1]
+endif
+if version.contains ('-')
+ version = version.split('-')[0] + '.999'
+endif
+message(version)
+
pkgg = import('pkgconfig')
pkgg.generate(
libraries : flashrom,
- version : meson.project_version(),
+ version : version,
name : 'libflashrom',
filebase : 'libflashrom',
description : 'libflashrom',

```

View Change

To view, visit change 35561. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I401e5638509c4a573bc0cb17ebc5fa76df9700b5
Gerrit-Change-Number: 35561
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: Jacob Garber <jgarber1@ualberta.ca>
Gerrit-Reviewer: Mario Limonciello <superm1@gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-Comment-Date: Tue, 24 Sep 2019 20:11:55 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment