Comments

I don't mind others rewriting my code, though you have to realize that for such type of shell script code, I don't really care if it's written the most efficient or nice or whatever. I just care it does what I need. It will be run by me only, and I'll be the one who will see if there is a problem with it or not.

I've very often seen others not liking the "cut" utility. I never understood why. It's small, fast, and easy to understand.

Now, why at all, is my version of DEBIAN_BRANCH thing not correct? I don't get it... My version does what it is supposed to do, and always worked!

Comment by
Guillem Jovercomment 1
The same thing applies to sed: any command written with sed together with grep, cut, and various other tools can often become a more straightforward and efficient command with sed alone.
Comment by
Anonymous
comment 1

@Thomas: Sure, I quite agree, the most important thing to optimize for is developer time IMHO, so spending inordinate amount of time to rewrite things for minimal gain is not worthwhile. Please allow me to indulge in a bit of golf non the less.

The original DEBIAN_BRANCH will go wrong if someone has put a comment after the branch name in the gbp.conf file, on the same line.

@i5513: I'm not arguing that awk is more efficient than sed (so, my DEBVERS rewrite is not much better), but one awk instance is better than a chain of sed/grep/awk/cut.

@Guillem: I thought I remember seeing that somewhere, but couldn't find it in my local dpkg-parsechangelog. Thanks!

@barmic: Thanks for the simplification! "shell" is needed to convince Make to run a command, although you could use backticks instead.