#189 [rpmbuild] introspection and --version argument
Merged 6 years ago by clime. Opened 6 years ago by praiskup.
Unknown source rpmbuild-introspection  into  master

file modified
+8
@@ -12,6 +12,8 @@

  import pprint

  import tempfile

  import stat

+ import pipes

+ import pkg_resources

  

  from simplejson.scanner import JSONDecodeError

  
@@ -62,6 +64,9 @@

      parser.add_argument("--drop-resultdir",  action="store_true", help="Drops resultdir and its content "

                                                                          "at the beggining before continuing.")

  

+     version = pkg_resources.require('copr-rpmbuild')[0].version

+     parser.add_argument("--version", action="version", version="%(prog)s version " + version)

+ 

      product = parser.add_mutually_exclusive_group()

      product.add_argument("--rpm", action="store_true", help="Build rpms. This is the default action.")

      product.add_argument("--srpm", action="store_true", help="Build srpm.")
@@ -87,6 +92,9 @@

      open(config.get("main", "logfile"), 'w').close() # truncate log

      log.addHandler(logging.FileHandler(config.get("main", "logfile")))

  

+     log.info('running: {0}'.format(" ".join(map(pipes.quote, sys.argv))))

+     log.info('version: {0}'.format(version))

+ 

      # Allow only one instance

      lockfd = os.open(config.get("main", "lockfile"), os.O_RDWR | os.O_CREAT)

      try:

no initial comment

it actually doesn't work as I would wish, at least the commandline arguments are not printed out into /var/lib/copr-rpmbuild/main.log ... so I'll update once I discover the issue.

rebased onto 054a8b65a02a9a7d722131884c06fddd07160f65

6 years ago

Fixed, it actually even broke the backend before -- because the log output was printed before the PID of --deatched process.

rebased onto cf9098d

6 years ago

Pull-Request has been merged by clime

6 years ago
Metadata