View Single Post
  #1   (View Single Post)  
Old 18th August 2017
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,507
Default Wading through sed and re_format

I'm trying to update x11/tint2 and have the basic port almost ready to go.
Where I am hung up is that upstream has provided multiple rc configuration files that contain multiple Launcher paths; ie /usr/share/applications/tint2conf.desktop and /usr/share/applications/firefox.desktop. The 12.2 source had these in a "sample" directory which in the interim has been renamed "themes". In 12.2, @sthen added a post-intall sed command to edit all the examples

Code:
 post-install:
        cp -R ${WRKSRC}/sample/ ${PREFIX}/share/examples/tint2/
        sed -i -e '/\/usr\/local\/share\/applications/d' -e \
            's,/usr/share/applications,${LOCALBASE}/share/applications,g' \
            ${PREFIX}/share/examples/tint2/*tint2rc
        rm ${PREFIX}/share/tint2/*.tint2rc
I'm trying to wade through this
In the above code does the cp -R command stream into the sed command on the next line?
I understand -i is "inplace" and -e appends /\/usr\/local\/share\/applications/d' to the next command. I'm guessing that .../applications/d' "deletes the pattern space and starts the next cycle which then replaces /usr/share/applications with ${LOCALEBASE}/share/applications,g
Code:
 [2addr]g
             Replace the contents of the pattern space with the contents of
             the hold space.
I'm not sure why "-e" is used twice on the sed line.
So I modified the post-install command to
Code:
post-install:
       sed -i -e '/\/usr\/local\/share\/applications/d' -e \
            's,/usr/share/applications,${LOCALBASE}/share/applications,g' \
            ${PREFIX}/share/examples/tint2/*tint2rc
When I try to make fake, I get an error
***Parse Error in /usr/ports/x11/tint2: Need operator in '/share/examples/tint2/*tint2rc.

sed(1) and re_format(7) are not easy reading. Both the FreeBSD(v0.14.5) and NetBSD(v0.14.6) did not address this.

Any guidance appreciated.
Reply With Quote