[Rpm-maint] [PATCH 4/5] Optimize readLine routine
Alexey Tourbin
alexey.tourbin at gmail.com
Thu Feb 7 05:01:01 UTC 2013
On Thu, Feb 07, 2013 at 04:36:42AM +0000, Alexey Tourbin wrote:
> Update2: it is not clear whether the backslash in "\%{foo}" should
> somehow "escape" the balancing check, as it does now. Anyway, this case
> is still subject for macro expansion.
>
> (So I updatd the change on github, here's the relevant part:)
> case '\\':
> switch (*(p+1)) {
> - case '\n': p++, nc = 1; break;
> + case '\n': p++, nc = 1; set = "\\\n%{}()"; break;
> case '\0': break;
> + case '%': needExpand = 1; break;
> default: p++; break;
And so the change actually reinstalls balancing check in for \%{foo}.
Interestingly, there's a specfile which attempts to escape a fully
bracketed macro.
sssd.spec:
290 for man in `find $RPM_BUILD_ROOT/%{_mandir}/??/man?/ -type f | sed -e "s#$RPM_BUILD_ROOT/%{_mandir}/##"`
291 do
292 lang=`echo $man | cut -c 1-2`
293 case `basename $man` in
294 sss_*)
295 echo \%lang\(${lang}\) \%{_mandir}/${man}\* >> sssd_tools.lang
296 ;;
297 sssd_krb5_*)
298 echo \%lang\(${lang}\) \%{_mandir}/${man}\* >> sssd_client.lang
299 ;;
300 pam_sss*)
301 echo \%lang\(${lang}\) \%{_mandir}/${man}\* >> sssd_client.lang
302 ;;
303 sssd_krb5_locator_plugin*)
304 echo \%lang\(${lang}\) \%{_mandir}/${man}\* >> sssd_client.lang
305 ;;
306 *)
307 echo \%lang\(${lang}\) \%{_mandir}/${man}\* >> sssd.lang
308 ;;
309 esac
310 done
It looks like the guy thinks that \%lang would prevent rpm from attempting
to expand %lang, much like %%lang. In reality, the macros are expanded,
and backslashes are eaten by the shell.
$ echo \%lang \/usr/share/man
%lang /usr/share/man
$
More information about the Rpm-maint
mailing list