Closes #9929: improve dialog messages

authorJulien Jehannet <julien.jehannet@logilab.fr>
changesetf15b3dc749c9
branchdefault
phasepublic
hiddenno
parent revision#9c1a4c8b49d7 don't print traceback when missing parts (less ugly)
child revision#e87f916ab822 Closes #9938: no repository name check (or unvalid)
files modified by this revision
ldi.py
# HG changeset patch
# User Julien Jehannet <julien.jehannet@logilab.fr>
# Date 1250589425 -7200
# Tue Aug 18 11:57:05 2009 +0200
# Node ID f15b3dc749c9d6d3268b90f48a5743f1f6fffee9
# Parent 9c1a4c8b49d72c0644ff5e1bb17ff708f257d50a
Closes #9929: improve dialog messages

diff --git a/ldi.py b/ldi.py
@@ -203,16 +203,18 @@
1              else:
2                  shellutil = sht.cp
3              self.perform_changes_file(filename, destdir, shellutil)
4 
5      def perform_changes_file(self, changes_file, destdir, shellutil=sht.cp):
6 -        self.logger.info("%sing of '%s'..." % (self.__class__.__name__, changes_file))
7          arguments = Changes(changes_file).get_all_files()
8          pristine_included = [f for f in arguments if f.endswith('.orig.tar.gz')]
9          distrib = osp.basename(destdir)
10          section = osp.basename(osp.dirname(destdir))
11          repository = osp.basename(osp.dirname(osp.dirname(destdir)))
12 +        self.logger.info("%s/%s: %s %sed" % (repository, distrib,
13 +                                             osp.basename(changes_file),
14 +                                             self.__class__.__name__.lower()))
15 
16          # Logilab uses trivial Debian repository and put all generated files in
17          # the same place. Badly, it occurs some problems in case of several 
18          # supported architectures and multiple Debian revision (in this order)
19          if shellutil != sht.cp:
@@ -251,12 +253,10 @@
20                  filename = osp.join(destdir, osp.basename(filename))
21                  sht.chown(filename, group=self.group)
22                  os.chmod(filename, 0664)
23              else: # sht.rm
24                  shellutil(filename)
25 -        self.logger.info("%sed in '%s' section of the '%s' distribution."
26 -                         % (self.__class__.__name__, section, distrib))
27 
28      def _find_changes_files(self, repository, section, distrib=None):
29          changes = []
30          path = self._check_repository(repository, section)
31          for root, dirs, files in os.walk(path):
@@ -328,17 +328,17 @@
32 
33                  # mark distribution to be refreshed at the end
34                  distribs.add(distrib)
35 
36              if self.options.refresh:
37 -                self.logger.info('force refreshing whole repository %s...' % repository)
38                  self._apt_refresh(repodir, aptconf)
39 +                self.logger.info('%s/*: index files generated' % repository)
40              elif distribs:
41                  for distrib in distribs:
42 -                    self.logger.info('refreshing distribution %s in repository %s...'
43 -                                     % (distrib, repository))
44                      self._apt_refresh(repodir, aptconf, distrib)
45 +                    self.logger.info('%s/%s: index files generated'
46 +                                    % (repository, distrib))
47 
48          finally:
49              sht.release_lock(LOCK_FILE)
50 
51      def _sign_repo(self, repository):
@@ -350,11 +350,10 @@
52                              self.group)
53 
54      def _apt_refresh(self, repodir, aptconf, distrib="*"):
55          for destdir in glob.glob(osp.join(repodir, 'dists', distrib)):
56              if osp.isdir(destdir) and not osp.islink(destdir):
57 -                self.logger.info('generate index files in %s' % destdir)
58                  apt_ftparchive.clean(destdir)
59                  apt_ftparchive.generate(destdir, aptconf, self.group)
60                  apt_ftparchive.release(destdir, aptconf, self.group,
61                                         osp.basename(destdir))
62                  self._sign_repo(destdir)