summaryrefslogtreecommitdiff
path: root/dh_lib
diff options
context:
space:
mode:
authorjoey <joey>1999-08-17 04:39:32 +0000
committerjoey <joey>1999-08-17 04:39:32 +0000
commite7b15707fd400a1775864ea61f4a2665932c7c88 (patch)
treeed3bcf7fb1140262c7f6901fbfc42ec01329aa56 /dh_lib
parent30b820a975dfc42f401a395a406f0b9f1f717fcc (diff)
downloaddebhelper-e7b15707fd400a1775864ea61f4a2665932c7c88.tar.gz
r40: Initial Import
Diffstat (limited to 'dh_lib')
-rw-r--r--dh_lib10
1 files changed, 7 insertions, 3 deletions
diff --git a/dh_lib b/dh_lib
index 388b7f72..7a56c156 100644
--- a/dh_lib
+++ b/dh_lib
@@ -141,9 +141,13 @@ for i; do
esac
done
-# Get the package version from the changelog.
-LINE=`head -1 debian/changelog`
-VERSION=`expr "$LINE" : '.* (\(.*\))'`
+# Get the package version.
+# Note that the 2>/dev/null is because a bug in dpkg-parsechangelog makes it
+# output a bogus error message to stderr.
+# If it actually has a real error, then the expr will fail, and this whole
+# script will come crashing to a halt, which is good enough to inform
+# the user something's wrong. :-)
+VERSION=`expr "\`dpkg-parsechangelog 2>/dev/null\`" : '.*Version: \(.*\).*Distribution:'`
# Get the name of the main binary package.
MAINPACKAGE=`grep ^Package: debian/control | cut -d " " -f 2 | head -1`