[kernel] r5343 - in dists/trunk/linux-2.6/debian: . bin

Sven Luther luther at costa.debian.org
Sun Jan 8 09:48:09 UTC 2006


Author: luther
Date: Sun Jan  8 09:48:08 2006
New Revision: 5343

Modified:
   dists/trunk/linux-2.6/debian/bin/kconfig.ml
   dists/trunk/linux-2.6/debian/rules
Log:
Added debian/rules target to check the configs and call bin/kconfig.ml accordingly, not yet finished though.


Modified: dists/trunk/linux-2.6/debian/bin/kconfig.ml
==============================================================================
--- dists/trunk/linux-2.6/debian/bin/kconfig.ml	(original)
+++ dists/trunk/linux-2.6/debian/bin/kconfig.ml	Sun Jan  8 09:48:08 2006
@@ -2,6 +2,7 @@
 
 (* Command line arguments parsing *)
 let basedir = ref "debian/arch"
+let sourcedir = ref "."
 let arch = ref ""
 let subarch = ref ""
 let flavour = ref ""
@@ -16,6 +17,7 @@
 
 let spec = [
   "-b", Arg.Set_string basedir, "base dir of the arch configurations [default: debian/arch]";
+  "-bs", Arg.Set_string sourcedir, "base source dir containing the patched debian linux source tree [default: .]";
   "-ba", Arg.Set archindir, "basedir includes arch";
   "-a", Arg.Set_string arch, "arch";
   "-s", Arg.Set_string subarch, "subarch";
@@ -26,7 +28,7 @@
 let usage =
   "Check single config file : ./kconfig.ml config_file\n" ^
   "Create config file       : ./kconfig.ml [ -ba ] [ -b basedir ] -a arch [ -s subarch ] -f flavour" ^ "\n" ^
-  "Check all config files   : ./kconfig.ml -c [ -b basedir ] -a arch [ -s subarch ] -f flavour" ^ "\n"
+  "Check all config files   : ./kconfig.ml -c [ -ba ] [ -b basedir ] [ -bs sourcedir ] [ -a arch ] [ -s subarch ] [ -f flavour ]" ^ "\n"
 
 let () = Arg.parse
   spec
@@ -185,11 +187,9 @@
   with Sys_error s -> Printf.eprintf "Error: %s\n" s
 
 let do_create () =
-  if !arch <> "" && !flavour <> "" then
-    try
-      begin if !verbose then 
-        Printf.eprintf "Creating config file for arch %s, subarch %s, flavour %s (basedir is %s)\n" !arch !subarch !flavour !basedir
-      end;
+  if !arch <> "" && !flavour <> "" then begin
+      if !verbose then 
+        Printf.eprintf "Creating config file for arch %s, subarch %s, flavour %s (basedir is %s)\n" !arch !subarch !flavour !basedir;
       let dir = get_archdir () in
       let m = parse_config_file (dir ^ "/config") C.empty false in
       let archdir = dir ^ "/" ^ !arch in
@@ -201,24 +201,20 @@
         else m, archdir
       in
       let m = parse_config_file (archdir ^ "/config." ^ !flavour) m true in
-      print_config m;
-    with Sys_error s -> Printf.eprintf "Error: %s\n" s
+      print_config m
+    end
   else
     usage ()
     
 let do_check () = 
-  if !arch <> "" && !flavour <> "" then
-    let dir = get_archdir () in
-    begin if !verbose then Printf.eprintf "Checking config files in %s\n" dir end;
-    try
-      let m = parse_defines_file (dir ^ "/defines") [] true in
-      print_defines m
-    with Sys_error s -> Printf.eprintf "Error: %s\n" s
-  else
-    usage ()
-
-let () =
-  match !action with
-  | Single -> do_single ()
-  | Create -> do_create ()
-  | Check -> do_check ()
+  let dir = get_archdir () in
+  begin if !verbose then Printf.eprintf "Checking config files in %s\n" dir end;
+  let m = parse_defines_file (dir ^ "/defines") [] true in
+  print_defines m
+
+let () = try 
+    match !action with
+    | Single -> do_single ()
+    | Create -> do_create ()
+    | Check -> do_check ()
+  with Sys_error s -> Printf.eprintf "Error: %s\n" s; usage ()

Modified: dists/trunk/linux-2.6/debian/rules
==============================================================================
--- dists/trunk/linux-2.6/debian/rules	(original)
+++ dists/trunk/linux-2.6/debian/rules	Sun Jan  8 09:48:08 2006
@@ -83,4 +83,33 @@
 	@echo
 	exit 1
 
+#
+# Rule to check all configs snipplets in debian/arch
+#
+
+CheckConfs_DIR := $(CURDIR)/debian/build/check
+CheckConfs_srcfiles := $(filter-out debian, $(wildcard *))
+# TODO : need to grab those directly from the changelog or whatever.
+CheckConfs_SOURCE_VERSION := 2.6.15-1
+CheckConfs_REVISIONS := 1 2
+
+$(CheckConfs_DIR) source-configs:
+	rm -rf '$(CheckConfs_DIR)'
+	mkdir -p '$(CheckConfs_DIR)'
+	cp -al $(CheckConfs_srcfiles) $(CheckConfs_DIR)
+
+patch-configs: $(CheckConfs_DIR)
+	cd '$(CheckConfs_DIR)'; python2.4 '$(CURDIR)/debian/bin/apply.py' \
+		--overwrite-home='$(CURDIR)/debian/patches' \
+		--overwrite-source='$(CheckConfs_SOURCE_VERSION)' \
+		--overwrite-revisions='$(CheckConfs_REVISIONS)' \
+
+
+check-configs: patch-configs
+	@echo "Checking all configuration files"
+	ocaml debian/bin/kconfig.ml -c -b "debian/arch"
+
+clean-configs:
+	rm -rf '$(CheckConfs_DIR)'
+
 .PHONY: clean build setup binary-indep binary-arch binary



More information about the Kernel-svn-changes mailing list