Bug 176009

Summary: Syntax error in xorg-x11-xfs postinstall script
Product: [Fedora] Fedora Reporter: Ville Skyttä <scop>
Component: xorg-x11-xfsAssignee: X/OpenGL Maintenance List <xgl-maint>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 1.0.0-2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-01-10 20:45:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ville Skyttä 2005-12-17 10:39:06 UTC
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

...you meant:

   perl -p -i -e 's#^.*/.*/Speedo.*\n##' $XFSCONFIG

...or:

   sed -i -e '\#^.*/.*/Speedo.*#d' $XFSCONFIG

Comment 1 Mike A. Harris 2005-12-21 12:36:07 UTC
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)

Comment 2 Ville Skyttä 2005-12-21 16:28:44 UTC
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.

Comment 3 Bill Nottingham 2006-01-10 20:45:40 UTC
Fixed in 1.0.0-2, with the suggested perl correction above.