contrib/rpm: quote snapshot/git_sha variables in spec-file

Otherwise the following fails:

    $ ./contrib/fedora/rpm/build_clean.sh -g -s x.1
    ...
    error: parse error in expression
    error: /data/src/_NetworkManager/contrib/fedora/rpm/NetworkManager.20190207-165257.XOkW4i/SPECS/NetworkManager.spec:35: bad %if condition
    ERROR: rpmbuild FAILED

Even with the fix, not all characters are allowed:

    $ ./contrib/fedora/rpm/build_clean.sh -g -s x-1
    ...
    error: line 112: Illegal char '-' (0x2d) in: Release: 22165.x-1.25b13e2053.fc29
    ERROR: rpmbuild FAILED
This commit is contained in:
Thomas Haller 2019-02-07 16:49:50 +01:00
parent db98070214
commit a0b976ac8b

View file

@ -32,10 +32,10 @@
%global _hardened_build 1
%if x%{?snapshot} != x
%if "x%{?snapshot}" != x
%global snapshot_dot .%{snapshot}
%endif
%if x%{?git_sha} != x
%if "x%{?git_sha}" != x
%global git_sha_dot .%{git_sha}
%endif