Skip to content

Add two additional format placeholders for beeversion #11

Merged
merged 1 commit into from
Aug 19, 2016

Commits on Aug 19, 2016

  1. beeversion: Add two additional format placeholders

    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 committed Aug 19, 2016
    Configuration menu
    Copy the full SHA
    8358f85 View commit details
    Browse the repository at this point in the history