Re: debhelper: suggestions
Joey == Joey Hess [EMAIL PROTECTED] writes: Joey expr `dpkg-parsechangelog` : '.*Version: \(.*\).*\nDistribution:' I can't get that to work. I have much better luck with `gawk'. -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .
Re: debhelper: suggestions
Joey == Joey Hess [EMAIL PROTECTED] writes: Karl Also, to put a version string into a program, I use: VERSION=$(shell dpkg-parsechangelog 2/dev/null \ | gawk -F: \ '$$1 ~ /Version/ {version = gensub(/^ */,,g,$$2)} \ END {printf(%s_SPI, version) }') Joey I've definitly considered adding version testing to Joey debhelper. Thanks for the shell fragmenet. I considered Joey making a dh_checkver, that takes a version number, and Joey returns 1 if the current version is older - that's let Joey debian/rules files abort with outdated versions of Joey debhelper. What do you think of that idea? Ok... I thought that the `auto-debhelper' idea was good. m4 is very powerful. It would allow more sophisticated automatic script building. Thing is, do we need that? How often is there a package that would even use it? YTMAWBN[1], I'm a beginner. Karl build-stamp: dh_testdir $(MAKE) VERSION=$(VERSION) touch Karl build-stamp Karl ... and then I use the VERSION in the C like this: void printCopyright (void) { fprintf (stderr, tmpreaper -- Version: VERSION \n (c) 1997 Software in the Public Interest\n This may be freely redistributed under the terms of the GNU Public License.\n); } // 1 2 3 4 5 6 7 8 // 02345678901234567890123456789012345678901234567890123456789012345678901234567890 Joey Hang on, maybe I'm missing something - is the version Joey debhelper's version, or the version of your package? The version of the package. Note that I use `dpkg-parsechangelog', rather than the simpler: LINE=$(head -1 changelog) VERSION=$(expr $LINE : '.* (\(.*\))') ... since I thought that the reason for using `dpkg-parsechangelog' was so folks could experiment with alternative changelog formats. Is anyone doing that? Footnotes: [1] You Tell Me And We'll Both Know -- mailto:[EMAIL PROTECTED] (Karl M. Hegbloom) http://www.inetarena.com/~karlheg Portland, OR USA Debian GNU 1.3.1+hamm Linux 2.0.32 AMD K5 PR-133 -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .
Re: debhelper: suggestions
Karl M. Hegbloom wrote: Note that I use `dpkg-parsechangelog', rather than the simpler: LINE=$(head -1 changelog) VERSION=$(expr $LINE : '.* (\(.*\))') ... since I thought that the reason for using `dpkg-parsechangelog' was so folks could experiment with alternative changelog formats. Ah, I'll have to modify debhelper to use that. Good point. -- see shy jo -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .
Re: debhelper: suggestions
Joey == Joey Hess [EMAIL PROTECTED] writes: Joey Karl M. Hegbloom wrote: Note that I use `dpkg-parsechangelog', rather than the simpler: LINE=$(head -1 changelog) VERSION=$(expr $LINE : '.* (\(.*\))') ... since I thought that the reason for using `dpkg-parsechangelog' was so folks could experiment with alternative changelog formats. Joey Ah, I'll have to modify debhelper to use that. Good point. Well, I'm glad you wrote it the way you did. I've just begun to learn how shell scripts are written and that's the first time I'd encountered that use of `expr'. I learned from it. -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .
Re: debhelper: suggestions
Karl M. Hegbloom wrote: Well, I'm glad you wrote it the way you did. I've just begun to learn how shell scripts are written and that's the first time I'd encountered that use of `expr'. I learned from it. Same here, I stole that bit from debstd. ;-) However, on second thought, using dpkg-parsechangelog is unappetising. Not only does it print out this annoying error message, but it takes a about a second to run. (on a p166) [EMAIL PROTECTED]:~/debian/build/debhelper-0.35time dpkg-parsechangelog /dev/null no utmp entry available, using value of LOGNAME (joey) at Since debian/rules files that use debhelper typically cal about 20 d_* programs in a package build, that's about half a minute added to the build, along with an appalling amount of ugly messages. I don't know... it's the right thing to do, but it's so ugly... -- see shy jo -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .
Re: debhelper: suggestions
Joey == Joey Hess [EMAIL PROTECTED] writes: Joey However, on second thought, using dpkg-parsechangelog is Joey unappetising. Not only does it print out this annoying error Joey message, but it takes a about a second to run. (on a p166) Joey Since debian/rules files that use debhelper typically cal Joey about 20 d_* programs in a package build, that's about half Joey a minute added to the build, along with an appalling amount Joey of ugly messages. I don't know... it's the right thing to Joey do, but it's so ugly... Maybe you could do it once, in the rules file: export PKG_VERSION=$(shell dh_parseversion) ... and then use it from the environment. I don't know what to do about that error mess. Is it on stdout or stderr? Perhaps you could have `dh_parseversion' elide it with redirections... piping through `gawk' and only grabbing what you need seems to work. I don't know if `expr' is a simpler way yet. Hmmm. Does it handle the newlines? -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .
Re: debhelper: suggestions
Karl M. Hegbloom wrote: Maybe you could do it once, in the rules file: export PKG_VERSION=$(shell dh_parseversion) ... and then use it from the environment. I don't want the dh_* to be dependant on the particular debian/rules they are in. They should be able to be added, singly, to rules files, without any other bother. I don't know what to do about that error mess. It's a bug, anyway. However, it can just be directed to /dev/null (it's stderr). Is it on stdout or stderr? Perhaps you could have `dh_parseversion' elide it with redirections... piping through `gawk' and only grabbing what you need seems to work. I don't know if `expr' is a simpler way yet. Hmmm. Does it handle the newlines? Yes: expr `dpkg-parsechangelog` : '.*Version: \(.*\).*\nDistribution:' -- see shy jo -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .
Re: debhelper: suggestions
Karl M. Hegbloom wrote: I find that if you put: .EXPORT_ALL_VARIABLES: ... into debian/rules, the DH_VERBOSE=1 starts to function. Thats unnecessary, you only need to export DH_VERBOSE. The example rules files that come with debhelper do it this way: #export DH_VERBOSE=1 Also, to put a version string into a program, I use: VERSION=$(shell dpkg-parsechangelog 2/dev/null \ | gawk -F: \ '$$1 ~ /Version/{version= gensub(/^ */,,g,$$2)} \ END { printf(%s_SPI, version) }') I've definitly considered adding version testing to debhelper. Thanks for the shell fragmenet. I considered making a dh_checkver, that takes a version number, and returns 1 if the current version is older - that's let debian/rules files abort with outdated versions of debhelper. What do you think of that idea? build-stamp: dh_testdir $(MAKE) VERSION=$(VERSION) touch build-stamp ... and then I use the VERSION in the C like this: ... Hang on, maybe I'm missing something - is the version debhelper's version, or the version of your package? -- see shy jo -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .