Red Hat Bugzilla – Bug 176009
Syntax error in xorg-x11-xfs postinstall script
Last modified: 2007-11-30 17:11:19 EST
Upgrading xorg-x11-xfs to 1.0.0-1 outputs:
syntax error at -e line 1, at EOF
Execution of -e aborted due to compilation errors.
There seems to be at least one broken perl inline substitution, maybe instead of:
perl -p -i -e '\#^.*/.*/Speedo.*#d' $XFSCONFIG
perl -p -i -e 's#^.*/.*/Speedo.*\n##' $XFSCONFIG
sed -i -e '\#^.*/.*/Speedo.*#d' $XFSCONFIG
Thanks for the report...
I noticed I used "sed -ie" in rpm scripts, which is nonportable to older
versions of sed. That wont affect new OS installs, as the new OS comes
with a sed that is compatible with the -i option. It should also at least
theoretically work also on OS upgrades done via anaconda, at least as long
as a compatible version of sed is installed prior to the script being
ran. yum based upgrades from one OS release to the next however will not
work if the old OS release has a version of sed which does not support -i,
this will fail.
Doh! I bet a lot of our packages now use sed -i too. While there are
likely not many users who would perform such corner case upgrades, I
decided to use perl instead and avoid the issue altogether as perl has
to be installed on any modern OS install already anyway due to various
heavy usage of perl, plus other X scripts use it already. Unfortunately,
I made a bad assumption that the sed syntax I had used would also work
with perl. Should have tested that first I guess. ;o)
I'll fix that in the next xfs update, and test it this time too. :o)
I have personally nothing against perl, but mileages vary and some others might ;)
Anyway, in case you wish to use sed and the -i flag sometime, that functionality
is available in sed >= 3.95 which in terms of distro versions corresponds to RHL
>= 9 (and obviously all FC versions) and RHEL >= 3.
Fixed in 1.0.0-2, with the suggested perl correction above.