]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
meson: fix incorrect substitutions in configured files
authorEli Schwartz <eschwartz93@gmail.com>
Fri, 24 Dec 2021 00:14:22 +0000 (19:14 -0500)
committerEli Schwartz <eschwartz93@gmail.com>
Fri, 24 Dec 2021 00:17:19 +0000 (19:17 -0500)
The custom Makefile rules performed this substitution:

@@VAR@@ -> VAL

However, meson did this substitution:

@@VAR@@ -> @VAL@

This produced incorrect behavior, such as configuring a udev file to
read:

install_items+=" @/usr/etc/udev/rules.d@/70-nvmf-autoconnect.rules "

muon, meanwhile, failed loudly with:

/tmp/nvme-cli/nvmf-autoconnect/dracut-conf/70-nvmf-autoconnect.conf.in:1:19: error: key of zero length not supported
  1 | install_items+=" @@UDEVRULESDIR@@/70-nvmf-autoconnect.rules "
                        ^
/tmp/nvme-cli/meson.build:161:1: error: in function configure_file
161 | configure_file(
      ^

Since meson does not support custom token rules for configuring
replacements, and there is no real benefit to doubling the @@, just fix
this to use one @.

Makefile
nvme.control.in
nvme.spec.in
nvmf-autoconnect/dracut-conf/70-nvmf-autoconnect.conf.in

index 8feac778aa17dbc77eb848e9563fb25d994acbd1..4071bc5cb433ab9fa8c5c2605e9dd2e93741dec0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -222,11 +222,11 @@ install-spec: install-bin install-man install-bash-completion install-zsh-comple
 install: install-spec install-hostparams
 
 nvme.spec: nvme.spec.in NVME-VERSION-FILE
-       sed -e 's/@@VERSION@@/$(NVME_VERSION)/g' < $< > $@+
+       sed -e 's/@VERSION@/$(NVME_VERSION)/g' < $< > $@+
        mv $@+ $@
 
 70-nvmf-autoconnect.conf: nvmf-autoconnect/dracut-conf/70-nvmf-autoconnect.conf.in
-       sed -e 's#@@UDEVRULESDIR@@#$(UDEVRULESDIR)#g' < $< > $@+
+       sed -e 's#@UDEVRULESDIR@#$(UDEVRULESDIR)#g' < $< > $@+
        mv $@+ $@
 
 dist: nvme.spec
@@ -236,9 +236,9 @@ dist: nvme.spec
        gzip -f -9 nvme-$(NVME_VERSION).tar
 
 control: nvme.control.in NVME-VERSION-FILE
-       sed -e 's/@@VERSION@@/$(NVME_VERSION)/g' < $< > $@+
+       sed -e 's/@VERSION@/$(NVME_VERSION)/g' < $< > $@+
        mv $@+ $@
-       sed -e 's/@@DEPENDS@@/$(LIB_DEPENDS)/g' < $@ > $@+
+       sed -e 's/@DEPENDS@/$(LIB_DEPENDS)/g' < $@ > $@+
        mv $@+ $@
 
 pkg: control nvme.control.in
index 46714d4e60413bfd1b5482bfc17c8201053f062e..74d36aa28a63a87bdf50810945e6165167d2d6c8 100644 (file)
@@ -1,9 +1,9 @@
 Package: nvme
-Version: @@VERSION@@
+Version: @VERSION@
 Section: base
 Priority: optional
 Architecture: amd64
-Depends: @@DEPENDS@@
+Depends: @DEPENDS@
 Maintainer: Keith Busch <kbusch@kernel.org>
 Description: NVM-Express Command Line Interface
  The nvme management tool
index a8c44865fa742383496afe7259f629f54b2e5606..17129944eff5e97cb03be962135709b1ebc5ba01 100644 (file)
@@ -1,11 +1,11 @@
 Name:          nvme
-Version:       @@VERSION@@
+Version:       @VERSION@
 Release:       1%{?dist}
 Summary:       Core nvme tools
 License:       GPL
 Group:                 Development/Tools
 URL:           https://github.com/linux-nvme/nvme-cli/
-Source:        nvme-@@VERSION@@.tar.gz
+Source:        nvme-@VERSION@.tar.gz
 Provides:      nvme
 Requires(post): util-linux systemd systemd-udev
 BuildRoot:     %{_tmppath}/%{name}-%{version}-root
index b32f2c3558256e1ccd22ecc7c6b8bc03a480d854..ba9611664af2354a76aa82664c87086ef93df75c 100644 (file)
@@ -1 +1 @@
-install_items+=" @@UDEVRULESDIR@@/70-nvmf-autoconnect.rules "
+install_items+=" @UDEVRULESDIR@/70-nvmf-autoconnect.rules "