Julien Jehannet avatar Julien Jehannet committed aba3df1

better naming in build module

Comments (0)

Files changed (6)

DEBUG_INITIAL_LGP_STUFF_WITH_LOCAL_CONFIGURATION

+# HG changeset patch
+# Parent 4ae70730fb0ab41211388af734d602c8ca66396d
+diff --git a/etc/lgp/pbuilderrc b/etc/lgp/pbuilderrc
+--- a/etc/lgp/pbuilderrc
++++ b/etc/lgp/pbuilderrc
+@@ -31,4 +31,4 @@ fi
+ 
+ 
+ # Run pbuilder logic from external file (avoid configuration merges)
+-source /var/lib/logilab-packaging/pbuilderrc.sh
++source /home/julien/src/logilab/devtools/etc/lgp/pbuilderrc.sh
+diff --git a/etc/lgp/pbuilderrc.sh b/etc/lgp/pbuilderrc.sh
+--- a/etc/lgp/pbuilderrc.sh
++++ b/etc/lgp/pbuilderrc.sh
+@@ -15,7 +15,7 @@
+ export TMPDIR=/tmp
+ 
+ # Declaration of lgp suites file location
+-LGP_SUITES=${LGP_SUITES:-'/etc/lgp/suites'}
++LGP_SUITES=${LGP_SUITES:-'/home/julien/src/logilab/devtools/etc/lgp/suites'}
+ 
+ # Find default distributions based on LGP_SUITES file if not already specified
+ : ${DEBIAN_SUITES:=$(grep -B2 '^Keyring: debian' $LGP_SUITES | sed -n 's/\(Suite: \)//p')}
+@@ -242,7 +242,7 @@ export PS1="(lgp) ${DIST}/${ARCH} \$ "
+ 
+ # enable pkgname-logfile
+ #PBUILDER_BUILD_LOGFILE="${BUILDRESULT}/"$(basename "${PACKAGENAME}" .dsc)"${PKGNAME_LOGFILE_EXTENTION}"
+-PKGNAME_LOGFILE_EXTENTION="_${ARCH}_${DIST}$(python -c 'from logilab.devtools.lgp import BUILD_LOG_EXT; print BUILD_LOG_EXT')"
++PKGNAME_LOGFILE_EXTENTION=".log"
+ PKGNAME_LOGFILE=yes
+ 
+ # for pbuilder debuild
+diff --git a/lgp/__init__.py b/lgp/__init__.py
+--- a/lgp/__init__.py
++++ b/lgp/__init__.py
+@@ -19,11 +19,11 @@ import sys
+ import os, os.path as osp
+ from logilab.common.optparser import OptionParser
+ 
+-LGP_CONFIG_FILE = '/etc/lgp/lgprc'
+-LGP_SUITES      = '/etc/lgp/suites'
+-CONFIG_FILE     = '/etc/lgp/pbuilderrc'
+-HOOKS_DIR       = '/var/lib/logilab-packaging/hooks'
+-SCRIPTS_DIR     = '/var/lib/logilab-packaging/scripts'
++LGP_CONFIG_FILE = '/home/julien/src/logilab/devtools/etc/lgp/lgprc'
++LGP_SUITES      = '/home/julien/src/logilab/devtools/etc/lgp/suites'
++CONFIG_FILE     = '/home/julien/src/logilab/devtools/etc/lgp/pbuilderrc'
++HOOKS_DIR       = '/home/julien/src/logilab/devtools/etc/lgp/hooks'
++SCRIPTS_DIR     = '/home/julien/src/logilab/devtools/etc/lgp/scripts'
+ BUILD_LOG_EXT   = '.lgp-build'
+ 
+ def run(args):
 # HG changeset patch
 # Date 1304292456 -7200
 # User Julien Jehannet <julien@smaf.org>
-# Parent 66f7676097b675433ec4451c55ffdb9a0b042a39
+# Parent 3847f9529d4c781cfcb4848dd5a7a68f71f8bf93
 
 diff --git a/TODOLIST b/TODOLIST
 new file mode 100644

build-multiprocess.diff

 # HG changeset patch
-# Date 1304289459 -7200
+# Date 1304547220 -7200
 # User Julien Jehannet <julien@smaf.org>
-# Parent 5a1819df19b5b2128230e41683a2bd8f189890dd
+# Parent eca50ae9f8eb98a8225704542b47c8c783d23cf0
 lgp: limit number of parallel builds (I/O bound)
 
 diff --git a/lgp/build.py b/lgp/build.py
                   'group': 'Pbuilder'
                  }),
                 ('post-treatments',
-@@ -75,18 +59,17 @@ class Builder(SetupInfo):
+@@ -73,20 +57,19 @@ class Builder(SetupInfo):
+                  'help': "run embedded post-treatments: add trivial repository",
+                  'group': 'Debian'
                  }),
