* 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. svn path=/dists/trunk/linux-2.6/; revision=12830
This commit is contained in:
parent
7d24d1946c
commit
c4d595ff1a
|
@ -1,17 +1,21 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/python
|
||||||
|
|
||||||
import fnmatch
|
|
||||||
import sys
|
import sys
|
||||||
sys.path.append('debian/lib/python')
|
sys.path.append('debian/lib/python')
|
||||||
|
|
||||||
|
import fnmatch
|
||||||
|
import stat
|
||||||
|
|
||||||
from debian_linux.abi import *
|
from debian_linux.abi import *
|
||||||
from debian_linux.config import ConfigCoreDump
|
from debian_linux.config import ConfigCoreDump
|
||||||
from debian_linux.debian import *
|
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.arch, self.featureset, self.flavour = arch, featureset, flavour
|
||||||
self.config = ConfigCoreDump(fp = file("debian/config.defines.dump"))
|
|
||||||
self.filename_new = "%s/Module.symvers" % dir
|
self.filename_new = "%s/Module.symvers" % dir
|
||||||
|
|
||||||
changelog = Changelog(version = VersionLinux)[0]
|
changelog = Changelog(version = VersionLinux)[0]
|
||||||
|
@ -107,6 +111,63 @@ class checker(object):
|
||||||
for m in ignores:
|
for m in ignores:
|
||||||
filtered.update(fnmatch.filter(all, m))
|
filtered.update(fnmatch.filter(all, m))
|
||||||
return filtered
|
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__':
|
if __name__ == '__main__':
|
||||||
sys.exit(checker(*sys.argv[1:])(sys.stdout))
|
sys.exit(Main(*sys.argv[1:])())
|
|
@ -95,6 +95,7 @@ linux-2.6 (2.6.28-1~experimental.1) UNRELEASED; urgency=low
|
||||||
|
|
||||||
[ Bastian Blank ]
|
[ Bastian Blank ]
|
||||||
* Make gcc-4.3 the default compiler. (closes: #463295)
|
* Make gcc-4.3 the default compiler. (closes: #463295)
|
||||||
|
* Add optional image size check.
|
||||||
|
|
||||||
-- dann frazier <dannf@debian.org> Fri, 29 Aug 2008 17:02:18 -0600
|
-- dann frazier <dannf@debian.org> Fri, 29 Aug 2008 17:02:18 -0600
|
||||||
|
|
||||||
|
|
|
@ -145,7 +145,7 @@ $(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_$(TYPE): $(STAMPS_DIR)/setu
|
||||||
|
|
||||||
$(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_kernel-package:
|
$(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_kernel-package:
|
||||||
cd '$(DIR)'; $(kpkg_image) build
|
cd '$(DIR)'; $(kpkg_image) build
|
||||||
python debian/bin/abicheck.py $(DIR) $(ARCH) $(FEATURESET) $(FLAVOUR)
|
python debian/bin/buildcheck.py $(DIR) $(ARCH) $(FEATURESET) $(FLAVOUR)
|
||||||
touch '$@'
|
touch '$@'
|
||||||
|
|
||||||
$(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain-s390-tape: BUILD_TARGET = image
|
$(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain-s390-tape: BUILD_TARGET = image
|
||||||
|
@ -154,7 +154,7 @@ $(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain \
|
||||||
$(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain-s390-tape \
|
$(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain-s390-tape \
|
||||||
$(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain-xen:
|
$(STAMPS_DIR)/build_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain-xen:
|
||||||
+$(MAKE_CLEAN) -C '$(DIR)' $(JOBS_ARG) $(BUILD_TARGET)
|
+$(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 '$@'
|
touch '$@'
|
||||||
|
|
||||||
$(STAMPS_DIR)/build-doc: SOURCE_DIR=$(BUILD_DIR)/source
|
$(STAMPS_DIR)/build-doc: SOURCE_DIR=$(BUILD_DIR)/source
|
||||||
|
|
Loading…
Reference in New Issue