On Wed, Apr 13, 2005 at 06:41:05PM +0200, martin f krafft wrote: > Package: devscripts > Version: 2.8.14 > Severity: wishlist > > Many tools, like debc/debi, debsign, and others have to parse > debian/changelog to get the name of the changes file to use. The > attached file (dpkg-changesfile) could be added to devscripts and > hopefully serve as the basis for these tools to adopt a unified > approach. I considered using perl but found it to be overkill for > this simple purpose.
Nice idea. Couple of fixes needed, but it's basically OK. Julian > #!/bin/sh -e > # > # dpkg-changesfile -- output changes file name of current tree > # > # The programme has been published under the terms of the Artistic Licence. > # Please see http://www.opensource.org/licenses/artistic-license.php for more > # information. > # > # dpkg-changesfile is (c) 2005 by martin f. krafft <[EMAIL PROTECTED]> > # > > if [ -r changelog ] && [ "${0##*/}" = debian ]; then This should test something more like "$(basename $(pwd))" = debian Could probably even rip this directory processing code from one of the other scripts in the devscripts suite. > cd .. > fi > > if [ ! -r debian/changelog ]; then > echo E: not within a Debian source package. >&2 > exit 1 > fi > > PKGNAME=$(dpkg-parsechangelog | sed -ne 's,^Source: ,,p') > VERSION=$(dpkg-parsechangelog | sed -ne 's,^Version: ,,p') We need to remove any epoch from the version number here. > ARCH=$(dpkg-architecture | sed -ne 's,^DEB_BUILD_ARCH=,,p') > > echo ${PKGNAME}_${VERSION}_${ARCH}.changes > exit 0 Julian -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