-                ('parallel',
+-               ('parallel',
++               ('jobs',
                  {'type': 'int',
 -                 'default': 1,
 -                 'dest' : "parallel",
 -                 'help': "run all distribution builds in parallel (will disable verbose mode)",
 +                 'default': cpu_count(),
-+                 'short': 'p',
-+                 'dest' : "processes",
-+                 'help': "run in parallel mode with a max limit of processes",
++                 'short': 'j',
++                 'dest' : "jobs",
++                 'help': "run in parallel with a max limit of processes",
                   'group': 'Build',
                  }),
                ]
  
      def _prune_pkg_dir(self):
          super(Builder, self)._prune_pkg_dir()
-@@ -97,136 +80,114 @@ class Builder(SetupInfo):
+@@ -95,138 +78,122 @@ class Builder(SetupInfo):
+                    "Lgp expects debian directory from here.")
+             raise LGPException(msg)
  
++    def guess_environment(self):
++        # if no default value for distribution, use list from existing images
++        if self.config.distrib is None:
++            self.config.distrib = 'all'
++        super(Builder, self).guess_environment()
++
      def run(self, args):
          Cleaner(None).run(args)
 -
 -            try:
 -                dsc_builder = DscBuilder(None)
 -                dsc_builder.config.pkg_dir = self.config.pkg_dir # XXX
-+            processes = self.config.processes > 0 and self.config.processes or 1
-+            self.available_procs = BoundedSemaphore(processes)
++            jobs = self.config.jobs > 0 and self.config.jobs or 1
++            self.available_procs = BoundedSemaphore(jobs)
  
 -                if utils.is_architecture_independent():
 -                    arch= self.get_architectures(['current'])[0]
 +                                                                 tmpdir=tmpdir)
 +                self.make_debian_binary_package(dscfile, distrib, tmpdir=tmpdir)
 +            self.logger.info("start parallel binary build(s) in background (limit: %s) ...",
-+                             processes)
++                             jobs)
 +            
 +            # waiting for all child processes
 +            [p.join() for p in self.joblist]
 +            self._build_tmpdirs.append(build['builddir'])
 +
 +            p = Process(name="%s/%s" % (build['distrib'], build['arch']),
-+                        target=self._run_binary_build, args=((build,)),
++                        target=self._run_build_process, args=((build,)),
 +                        kwargs={'verbose': self.config.verbose})
 +            p.start()
 +            self.joblist.append(p)
 +
-+    def _run_binary_build(self, build, verbose=0):
-+        """internal binary build call
++    def _run_build_process(self, build, verbose=0):
++        """internal (p)builder call
 +        
-+        This function have to be called in a new Process
-+        (see the method terminaison)
++        This function have to be called as a new Process instance
++        (see exit() method at the end)
          """
 +        self.available_procs.acquire()
 +
  
      def use_build_series(self, distrib):
          """create a series of binary build command
-@@ -254,6 +215,7 @@ class Builder(SetupInfo):
+@@ -254,6 +221,7 @@ class Builder(SetupInfo):
          series = []
          if utils.is_architecture_independent():
              options = dict()
              options['distrib'] = distrib
              options['buildopts'] = _build_options()
              options['arch'] = self.get_architectures(['current'])[0]
-@@ -263,6 +225,7 @@ class Builder(SetupInfo):
+@@ -263,6 +231,7 @@ class Builder(SetupInfo):
          else:
              for rank, arch in enumerate(self.architectures):
                  options = dict()
                  options['distrib'] = distrib
                  options['buildopts'] = _build_options(arch, rank)
                  options['arch'] = arch
-@@ -271,6 +234,55 @@ class Builder(SetupInfo):
+@@ -271,9 +240,51 @@ class Builder(SetupInfo):
                  series.append(options)
          return series
  
 +        #cmd.append(['--othermirror', "deb file:///home/juj/dists %s/" % build['distrib']])
 +        debuilder = os.environ.get('DEBUILDER', 'pbuilder')
 +        self.logger.debug("package builder flavour: '%s'" % debuilder)
