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

Bug#833623: marked as done (tracker.d.o: add multiarch hints)



Your message dated Wed, 14 Sep 2016 10:27:56 +0200
with message-id <20160914082756.6fndo53bdnyj7kep@home.ouaza.com>
and subject line Re: Bug#833623: tracker.d.o: add multiarch hints
has caused the Debian Bug report #833623,
regarding tracker.d.o: add multiarch hints
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
833623: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=833623
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: tracker.debian.org
Severity: wishlist
X-Debbugs-CC: Helmut Grohne <helmutg@debian.org>, Johannes Schauer <josch@debian.org>
Tags: patch

I've attached a patch to implement adding multiarch hints to
tracker.d.o. These multiarch hints are aimed at improving Debian's
multiarch support by adding multiarch metadata and fixing file
conflicts. The service providing them is run by Helmut Grohne.

-- 
bye,
pabs

https://wiki.debian.org/PaulWise
From 8aa11b6448ed78ac52a008f827ef6f362d1f217c Mon Sep 17 00:00:00 2001
From: Paul Wise <pabs@debian.org>
Date: Sun, 7 Aug 2016 14:46:36 +0800
Subject: [PATCH] Add multiarch hints

---
 .../debian/templates/debian/multiarch-hints.html   |  8 +++
 distro_tracker/vendor/debian/tracker_tasks.py      | 73 ++++++++++++++++++++++
 2 files changed, 81 insertions(+)
 create mode 100644 distro_tracker/vendor/debian/templates/debian/multiarch-hints.html

diff --git a/distro_tracker/vendor/debian/templates/debian/multiarch-hints.html b/distro_tracker/vendor/debian/templates/debian/multiarch-hints.html
new file mode 100644
index 0000000..6679540
--- /dev/null
+++ b/distro_tracker/vendor/debian/templates/debian/multiarch-hints.html
@@ -0,0 +1,8 @@
+<div>
+There are issues with the <a href="https://wiki.debian.org/MultiArch";>multiarch</a> data for this package.
+<ul>
+{% for desc, link in item.extra_data %}
+<li><a href="{{ link }}">{{ desc }}</a></li>
+{% endfor %}
+</ul>
+</div>
diff --git a/distro_tracker/vendor/debian/tracker_tasks.py b/distro_tracker/vendor/debian/tracker_tasks.py
index c7f053e..e76a517 100644
--- a/distro_tracker/vendor/debian/tracker_tasks.py
+++ b/distro_tracker/vendor/debian/tracker_tasks.py
@@ -2371,3 +2371,76 @@ class UpdateBuildReproducibilityTask(BaseTask):
             ActionItem.objects.delete_obsolete_items([self.action_item_type],
                                                      packages)
             PackageExtractedInfo.objects.bulk_create(extracted_info)
+
+
+class MultiArchHintsTask(BaseTask):
+    ACTIONS_WEB = 'https://wiki.debian.org/MultiArch/Hints'
+    ACTIONS_URL = 'https://dedup.debian.net/static/multiarch-hints.yaml'
+    ACTION_ITEM_TYPE_NAME = 'debian-multiarch-hints'
+    ACTION_ITEM_TEMPLATE = 'debian/multiarch-hints.html'
+    ACTION_ITEM_DESCRIPTION = '<a href="{link}">Multiarch hinter</a> reports {count} issue(s)'
+
+    def __init__(self, force_update=False, *args, **kwargs):
+        super(MultiArchHintsTask, self).__init__(*args, **kwargs)
+        self.force_update = force_update
+        self.action_item_type = ActionItemType.objects.create_or_update(
+            type_name=self.ACTION_ITEM_TYPE_NAME,
+            full_description_template=self.ACTION_ITEM_TEMPLATE)
+        self.SEVERITIES = {}
+        for value, name in ActionItem.SEVERITIES:
+            self.SEVERITIES[name] = value
+
+    def set_parameters(self, parameters):
+        if 'force_update' in parameters:
+            self.force_update = parameters['force_update']
+
+    def get_data(self):
+        return get_resource_content(self.ACTIONS_URL)
+
+    def get_packages(self):
+        data = self.get_data()
+        data = yaml.safe_load(data)
+        format = data['multiarch-hints-1.0']
+        data = data['hints']
+        packages = {}
+        for item in data:
+            if 'source' not in item:
+                continue
+            package = item['source']
+            if package not in packages:
+                packages[package] = {}
+            wishlist = ActionItem.SEVERITY_WISHLIST
+            severity = self.SEVERITIES.get(item['severity'], wishlist)
+            packages[package]['severity'] = max(severity, hints[package].get('severity', wishlist))
+            if 'hints' not in packages[package]:
+                packages[package]['hints'] = []
+            packages[package]['hints'].append((item['description'], item['link']))
+        return packages
+
+    def update_action_item(self, package, severity, description, extra_data):
+        action_item = package.get_action_item_for_type(self.action_item_type.type_name)
+        if action_item is None:
+            action_item = ActionItem(
+                package=package,
+                item_type=self.action_item_type)
+        action_item.severity = severity
+        action_item.short_description = description
+        action_item.extra_data = extra_data
+        action_item.save()
+
+    def execute(self):
+        packages = self.get_packages()
+        if packages is None:
+            return
+
+        with transaction.atomic():
+            for name, data in packages.items():
+                try:
+                    package = SourcePackageName.objects.get(name=name)
+                except SourcePackageName.DoesNotExist:
+                    continue
+
+                description = ACTION_ITEM_DESCRIPTION.format(count=len(data['hints']), link=self.ACTIONS_WEB)
+                self.update_action_item(package, severity, description, data['hints'])
+
+            ActionItem.objects.delete_obsolete_items([self.action_item_type], packages.keys())
-- 
2.8.1

Attachment: signature.asc
Description: This is a digitally signed message part


--- End Message ---
--- Begin Message ---
On Sat, 27 Aug 2016, Paul Wise wrote:
> No, I lack any easy way to do that like I did with the PTS.

It's not that hard to run distro-tracker on your laptop. Feel free to
ask me questions if you need guidance. It's supposed to be documented
in the contributing section of the doc.

> If you are able to test the attached updated patch that would be
> appreciated, I'm not able to at this point in time.

I tested it and found multiple other small problems that I fixed. It's now
deployed. The hints wil show up shortly the next time the task are run by
cron.

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Support Debian LTS: http://www.freexian.com/services/debian-lts.html
Learn to master Debian: http://debian-handbook.info/get/

--- End Message ---

Reply to: