malekith: bootdisk mkmod,1.3,1.4

Michał Moskal malekith w pld-linux.org
Pon, 25 Mar 2002, 10:18:13 CET


Module name:    bootdisk
Changes by:     malekith

Changed RCS file: /cvsroot/bootdisk/mod/mkmod,v
----------------------------
revision 1.4
date: 2002/03/25 09:18:10;  author: malekith;  state: Exp;  lines: +41 -0
- check whatever each module set is closed with respect to module
  dependencies
 

Index: mkmod
===================================================================
RCS file: /cvsroot/bootdisk/mod/mkmod,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- mkmod	22 Mar 2002 10:10:50 -0000	1.3
+++ mkmod	25 Mar 2002 09:18:10 -0000	1.4
@@ -40,6 +40,16 @@
 mod=
 might_be_empty=
 
+whats_needed ()
+{
+  awk '
+BEGIN {p=0}
+/\/'$1':/ { p=1; print; next }
+/:/ { p=0 }
+{ if (p) print }' $moddir/modules.dep | \
+	sed -e 's|\\||; s|:||; s|[^ 	]*/||g' | xargs echo -n
+}
+
 finalize_pkg ()
 {
   echo -n "  $mod... "
@@ -58,6 +68,31 @@
     echo "no modules found" 1>&2
     exit 1
   fi
+  cd mod-root
+  for f in * ; do
+    if [ "$f" = DUMMY ] ; then
+      continue
+    fi
+    dep=$(whats_needed $f)
+    if [ "$dep" = "" ] ; then
+      echo "cannot find $f in modules.dep" 1>&2
+      exit 1
+    fi
+    for k in $dep ; do
+      if test -f $k ; then
+        : ok
+      else
+        if echo " $fake_list " | grep -q " $k " ; then
+	  : ok
+	else
+          echo "cannot find $k needed by $f" 1>&2
+          exit 1
+	fi
+      fi
+    done
+  done
+  cd ..
+  echo -n "dep "
   (cd mod-root && tar cf - *) | gzip -9nf > $mod-mod.tar.gz
   rm -rf mod-root
   echo done
@@ -71,11 +106,17 @@
       fi
       mod=
       mod_list=
+      fake_list=
       if [ "$(echo $cmd | grep mod4 || :)" = "" \
            -o "$KERNEL_VERCODE" -ge 4 ] ; then
         mod="$rest"
       fi
       might_be_empty=$(echo $cmd | grep empty || :)
+      ;;
+    @fake | @fake4)
+      if [ "$cmd" = @fake -o "$KERNEL_VERCODE" -ge 4 ] ; then
+        fake_list="$fake_list $rest"
+      fi
       ;;
     "#" | "" )
       ;;



Więcej informacji o liście dyskusyjnej pld-installer