-+        if debuilder == 'pbuilder':
++        if debuilder.startswith('pbuilder'): # pbuilder(-uml)
 +            # TODO encapsulate builder logic into specific InternalBuilder class
 +            cmd = ['sudo', 'IMAGE=%(image)s', 'DIST=%(distrib)s',
 +                   'ARCH=%(arch)s', debuilder, 'build',
 +            cmd = debuilder.split()
 +        assert isinstance(cmd, list)
 +        return cmd
-+
+ 
+-    def guess_environment(self):
+-        # if no default value for distribution, use list from existing images
+-        if self.config.distrib is None:
+-            self.config.distrib = 'all'
+-        super(Builder, self).guess_environment()
 +    def run_post_treatments(self, distrib):
 +        """ Run actions after package compiling """
 +        # dpkg-scanpackages i386 /dev/null | gzip -9c > 386/Packages.gz
 +            self.logger.debug("Debian trivial repository in '%s' updated."
 +                              % packages_file)
 +
-+
- 
-     def guess_environment(self):
-         # if no default value for distribution, use list from existing images
 diff --git a/lgp/build_pristine.py b/lgp/build_pristine.py
 --- a/lgp/build_pristine.py
 +++ b/lgp/build_pristine.py
 diff --git a/lgp/login.py b/lgp/login.py
 --- a/lgp/login.py
 +++ b/lgp/login.py
-@@ -64,9 +64,10 @@ class Login(SetupInfo):
+@@ -70,9 +70,10 @@ class Login(SetupInfo):
                  image = self.get_basetgz(distrib, arch)
  
                  resultdir = self.get_distrib_dir(distrib)
  
                  logging.info("login into '%s/%s' image" % (distrib, arch))
                  logging.debug("run command: %s", cmd)
-@@ -74,7 +75,7 @@ class Login(SetupInfo):
+@@ -80,7 +81,7 @@ class Login(SetupInfo):
                      check_call(cmd, shell=True,
                                 env={'DIST': distrib, 'ARCH': arch, 'IMAGE': image,
                                      'DISPLAY': os.environ.get('DISPLAY', ""),

clcommands-build-source.diff

 # HG changeset patch
-# Date 1304281266 -7200
+# Date 1304546827 -7200
 # User Julien Jehannet <julien@smaf.org>
-# Parent aca25daeae87f33e9300f1e1f521f204df514ccf
+# Parent e1ff0c6bde2543b750c5b979d4b7a42355555739
 [command] build-source: new lgp command for Debian source archive creation and multiprocessing capabilities
 
 New:
 +        dirname, basename = os.path.split(self.get_distrib_dir(resultdir))
          return "'deb file://%s %s/'" % (dirname, basename)
  
-     def run(self, args):
-@@ -64,9 +63,10 @@ class Login(SetupInfo):
+     def guess_environment(self):
+@@ -70,9 +69,10 @@ class Login(SetupInfo):
              for distrib in self.distributions:
                  image = self.get_basetgz(distrib, arch)
  

clcommands-login.diff

 # HG changeset patch
-# Date 1303049610 -7200
+# Date 1304546751 -7200
 # User Julien Jehannet <julien@smaf.org>
 # Parent c34c96e4afe554e7d1804e7e4396233e33cbc7a5
 [command] login: migrate command to clcommands api
 diff --git a/lgp/login.py b/lgp/login.py
 --- a/lgp/login.py
 +++ b/lgp/login.py
-@@ -1,83 +1,81 @@
+@@ -1,83 +1,87 @@
  # -*- coding: utf-8 -*-
 -# Copyright (c) 2003-2008 LOGILAB S.A. (Paris, FRANCE).
 +#
 +        dirname, basename = os.path.split(self.get_distrib_dir())
 +        return "'deb file://%s %s/'" % (dirname, basename)
 +
++    def guess_environment(self):
++        # if no default value for distribution, try to retrieve it from changelog
++        if self.config.distrib is None or 'changelog' in self.config.distrib:
++            self.config.distrib = 'changelog'
++        super(Login, self).guess_environment()
++
 +    def run(self, args):
 +        for arch in self.architectures:
 +            for distrib in self.distributions:
+DEBUG_INITIAL_LGP_STUFF_WITH_LOCAL_CONFIGURATION
 migration-clcommands.diff
 clcommands-clean.diff
 clcommands-project.diff
 refactor-pbuilderrc.diff
 clcommands-build-pristine.diff
 clcommands-build-source.diff
-DEBUG_LGP_STUFF_WITH_LOCAL_CONFIGURATION
 lgp-checker-update.diff
 build-multiprocess.diff
 logger-improvements.diff
 lgp-sign-process.diff
+DEBUG_LGP_STUFF_WITH_LOCAL_CONFIGURATION
 TODOLIST
 wip-lgp-build-source-improve.diff
 wip-login-x11.diff
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.