]> xenbits.xensource.com Git - libvirt.git/commit
rpm: fix incorrect expansion of macros with line continuations for args
authorDaniel P. Berrangé <berrange@redhat.com>
Tue, 20 Mar 2018 16:55:12 +0000 (16:55 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 21 Mar 2018 14:46:08 +0000 (14:46 +0000)
commit7495b1a7797df44b29201a3369adc2a42d89439e
tree66429676acf1dedcbd3a7ca5a3e031b8875deb5e
parentec34c51e9da229b8fa10a22168d334626bba2ddd
rpm: fix incorrect expansion of macros with line continuations for args

Macros in RPMs are expanded before line continuations, so when we write

   %systemd_preun foo \
                  bar

What happens is that it expands to

   if [ $1 -eq 0 ] ; then
        # Package removal, not upgrade
        systemctl --no-reload disable --now foo \ > /dev/null 2>&1 || :
   fi
                 bar

which is obviously complete garbage and not what we expected. It is
simply not safe to ever use line continuations in combination with
macros.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
libvirt.spec.in