Mercurial > treepkg
changeset 55:6b5f7f7575f6
merge
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Tue, 10 Apr 2007 12:07:39 +0200 |
parents | e1028211d34b (current diff) b0014b8f6029 (diff) |
children | 83e1aa122ad0 |
files | enterprise/kdei18n.py treepkg/packager.py |
diffstat | 8 files changed, 56 insertions(+), 56 deletions(-) [+] |
line wrap: on
line diff
--- a/enterprise/kdei18n.py Tue Apr 03 16:09:35 2007 +0200 +++ b/enterprise/kdei18n.py Tue Apr 10 12:07:39 2007 +0200 @@ -50,7 +50,7 @@ return version_template % locals() def unpack_orig_tarball(self): - orig_tarball = self.pkg_line.orig_tarball + orig_tarball = self.track.orig_tarball run.call(cmdexpand("tar xjf $tarball -C $directory", tarball=orig_tarball, directory=self.work_dir)) tarbasename = os.path.basename(orig_tarball) @@ -125,7 +125,7 @@ source_packager_cls = SourcePackager -class PackageLine(treepkg.packager.PackageLine): +class PackageTrack(treepkg.packager.PackageTrack): revision_packager_cls = RevisionPackager @@ -135,5 +135,5 @@ def __init__(self, *args, **kw): self.orig_tarball = kw.pop("orig_tarball") - super(PackageLine, self).__init__(*args, **kw) + super(PackageTrack, self).__init__(*args, **kw)
--- a/enterprise/kdepim.py Tue Apr 03 16:09:35 2007 +0200 +++ b/enterprise/kdepim.py Tue Apr 10 12:07:39 2007 +0200 @@ -75,7 +75,7 @@ source_packager_cls = SourcePackager -class PackageLine(treepkg.packager.PackageLine): +class PackageTrack(treepkg.packager.PackageTrack): revision_packager_cls = RevisionPackager
--- a/initpbuilder.py Tue Apr 03 16:09:35 2007 +0200 +++ b/initpbuilder.py Tue Apr 10 12:07:39 2007 +0200 @@ -17,7 +17,7 @@ import os from optparse import OptionParser -from treepkg.packager import create_package_line, PackagerGroup +from treepkg.packager import create_package_track, PackagerGroup from treepkg.readconfig import read_config from treepkg.util import ensure_directory, writefile from treepkg.run import call @@ -115,14 +115,14 @@ sys.exit(1) treepkg_opts, packager_opts = read_config(options.config_file) - group = PackagerGroup([create_package_line(**opts) + group = PackagerGroup([create_package_track(**opts) for opts in packager_opts], **treepkg_opts) - pkg_line = group.get_package_lines()[0] - init_pbuilder(pkg_line.pbuilderrc, + track = group.get_package_tracks()[0] + init_pbuilder(track.pbuilderrc, distribution=options.distribution, mirrorsite=options.mirrorsite, extramirrors=options.othermirror, - root_cmd=pkg_line.root_cmd) + root_cmd=track.root_cmd) main()
--- a/runtreepkg.py Tue Apr 03 16:09:35 2007 +0200 +++ b/runtreepkg.py Tue Apr 10 12:07:39 2007 +0200 @@ -13,7 +13,7 @@ import logging from optparse import OptionParser -from treepkg.packager import create_package_line, PackagerGroup +from treepkg.packager import create_package_track, PackagerGroup from treepkg.readconfig import read_config def initialize_logging(): @@ -53,14 +53,14 @@ if name in args: args.remove(name) for name in args: - print >>sys.stderr, "No package lines found named %r" % name + print >>sys.stderr, "No package tracks found named %r" % name if packager_opts: - group = PackagerGroup([create_package_line(**opts) + group = PackagerGroup([create_package_track(**opts) for opts in packager_opts], **treepkg_opts) if options.once: - group.check_package_lines() + group.check_package_tracks() else: group.run()
--- a/treepkg/packager.py Tue Apr 03 16:09:35 2007 +0200 +++ b/treepkg/packager.py Tue Apr 10 12:07:39 2007 +0200 @@ -32,8 +32,8 @@ # Derived classes must supply the package basename pkg_basename = None - def __init__(self, pkg_line, status, work_dir, src_dir, revision): - self.pkg_line = pkg_line + def __init__(self, track, status, work_dir, src_dir, revision): + self.track = track self.status = status self.work_dir = work_dir self.src_dir = src_dir @@ -64,7 +64,7 @@ is the return value of the determine_package_version() method. """ temp_dir = os.path.join(self.work_dir, "temp") - self.pkg_line.export_sources(temp_dir) + self.track.export_sources(temp_dir) pkgbaseversion = self.determine_package_version(temp_dir) pkgbasedir = os.path.join(self.work_dir, @@ -114,7 +114,7 @@ debian_dir = os.path.join(pkgbasedir, "debian") changelog = os.path.join(debian_dir, "changelog") - self.pkg_line.copy_debian_directory(debian_dir) + self.track.copy_debian_directory(debian_dir) logging.info("Updating %r", changelog) oldversion = util.debian_changelog_version(changelog) @@ -125,7 +125,7 @@ run.call(cmdexpand("debchange -c $changelog" " -v ${oldversionprefix}${pkgbaseversion}-kk1" " $changemsg", **locals()), - env=self.pkg_line.debian_environment()) + env=self.track.debian_environment()) def create_source_package(self, pkgbasedir, origtargz): @@ -136,7 +136,7 @@ tarball=os.path.basename(origtargz)), cwd=os.path.dirname(pkgbasedir), suppress_output=True, - env=self.pkg_line.debian_environment()) + env=self.track.debian_environment()) def move_source_package(self, pkgbasename): """Moves the new source package from the work_dir to the src_dir""" @@ -176,8 +176,8 @@ class BinaryPackager(object): - def __init__(self, pkg_line, status, binary_dir, dsc_file, logfile): - self.pkg_line = pkg_line + def __init__(self, track, status, binary_dir, dsc_file, logfile): + self.track = track self.status = status self.binary_dir = binary_dir self.dsc_file = dsc_file @@ -186,12 +186,12 @@ def package(self): self.status.creating_binary_package() util.ensure_directory(self.binary_dir) - logging.info("Building binary package; loging to %r", self.logfile) + logging.info("Building binary package; logging to %r", self.logfile) run.call(cmdexpand("@rootcmd /usr/sbin/pbuilder build" " --configfile $pbuilderrc" " --logfile $logfile --buildresult $bindir $dsc", - rootcmd=self.pkg_line.root_cmd, - pbuilderrc=self.pkg_line.pbuilderrc, + rootcmd=self.track.root_cmd, + pbuilderrc=self.track.pbuilderrc, logfile=self.logfile, bindir=self.binary_dir, dsc=self.dsc_file), suppress_output=True) @@ -203,10 +203,10 @@ source_packager_cls = SourcePackager binary_packager_cls = BinaryPackager - def __init__(self, pkg_line, revision): - self.pkg_line = pkg_line + def __init__(self, track, revision): + self.track = track self.revision = revision - self.base_dir = self.pkg_line.pkg_dir_for_revision(self.revision, 1) + self.base_dir = self.track.pkg_dir_for_revision(self.revision, 1) self.status = status.RevisionStatus(os.path.join(self.base_dir, "status")) @@ -228,7 +228,7 @@ try: util.ensure_directory(self.work_dir) self.status.start = datetime.datetime.utcnow() - src_packager = self.source_packager_cls(self.pkg_line, self.status, + src_packager = self.source_packager_cls(self.track, self.status, self.work_dir, self.src_dir, self.revision) src_packager.package() @@ -237,7 +237,7 @@ if dsc_file is None: raise RuntimeError("Cannot find dsc File in %r" % self.src_dir) - bin_packager = self.binary_packager_cls(self.pkg_line, self.status, + bin_packager = self.binary_packager_cls(self.track, self.status, self.binary_dir, dsc_file, self.build_log) bin_packager.package() @@ -252,7 +252,7 @@ shutil.rmtree(self.base_dir) -class PackageLine(object): +class PackageTrack(object): revision_packager_cls = RevisionPackager @@ -369,15 +369,15 @@ for revision in self.get_revision_numbers()] -def create_package_line(packager_class, **kw): +def create_package_track(packager_class, **kw): module = util.import_dotted_name(packager_class) - return module.PackageLine(**kw) + return module.PackageTrack(**kw) class PackagerGroup(object): - def __init__(self, package_lines, check_interval): - self.package_lines = package_lines + def __init__(self, package_tracks, check_interval): + self.package_tracks = package_tracks self.check_interval = check_interval def run(self): @@ -388,7 +388,7 @@ while 1: now = time.time() if now > last_check + self.check_interval: - self.check_package_lines() + self.check_package_tracks() last_check = now next_check = now + self.check_interval to_sleep = next_check - time.time() @@ -400,17 +400,17 @@ else: logging.info("Next check now") - def check_package_lines(self): - logging.info("Checking package lines") - for line in self.package_lines: + def check_package_tracks(self): + logging.info("Checking package tracks") + for track in self.package_tracks: try: - packager = line.package_if_updated() + packager = track.package_if_updated() if packager: packager.package() except: logging.exception("An error occurred while" - " checking packager line %r", line.name) - logging.info("Checked all package lines") + " checking packager track %r", track.name) + logging.info("Checked all package tracks") - def get_package_lines(self): - return self.package_lines + def get_package_tracks(self): + return self.package_tracks
--- a/treepkg/readconfig.py Tue Apr 03 16:09:35 2007 +0200 +++ b/treepkg/readconfig.py Tue Apr 10 12:07:39 2007 +0200 @@ -63,7 +63,7 @@ if section.startswith("pkg_"): packager_class = parser.get(section, "packager_class") module = util.import_dotted_name(packager_class) - desc = packager_desc + module.PackageLine.extra_config_desc + desc = packager_desc + module.PackageTrack.extra_config_desc packagers.append(read_config_section(parser, section, desc, dict(name=section[4:])))
--- a/treepkg/report.py Tue Apr 03 16:09:35 2007 +0200 +++ b/treepkg/report.py Tue Apr 10 12:07:39 2007 +0200 @@ -7,7 +7,7 @@ """Support for status reports""" -from packager import create_package_line, PackagerGroup +from packager import create_package_track, PackagerGroup from readconfig import read_config class struct(object): @@ -28,7 +28,7 @@ def get_packager_group(config_file): treepkg_opts, packager_opts = read_config(config_file) - return PackagerGroup([create_package_line(**opts) + return PackagerGroup([create_package_track(**opts) for opts in packager_opts], **treepkg_opts) @@ -64,16 +64,16 @@ def prepare_report(group): revisions = {} columns = [] - pkglines = group.get_package_lines() - num_columns = len(pkglines) - for column, line in enumerate(pkglines): - columns.append((column, line.name)) - for revision in line.get_revisions(): + tracks = group.get_package_tracks() + num_columns = len(tracks) + for column, track in enumerate(tracks): + columns.append((column, track.name)) + for revision in track.get_revisions(): row = revisions.setdefault(revision.revision, [None] * num_columns) row[column] = struct(revno=revision.revision, revision=revision, column=column, - name=line.name, + name=track.name, status=prepare_status(revision.status)) # convert the revisions dict into a sorted list of (revno, row)
--- a/treepkg/web.py Tue Apr 03 16:09:35 2007 +0200 +++ b/treepkg/web.py Tue Apr 10 12:07:39 2007 +0200 @@ -31,12 +31,12 @@ stream = tmpl.generate(report=report.prepare_report(group)) return stream.render('html') - def build_log_filename(self, package_line_name, revno): + def build_log_filename(self, package_track_name, revno): """Returns the name of the build log file of a revision if it exists""" group = report.get_packager_group(self.treepkg_config) - for line in group.get_package_lines(): - if line.name == package_line_name: - for revision in line.get_revisions(): + for track in group.get_package_tracks(): + if track.name == package_track_name: + for revision in track.get_revisions(): if str(revision.revision) == revno: if revision.has_build_log(): return revision.build_log