Problem with parameterized macro when an option contains '--'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

Let's take the %systemd_post macro [1] as an example of a parameterized
macro:
%systemd_post() \
if [ $1 -eq 1 ] ; then \
        # Initial installation \
        systemctl preset %{?*} >/dev/null 2>&1 || : \
fi \
%{nil}

If the macro is called with ordinary options (e.g. 'foo', 'bar'), it
works as expected:
[vagrant@localhost ~]$ rpm --eval "%systemd_post foo bar"

if [ $1 -eq 1 ] ; then 
        # Initial installation 
        systemctl preset foo bar >/dev/null 2>&1 || : 
fi

But if a user tries to pass it an option that contains '--' (e.g.
'--user'), rpm returns an error:
[vagrant@localhost ~]$ rpm --eval "%systemd_post --user foo bar"
systemd_post: invalid option -- '-'
error: Unknown option - in systemd_post()

if [ $1 -eq 1 ] ; then 
        # Initial installation 
        systemctl preset  >/dev/null 2>&1 || : 
fi

Is this a bug in rpm's parameterized macro handling or should options
containing '--' be passed in a different way?

Thanks and regards,
Tadej

P.S.: I tested this on Fedora 23 beta with
rpm-4.13.0-0.rc1.3.fc23.x86_64.

[1]
https://github.com/systemd/systemd/blob/7c67f0f/src/core/macros.systemd.in#L39

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxxxxx
http://lists.rpm.org/mailman/listinfo/rpm-list



[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux