[Bug 1091659] Review Request: iwyu - #include analysis tool

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

 



https://bugzilla.redhat.com/show_bug.cgi?id=1091659



--- Comment #24 from Michael Schwendt (Fedora Packager Sponsors Group) <bugs.michael@xxxxxxx> ---
FWIW, note that sed substitutions would fail without causing an error.

I would not worry much about inserting an unexpanded '#!%{__python2})' into the
script, because that would break the shebang and result in an unresolvable
auto-dependency in the package. It would only be bad, if nobody would notice
that in the built packages. And if %__python2 were undefined, the %check
section would fail as it also uses %__python.

However:

Generally, when using sed substitutions, it is a good recommendation to add
guards to the spec file, which protect against sed failing to match. Either
before or after running sed. While applying a patch file would error out, if it
doesn't apply anymore, a failing sed match would cause the substitution not to
be applied. In this particular case, if the script contained anything different
from '#!/usr/bin/python\b' in line 1, e.g. /usr/bin/env something, it would not
be substituted. A guard would run "grep" on the file and ensure that the sed
match will be successful, e.g. an explicit "grep -m 1 '^#!/usr/bin/python\b' ||
exit -1" would add safety for this particular case.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are always notified about changes to this product and component
_______________________________________________
package-review mailing list
package-review@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/package-review





[Index of Archives]     [Fedora Legacy]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]