On Fri, 28 Dec 2012, Martin Quinson wrote: > Ok, here is a third attempt, sorry for being so bad at bash scripting. > I know why I'm always reluctant to hack on quilt itself.
Your attempt was not so bad. My advice was not necessarily perfect either. You'd better seek reviews from the upstream quilt developers in fact. They have more experience with portable shell scripting. > > It should call it > > once only except when too many files are listed and when the list > > must be split. > > I'm not sure I got this part, unfortunately. The point of xargs is to call the command a limited number of times with as many arguments as possible. > + # xargs executes the command once even if there is no input > (--no-run-if-empty is GNU specific) > + # so only launch it if we know that there is a file to handle Again something that I did not have in mind when I recommended xargs :-( > + if [ "$(shopt -s nullglob ; echo "$QUILT_PC/$patch/"*)" != > "$QUILT_PC/$patch/.timestamp" ] So maybe you want to factor out this test to no call it twice? Cheers, -- Raphaël Hertzog ◈ Debian Developer Get the Debian Administrator's Handbook: → http://debian-handbook.info/get/ -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

