Re: dist-git tag question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 04.08.2010 07:05, Peter Hutterer wrote:
>
> I don't think git hashes are an equivalent to the nvr tags though. I may
> have multiple commits for each nvr, a tag that explicitly specifies which
> version ended up as an rpm in koji would be quite helpful. I have troubles
> remembering hashes long-term, nvr is marginally easier. it also simplifies
> things like "git diff foo-1.2-1..foo-1.2-2" or the automation of that
> process.
>
> Cheers,
>    Peter


I had similar problems identifying the correct git hash for my secondary arch rebuilds and complained about in in my blog on http://karstenhopp.livejournal.com/.
The attached patch adds a --commitinfo parameter to koji's buildinfo and latest-pkg commands.
P.e. koji  buildinfo --commitinfo hwdata-0.227-1.fc14 returns
git://pkgs.fedoraproject.org/hwdata?#21d5786ad6701422e71b3952ea3c8103c5ee72e2

The patch is for koji-1.4.0-2.fc13.noarch, but should be easy to adapt to latest


   Karsten
--- /usr/bin/koji	2010-07-09 04:04:26.000000000 +0200
+++ /home/devel/karsten/tmp/koji	2010-08-06 01:51:44.000000000 +0200
@@ -2058,6 +2058,7 @@
     parser.add_option("--all", action="store_true", help=_("List all of the latest packages for this tag"))
     parser.add_option("--quiet", action="store_true", help=_("Do not print the header information"), default=options.quiet)
     parser.add_option("--paths", action="store_true", help=_("Show the file paths"))
+    parser.add_option("--commitinfo", action="store_true", help=_("Show git commit information used for this build"))
     parser.add_option("--type", help=_("Show builds of the given type only.  Currently supported types: maven"))
     (options, args) = parser.parse_args(args)
     if len(args) == 0:
@@ -2105,6 +2106,12 @@
                     for x in data:
                         x['path'] = pathinfo.build(x)
                     fmt = "%(path)-40s  %(tag_name)-20s  %(owner_name)s"
+            if options.commitinfo:
+                for x in data:
+                    x['request'] = session.getTaskInfo(session.getBuild(x['build_id'])['task_id'], request=True)['request'][0]
+                    fmt = "%(request)-80s"
+                    options.quiet = True
+            # label = koji.taskLabel(self.info)
             else:
                 if options.type == 'maven':
                     fmt = "%(nvr)-40s  %(tag_name)-20s  %(maven_group_id)-20s  %(maven_artifact_id)-20s  %(owner_name)s"
@@ -2680,6 +2687,7 @@
     usage += _("\n(Specify the --help global option for a list of other help options)")
     parser = OptionParser(usage=usage)
     parser.add_option("--changelog", action="store_true", help=_("Show the changelog for the build"))
+    parser.add_option("--commitinfo", action="store_true", help=_("Show commit information used to build this package n-v-r"))
     (options, args) = parser.parse_args(args)
     if len(args) < 1:
         parser.error(_("Please specify a build"))
@@ -2692,26 +2700,29 @@
         if info is None:
             print "No such build: %s\n" % build
             continue
-        taglist = []
-        for tag in session.listTags(build):
-            taglist.append(tag['name'])
-        if info['epoch'] is None:
-            info['epoch'] = ""
+        if options.commitinfo:
+            print "%s" % session.getTaskInfo(info['task_id'], request=True)['request'][0]
         else:
-            info['epoch'] = str(info['epoch']) + ":"
-        info['name'] = info['package_name']
-        info['arch'] = 'src'
-        info['state'] = koji.BUILD_STATES[info['state']]
-        rpms = session.listRPMs(buildID=info['id'])
-        print "BUILD: %(name)s-%(version)s-%(release)s [%(id)d]" % info
-        print "State: %(state)s" % info
-        print "Built by: %(owner_name)s" % info
-        print "Task: %(task_id)s" % info
-        print "Finished: %s" % koji.formatTimeLong(info['completion_time'])
-        print "Tags: %s" % ' '.join(taglist)
-        print "RPMs:"
-        for rpm in rpms:
-            print os.path.join(koji.pathinfo.build(info), koji.pathinfo.rpm(rpm))
+            taglist = []
+            for tag in session.listTags(build):
+                taglist.append(tag['name'])
+            if info['epoch'] is None:
+                info['epoch'] = ""
+            else:
+                info['epoch'] = str(info['epoch']) + ":"
+            info['name'] = info['package_name']
+            info['arch'] = 'src'
+            info['state'] = koji.BUILD_STATES[info['state']]
+            rpms = session.listRPMs(buildID=info['id'])
+            print "BUILD: %(name)s-%(version)s-%(release)s [%(id)d]" % info
+            print "State: %(state)s" % info
+            print "Built by: %(owner_name)s" % info
+            print "Task: %(task_id)s" % info
+            print "Finished: %s" % koji.formatTimeLong(info['completion_time'])
+            print "Tags: %s" % ' '.join(taglist)
+            print "RPMs:"
+            for rpm in rpms:
+                print os.path.join(koji.pathinfo.build(info), koji.pathinfo.rpm(rpm))
         if options.changelog:
             changelog = session.getChangelogEntries(info['id'])
             if changelog:
-- 
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/devel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux