From a0b976ac8b9545612e97eac1d2baeea56b3fa6d2 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 7 Feb 2019 16:49:50 +0100 Subject: [PATCH] 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 --- contrib/fedora/rpm/NetworkManager.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec index 96691c25ee..aa19505564 100644 --- a/contrib/fedora/rpm/NetworkManager.spec +++ b/contrib/fedora/rpm/NetworkManager.spec @@ -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