Julien Jehannet avatar Julien Jehannet committed aecfe65

merge redefine-guess-environment.diff

Comments (0)

Files changed (3)

redefine-guess-environment.diff

-# HG changeset patch
-# Date 1304126672 -7200
-# User Julien Jehannet <julien@smaf.org>
-# Parent 2270bf61011dab37734b13daaf50aac6b652b0c8
-
-diff --git a/lgp/setupinfo.py b/lgp/setupinfo.py
---- a/lgp/setupinfo.py
-+++ b/lgp/setupinfo.py
-@@ -204,30 +204,25 @@ class SetupInfo(clcommands.Command):
- 
-     def go_into_package_dir(self, arguments):
-         """go into package directory"""
--        # XXX move to LgpCommandCli
--        if self.config.pkg_dir is None:
--            if arguments and os.path.exists(arguments[0]):
-+        if arguments:
-+            if os.path.exists(arguments[0]):
-                 self.config.pkg_dir = osp.abspath(arguments[0])
-             else:
--                self.config.pkg_dir = os.getcwd()
--        try:
-+                raise LGPException("directory doesn't exist: %s" % arguments[0])
-             if os.path.isfile(self.config.pkg_dir):
-                 self.config.pkg_dir = os.path.dirname(self.config.pkg_dir)
--            # FIXME Keep working relative pathnames provided in line arguments after chdir
--            if getattr(self.config, "orig_tarball", None) and osp.exists(self.config.orig_tarball):
--                # we use osp.exists to rewrite only with valid path name
--                # (since this option accept url path name as well)
--                self.config.orig_tarball = osp.abspath(osp.expanduser(self.config.orig_tarball))
-             os.chdir(self.config.pkg_dir)
-             self.logger.debug('change the current working directory to: %s' % self.config.pkg_dir)
--        except OSError, err:
--            raise LGPException(err)
-+        else:
-+            self.config.pkg_dir = os.getcwd()
-+
-+        # FIXME Keep working relative pathnames provided in line arguments after chdir
-+        if getattr(self.config, "orig_tarball", None) and osp.exists(self.config.orig_tarball):
-+            # we use osp.exists to rewrite only with valid path name
-+            # (since this option accept url path name as well)
-+            self.config.orig_tarball = osp.abspath(osp.expanduser(self.config.orig_tarball))
- 
-     def guess_environment(self):
--        # no default value for distribution. Try to retrieve it in changelog
--        if self.config.distrib is None or 'changelog' in self.config.distrib:
--            self.config.distrib = utils.guess_debian_distribution()
--
-         # just a warning issuing for possibly confused configuration
-         if self.config.archi and 'all' in self.config.archi:
-             self.logger.warn('the "all" keyword can be confusing about the '
-diff --git a/lgp/utils.py b/lgp/utils.py
---- a/lgp/utils.py
-+++ b/lgp/utils.py
-@@ -152,7 +152,9 @@ def get_distributions(distrib=None, base
-                    'None' to detect available images by cdebootstrap
-     param basetgz: location of the pbuilder images
-     """
--    if distrib is None:
-+    if distrib is "changelog":
-+        distrib = guess_debian_distribution()
-+    elif distrib is None:
-         distrib = [osp.basename(f).split('.', 1)[0]
-                    for f in glob.glob(osp.join(LGP_SUITES,'*'))]
-     elif 'all' in distrib or len(distrib)==0:

refactor-pbuilderrc.diff

 # HG changeset patch
-# Date 1304121693 -7200
+# Date 1304127128 -7200
 # User Julien Jehannet <julien@smaf.org>
-# Parent 399ac5c1edef91b77a79b0e1438fba85c43975b4
+# Parent 42e81563da607853719f72436686b9b313c86c1f
 lgp: large refactoring of pbuilder config scripts
 
 Changes:
 +            if exc.errno != errno.EEXIST:
 +                raise
          return distrib_dir
+diff --git a/lgp/setupinfo.py b/lgp/setupinfo.py
+--- a/lgp/setupinfo.py
++++ b/lgp/setupinfo.py
+@@ -192,30 +192,25 @@ class SetupInfo(clcommands.Command):
+ 
+     def go_into_package_dir(self, arguments):
+         """go into package directory"""
+-        # XXX move to LgpCommandCli
+-        if self.config.pkg_dir is None:
+-            if arguments and os.path.exists(arguments[0]):
++        if arguments:
++            if os.path.exists(arguments[0]):
+                 self.config.pkg_dir = osp.abspath(arguments[0])
+             else:
+-                self.config.pkg_dir = os.getcwd()
+-        try:
++                raise LGPException("project directory doesn't exist: %s" % arguments[0])
+             if os.path.isfile(self.config.pkg_dir):
+                 self.config.pkg_dir = os.path.dirname(self.config.pkg_dir)
+-            # FIXME Keep working relative pathnames provided in line arguments after chdir
+-            if getattr(self.config, "orig_tarball", None) and osp.exists(self.config.orig_tarball):
+-                # we use osp.exists to rewrite only with valid path name
+-                # (since this option accept url path name as well)
+-                self.config.orig_tarball = osp.abspath(osp.expanduser(self.config.orig_tarball))
+             os.chdir(self.config.pkg_dir)
+-            logging.debug('change the current working directory to: %s' % self.config.pkg_dir)
+-        except OSError, err:
+-            raise LGPException(err)
++            self.logger.debug('change the current working directory to: %s' % self.config.pkg_dir)
++        else:
++            self.config.pkg_dir = os.getcwd()
++
++        # FIXME Keep working relative pathnames provided in line arguments after chdir
++        if getattr(self.config, "orig_tarball", None) and osp.exists(self.config.orig_tarball):
++            # we use osp.exists to rewrite only with valid path name
++            # (since this option accept url path name as well)
++            self.config.orig_tarball = osp.abspath(osp.expanduser(self.config.orig_tarball))
+ 
+     def guess_environment(self):
+-        # no default value for distribution. Try to retrieve it in changelog
+-        if self.config.distrib is None or 'changelog' in self.config.distrib:
+-            self.config.distrib = utils.guess_debian_distribution()
+-
+         # just a warning issuing for possibly confused configuration
+         if self.config.archi and 'all' in self.config.archi:
+             logging.warn('the "all" keyword can be confusing about the '
 diff --git a/lgp/utils.py b/lgp/utils.py
 --- a/lgp/utils.py
 +++ b/lgp/utils.py
-@@ -149,9 +149,8 @@ def get_distributions(distrib=None, base
+@@ -148,10 +148,11 @@ def get_distributions(distrib=None, base
+                    'None' to detect available images by cdebootstrap
      param basetgz: location of the pbuilder images
      """
-     if distrib is None:
+-    if distrib is None:
 -        import email
 -        distrib = email.message_from_file(file(suites))
 -        distrib = [i.split()[1] for i in distrib.get_payload().split('\n\n') if i]
++    if distrib is "changelog":
++        distrib = guess_debian_distribution()
++    elif distrib is None:
 +        distrib = [osp.basename(f).split('.', 1)[0]
 +                   for f in glob.glob(osp.join(LGP_SUITES,'*'))]
      elif 'all' in distrib or len(distrib)==0:
 logger-improvements.diff
 lgp-sign-process.diff
 wip-lgp-check-repository.diff:
-redefine-guess-environment.diff
 wip-lgp-build-source-improve.diff
 TODOLIST
 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.