Skip to content

Add two additional format placeholders for beeversion #11

Merged
merged 1 commit into from
Aug 19, 2016

Conversation

pmenzel
Copy link
Contributor

@pmenzel pmenzel commented Aug 19, 2016

No description provided.

@donald
Copy link
Contributor

donald commented Aug 19, 2016

E adds a dash in front of the extra version, while d adds a dash.

:-)

@pmenzel pmenzel force-pushed the add-two-more-placeholders-for-beeversion branch from 6368d91 to e2c111f Compare August 19, 2016 13:06
@pmenzel
Copy link
Contributor Author

pmenzel commented Aug 19, 2016

I amended the commit description.

@donald
Copy link
Contributor

donald commented Aug 19, 2016

These are useful, as know, no additional logic has to be implemented in

:-)

@pmenzel pmenzel force-pushed the add-two-more-placeholders-for-beeversion branch from e2c111f to 9f23bb5 Compare August 19, 2016 13:17
Add *E* and *d* as placeholders to format the extra version.

Sometimes, the bee version requirement, to separate the extra version
with an underscore, contradicts the upstream versioning, which for
example uses a dash. 4.8-rc2 is the version of the second release
candidate of the Linux kernel 4.8. An underscore has to be used in the
bee file version though.

```
$ beeversion linux-4.8_rc2-95.x86_64
PKGNAME=linux
PKGEXTRANAME=
PKGEXTRANAME_UNDERSCORE=
PKGEXTRANAME_DASH=
PKGVERSION=( 4.8 4 4.8 )
PKGEXTRAVERSION=rc2
PKGEXTRAVERSION_UNDERSCORE=_rc2
PKGEXTRAVERSION_DASH=-rc2
PKGREVISION=95
PKGARCH=x86_64
PKGFULLNAME=linux
PKGFULLVERSION=4.8_rc2
PKGFULLPKG=linux-4.8_rc2-95
PKGALLPKG=linux-4.8_rc2-95.x86_64
PKGSUFFIX=
```

As can be seen, environment variables to output the extra version with a
dash (-) or with an underscore (_) are provided.

These options are missing as placeholders for the switch `format`. So,
add them.

*E* adds an underscore in front of the extra version, while *d* adds a
dash.

These are useful, as now, no additional logic has to be implemented in
scripts calling `beeversion`, to check if an extra version is present,
to determine if a separator needs to be added or not.

In case of the Linux kernel, 4.8-rc2 can be created with the switch
below.

```
> beeversion --format="%v%d" linux-4.8_rc2-95.x86_64
4.8-rc2
```
@pmenzel pmenzel force-pushed the add-two-more-placeholders-for-beeversion branch from 9f23bb5 to 8358f85 Compare August 19, 2016 13:18
@donald donald merged commit 04365dd into master Aug 19, 2016
@donald donald deleted the add-two-more-placeholders-for-beeversion branch August 24, 2016 15:10
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants