summaryrefslogtreecommitdiff
path: root/dh_lib
diff options
context:
space:
mode:
authorjoey <joey>1999-08-17 04:40:08 +0000
committerjoey <joey>1999-08-17 04:40:08 +0000
commit8828415f7d08350f236cc60d3c801ccd0ba199d6 (patch)
treef80fd6290c80f4199469dd3cbef440460294d8be /dh_lib
parent1352476d748b5137881c467365f0ed5c34297c5d (diff)
downloaddebhelper-8828415f7d08350f236cc60d3c801ccd0ba199d6.tar.gz
r42: Initial Import
Diffstat (limited to 'dh_lib')
-rw-r--r--dh_lib29
1 files changed, 16 insertions, 13 deletions
diff --git a/dh_lib b/dh_lib
index 7a56c156..8347aae8 100644
--- a/dh_lib
+++ b/dh_lib
@@ -51,6 +51,22 @@ pkgext() {
fi
}
+# Returns 1 if the package is a native debian package, null otherwise.
+isnative() {
+ # 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:'`
+ # Is this a native Debian package?
+ if expr "$VERSION" : '.*-' >/dev/null; then
+ return 1
+ fi
+}
+
# Automatically add a shell script snippet to a debian script.
# Only works if the script has #DEBHELPER# in it.
#
@@ -141,22 +157,9 @@ for i; do
esac
done
-# 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`
-# Is this a native Debian package?
-if ! expr "$VERSION" : '.*-' >/dev/null; then
- NATIVE=1
-fi
-
if [ "$DH_DOINDEP" -o "$DH_DOARCH" ]; then
# Figure out all the binary packages to be produced, by looking at the
# control file. Break it into 2 lists, INDEP_PACKAGES and ARCH_PACKAGES.