createrepo/__init__.py genpkgmetadata.py

[email protected]
Newsgroups gmane.linux.rpm.metadata
Message-ID <[email protected]>
 createrepo/__init__.py |    1 +
 genpkgmetadata.py      |   12 +++++++-----
 2 files changed, 8 insertions(+), 5 deletions(-)

New commits:
commit 36fced853e6a10280865fd618a42ac3d85395b73
Author: Seth Vidal <[email protected]>
Date:   Thu Jan 22 11:30:08 2009 -0500

    add --profile option to the cli interface so profile info is outputted
    only when it is used.

diff --git a/createrepo/__init__.py b/createrepo/__init__.py
index 3e65a6d..960dc80 100644
--- a/createrepo/__init__.py
+++ b/createrepo/__init__.py
@@ -52,6 +52,7 @@ class MetaDataConfig(object):
     def __init__(self):
         self.quiet = False
         self.verbose = False
+        self.profile = False
         self.excludes = []
         self.baseurl = None
         self.groupfile = None
diff --git a/genpkgmetadata.py b/genpkgmetadata.py
index a98c623..ca77a3a 100755
--- a/genpkgmetadata.py
+++ b/genpkgmetadata.py
@@ -41,6 +41,8 @@ def parseArgs(args, conf):
                       help="output nothing except for serious errors")
     parser.add_option("-v", "--verbose", default=False, action="store_true",
                       help="output more debugging info.")
+    parser.add_option("--profile", default=False, action="store_true",
+                      help="output timing/profile info.")
     parser.add_option("-x", "--excludes", default=[], action="append",
                       help="files to exclude")
     parser.add_option("--basedir", default=os.getcwd(),
@@ -166,7 +168,7 @@ def main(args):
     start_st = time.time()
     conf = createrepo.MetaDataConfig()
     conf = parseArgs(args, conf)
-    if conf.verbose:
+    if conf.profile:
         print ('start time: %0.3f' % (time.time() - start_st))
 
     mid_st = time.time()       
@@ -180,20 +182,20 @@ def main(args):
                     print _('repo is up to date')
                 sys.exit(0)
 
-        if conf.verbose:
+        if conf.profile:
             print ('mid time: %0.3f' % (time.time() - mid_st))
                 
         pm_st = time.time()
         mdgen.doPkgMetadata()
-        if conf.verbose:
+        if conf.profile:
             print ('pm time: %0.3f' % (time.time() - pm_st))
         rm_st = time.time()
         mdgen.doRepoMetadata()
-        if conf.verbose:
+        if conf.profile:
             print ('rm time: %0.3f' % (time.time() - rm_st))
         fm_st = time.time()       
         mdgen.doFinalMove()
-        if conf.verbose:
+        if conf.profile:
             print ('fm time: %0.3f' % (time.time() - fm_st))
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.