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

Bastian Blank waldi at alioth.debian.org
Wed Feb 18 14:17:25 UTC 2009


Author: waldi
Date: Wed Feb 18 14:17:21 2009
New Revision: 12830

Log:
* debian/bin/buildcheck.py
  - Move from debian/bin/abicheck.py.
  - Extend to do all kind of build checks.
  - Add optional check for image size.
* debian/changelog: Update.
* debian/rules.real: Use debian/bin/buildcheck.py.


Added:
   dists/trunk/linux-2.6/debian/bin/buildcheck.py   (contents, props changed)
      - copied, changed from r12829, /dists/trunk/linux-2.6/debian/bin/abicheck.py
Removed:
   dists/trunk/linux-2.6/debian/bin/abicheck.py
Modified:
   dists/trunk/linux-2.6/debian/changelog
   dists/trunk/linux-2.6/debian/rules.real

Copied: dists/trunk/linux-2.6/debian/bin/buildcheck.py (from r12829, /dists/trunk/linux-2.6/debian/bin/abicheck.py)
==============================================================================
--- /dists/trunk/linux-2.6/debian/bin/abicheck.py	(original)
+++ dists/trunk/linux-2.6/debian/bin/buildcheck.py	Wed Feb 18 14:17:21 2009
@@ -1,17 +1,21 @@
-#!/usr/bin/env python
+#!/usr/bin/python
 
-import fnmatch
 import sys
 sys.path.append('debian/lib/python')
 
+import fnmatch
+import stat
+
 from debian_linux.abi import *
 from debian_linux.config import ConfigCoreDump
 from debian_linux.debian import *
 
-class checker(object):
-    def __init__(self, dir, arch, featureset, flavour):
+
+class CheckAbi(object):
+    def __init__(self, config, dir, arch, featureset, flavour):
+        self.config = config
         self.arch, self.featureset, self.flavour = arch, featureset, flavour
-        self.config = ConfigCoreDump(fp = file("debian/config.defines.dump"))
+
         self.filename_new = "%s/Module.symvers" % dir
 
         changelog = Changelog(version = VersionLinux)[0]
@@ -107,6 +111,63 @@
         for m in ignores:
             filtered.update(fnmatch.filter(all, m))
         return filtered
+ 
+
+class CheckImage(object):
+    def __init__(self, config, dir, arch, featureset, flavour):
+        self.dir = dir
+        self.arch, self.featureset, self.flavour = arch, featureset, flavour
+
+        self.config_entry_build = config.merge('build', arch, featureset, flavour)
+        self.config_entry_image = config.merge('image', arch, featureset, flavour)
+
+    def __call__(self, out):
+        image = self.config_entry_build.get('image-file')
+
+        if not image:
+            # TODO: Bail out
+            return 0
+
+        image = os.path.join(self.dir, image)
+
+        fail = 0
+
+        fail |= self.check_size(out, image)
+
+        return fail
+
+    def check_size(self, out, image):
+        value = self.config_entry_image.get('check-size')
+
+        if not value:
+            return 0
+
+        value = int(value)
+
+        s = os.stat(image)
+
+        if s[stat.ST_SIZE] > value:
+            out.write('Image too large (%d > %d)!  Refusing to continue.\n' % (s[stat.ST_SIZE], value))
+            return 1
+
+        out.write('Image fits (%d).  Continuing.\n' % value)
+        return 0
+
+
+class Main(object):
+    def __init__(self, dir, arch, featureset, flavour):
+        self.args = dir, arch, featureset, flavour
+
+        self.config = ConfigCoreDump(fp=file("debian/config.defines.dump"))
+
+    def __call__(self):
+        fail = 0
+
+        for c in CheckAbi, CheckImage:
+            fail |= c(self.config, *self.args)(sys.stdout)
+
+        return fail
+
 
 if __name__ == '__main__':
-    sys.exit(checker(*sys.argv[1:])(sys.stdout))
+    sys.exit(Main(*sys.argv[1:])())

Modified: dists/trunk/linux-2.6/debian/changelog
==============================================================================
--- dists/trunk/linux-2.6/debian/changelog	(original)
+++ dists/trunk/linux-2.6/debian/changelog	Wed Feb 18 14:17:21 2009
@@ -95,6 +95,7 @@
 
   [ Bastian Blank ]
   * Make gcc-4.3 the default compiler. (closes: #463295)
+  * Add optional image size check.
 
  -- dann frazier <dannf at debian.org>  Fri, 29 Aug 2008 17:02:18 -0600
 

Modified: dists/trunk/linux-2.6/debian/rules.real
==============================================================================
--- dists/trunk/linux-2.6/debian/rules.real	(original)
+++ dists/trunk/linux-2.6/debian/rules.real	Wed Feb 18 14:17:21 2009
@@ -145,7 +145,7 @@
 
 $(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_kernel-package:
 	cd '$(DIR)'; $(kpkg_image) build
-	python debian/bin/abicheck.py $(DIR) $(ARCH) $(FEATURESET) $(FLAVOUR)
+	python debian/bin/buildcheck.py $(DIR) $(ARCH) $(FEATURESET) $(FLAVOUR)
 	touch '$@'
 
 $(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain-s390-tape: BUILD_TARGET = image
@@ -154,7 +154,7 @@
 $(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain-s390-tape \
 $(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain-xen:
 	+$(MAKE_CLEAN) -C '$(DIR)' $(JOBS_ARG) $(BUILD_TARGET)
-	python debian/bin/abicheck.py $(DIR) $(ARCH) $(FEATURESET) $(FLAVOUR)
+	python debian/bin/buildcheck.py $(DIR) $(ARCH) $(FEATURESET) $(FLAVOUR)
 	touch '$@'
 
 $(STAMPS_DIR)/build-doc: SOURCE_DIR=$(BUILD_DIR)/source



More information about the Kernel-svn-changes mailing list