[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: debhelper: suggestions



>>>>> "Joey" == Joey Hess <joey@kitenet.net> 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:karlheg@bittersweet.inetarena.com (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
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: