]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh_lib
r197: Initial Import
[debhelper.git] / dh_lib
diff --git a/dh_lib b/dh_lib
index 7ebc8be179e5406c1caaacfeb4066ffd9287f819..a0f8bb91e453249e2b88c002c8f3f8c5c34b278b 100644 (file)
--- a/dh_lib
+++ b/dh_lib
@@ -134,44 +134,13 @@ autoscript() {
        complex_doit "echo '# End automatically added section' >> $autoscript_debscript"
 }
 
-# Sets 2 global variables, INDEP_PACKAGES is all the arch-independant
-# packages, ARCH_PACKAGES is the arch-dependant packages.
-get_arch_indep_packages() {
-       INDEP_PACKAGES=""
-       ARCH_PACKAGES=""
-       
-       # First, get the list of all binary packages.
-        # Notice we want the list in reverse order, thus the tac.
-       PACKAGES=`grep ^Package: debian/control | cut -d " " -f 2 | tac | tr "\n" " "`
-       # Remove trailing space.
-       PACKAGES=`expr "$PACKAGES" : '\(.*\) '`
-       # Loop on the list of architectures.
-       for ARCH in `grep ^Architecture: debian/control | cut -d " " -f 2` ; do
-               # Pull the last package off the list.
-               THISPKG=`expr "$PACKAGES" : '.* \(.*\)'` || true
-               if [ ! "$THISPKG" ]; then
-                       THISPKG=$PACKAGES
-               fi
-               PACKAGES=`expr "$PACKAGES" : '\(.*\) .*'` || true
-       
-               if [ ! "$THISPKG" ]; then
-                       error "debian/control invalid - too many Architecture lines or too few Package lines"
-               fi
-
-               if [ "$ARCH" = "all" ]; then
-                       INDEP_PACKAGES="$INDEP_PACKAGES $THISPKG"
-               else
-                       ARCH_PACKAGES="$ARCH_PACKAGES $THISPKG"
-               fi
-       done
-
-       if [ "$PACKAGES" ]; then
-               error "debian/control invalid - too many Architecure lines or too few Package lines"
-       fi
-}
-
 # Argument processing and global variable initialization is below.
 
+# If DH_OPTIONS is set, prepend it to the command line.
+if [ "$DH_OPTIONS" ]; then
+       set -- $DH_OPTIONS $@
+fi
+
 # Check to see if an argument on the command line starts with a dash.
 # if so, we need to pass this off to the resource intensive perl.
 for arg; do
@@ -198,7 +167,7 @@ MAINPACKAGE=`grep ^Package: debian/control | cut -d " " -f 2 | head -1`
 # Check if packages to build have been specified, if not, fall back to 
 # the default, doing them all.
 if [ ! "$DH_DOPACKAGES" ]; then
-       if [ "$DH_DOINDEP" -o "$DH_DOARCH" ]; then
+       if [ "$DH_DOINDEP" -o "$DH_DOARCH" -o "$DH_DOSAME" ]; then
                error "I have no package to build."
        fi
        DH_DOPACKAGES=`grep ^Package: debian/control | cut -d " " -f 2 | tr "\n" " "`