Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 168253 - app-arch/rpm2targz is incompatible with fbsd's sh
Summary: app-arch/rpm2targz is incompatible with fbsd's sh
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: FreeBSD (show other bugs)
Hardware: x86 FreeBSD
: High normal
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-24 18:26 UTC by Emanuele A. Bagnaschi (Zephyrus)
Modified: 2007-06-18 11:53 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Emanuele A. Bagnaschi (Zephyrus) 2007-02-24 18:26:36 UTC
There are two lines in the rpm2targz script which cause errors on g/fbsd due to their incompatibility with fbsd's sh:

1] line 26 -> [ "$TMPDIR" == "" ] && TMPDIR=/tmp

   The correct expression, compatibile with the sh syntax, is with only one 
   equal sign, so:
   [ "$TMPDIR" = "" ] && TMPDIR=/tmp

2] line 91 -> if echo ${PAYLOADHEAD} | grep -e $'^\037\213' > /dev/null ; then

   This line fails due to the fact that the $'' construct is unsupported, as
   noted by exg, and therefore grep interprets \037 and \213 as backward
   expressions, instead of the considering the respective non-printable
   characters (which are the magic bytes of the gzip format).
   A possibile solution could be to filter PAYLOADHEAD trough `od -c` and then
   simply: grep -e '037.213'

However as Flameeyes noted, the most simple (yet effective) solution is to use bash instead of sh to parse the script.

Reproducible: Always

Steps to Reproduce:
Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2007-06-18 11:53:57 UTC
I have committed the fix; as with the new baselayout we might have more people having /bin/sh not linked to bash, I've followed exg's suggestion and used od -c.