[Parted-maintainers] Bug#298017: parted: bashisms in *.dpatch sh scripts

Nikolaus Schulz Nikolaus Schulz <microschulz@web.de>, 298017-maintonly@bugs.debian.org
Sat, 19 Mar 2005 18:53:13 +0100


Sven Luther wrote:
> On Tue, Mar 08, 2005 at 06:33:36PM +0100, Nikolaus Schulz wrote:
> > Sven Luther wrote:
> > > On Fri, Mar 04, 2005 at 03:04:30AM +0100, Nikolaus Schulz wrote:
> > > > the patches in debian/patches are sh scripts. 
> > > > Running "checkbashisms debian/patches/*.dpatch" detects this:
> > > > 
> > > > amiga.dpatch line 8: '. $(dirname $0)/DPATCH'
> > > > chs.dpatch line 8: '. $(dirname $0)/DPATCH'

<snip>

> > Just use backticks instead of the "$()" syntax. I'm not sure if the
> > dpatch scripts are in the current directory when they're called. I doubt
> > it.
> 
> . debian/patches/DPATCH 
> 
> would do ? 

I'd keep the change as small as possible:

for FILE in debian/patches/*.dpatch
do ed -s $FILE << OK
/^\. \$(dirname \$0)/s/\$(dirname \$0)/\`dirname \$0\`/
wq
OK
done 

:-)

HTH,
Nikolaus