[mythtv] Ticket #7010: ./cpsvndir causes errors with checkinstall for themes

David Engel david at istwok.net
Tue Sep 8 05:07:57 UTC 2009

On Mon, Sep 07, 2009 at 09:24:52PM -0400, Michael T. Dean wrote:
> On 09/07/2009 08:43 PM, MythTV wrote:
> > What /bin/sh are you using?
> David, this is just a guess (as I don't use *buntu nor dash), but
> I'm pretty certain Ubuntu is using dash as its default shell.
> I'm also pretty certain that the problem is all the bashisms in the
> current script.
> the
> IFS=$'\012'
> is a bashism, that should be
> IFS='
> '
> (where you put a single newline between the ticks) as long as we
> have #!/bin/sh at the top of the file.

It looks like dash, at least the Debian/sid version I have accepts
either format.

> Also, $(<command>) is a bashism that should be, i.e.:
> for directory in `find "$1" -path '*/.svn' -prune -or -type d -print`; do
> (though I think that one works on dash).

I know $(command) is definitely standard POSIX.  Furthermore, dash
accepts it so this isn't it.

> Unfortunately, I don't know how to do the bash regexp-type stuff:
> ${1##*/}
> without bash.  I think these are causing some problems on dash.

That's standard POSIX, too.  dash also accepts it.

> If you open up the file in a vim with a sh syntax file and
> highlighting enabled, you'll see all the bashism's (or, at least,
> non-standard sh syntax) marked in "error" color (red on mine).

The culprit is the ${var/#Pattern/Replacement} replacement.  Unless
someone comes up with a better way, I'm inclined to implement the
nuclear option.  That is to do a simple "cp -r" followed by a find to
delete any and all .svn directories under the destination.

Actually, I think I might have a better way, but I'm not going to work
on it anymore until tomorrow.

David Engel
david at istwok.net

More information about the mythtv-dev mailing list