Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 406287 - Add remoteid tag in metadata.xml where possible
Summary: Add remoteid tag in metadata.xml where possible
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal QA (vote)
Assignee: Paweł Hajdan, Jr. (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-29 12:38 UTC by Corentin Chary (RETIRED)
Modified: 2012-05-30 06:48 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
fill-metadata-remotesid.diff (fill-metadata-remotesid.patch,298.52 KB, text/plain)
2012-02-29 12:40 UTC, Corentin Chary (RETIRED)
Details
metadata-dtd-add-pecl-pear-rubygems.patch (metadata-dtd-add-pecl-pear-rubygems.patch,670 bytes, text/plain)
2012-02-29 12:41 UTC, Corentin Chary (RETIRED)
Details
fill-metadata-remotesid-full.patch (fill-metadata-remotesid-full.patch,401.38 KB, text/plain)
2012-02-29 12:41 UTC, Corentin Chary (RETIRED)
Details
fill-remote-id-full.diff (fill-remote-id-full.diff.gz,124.78 KB, text/plain)
2012-04-02 15:13 UTC, Corentin Chary (RETIRED)
Details
fill-remote-id-vanilla.diff (fill-remote-id-vanilla.diff.gz,100.41 KB, text/plain)
2012-04-02 15:14 UTC, Corentin Chary (RETIRED)
Details
fill-remote-id-full.diff.gz (fill-remote-id-full.diff.gz,124.78 KB, text/plain)
2012-04-02 15:15 UTC, Corentin Chary (RETIRED)
Details
fill-remote-id-vanilla.diff.gz (fill-remote-id-vanilla.diff.gz,100.41 KB, application/octet-stream)
2012-04-02 15:16 UTC, Corentin Chary (RETIRED)
Details
metadata_dtd_add_new_remote_id_types.patch (metadata_dtd_add_new_remote_id_types.patch,696 bytes, patch)
2012-04-19 12:24 UTC, Corentin Chary (RETIRED)
Details | Diff
Updated, sorted metadata.dtd patch (new-remote-ids.diff,884 bytes, patch)
2012-04-23 17:54 UTC, Michał Górny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Corentin Chary (RETIRED) gentoo-dev 2012-02-29 12:38:54 UTC
I created a script that automatically patch metadata.xml when remoteid should be used. Currently it works for pypi, rubyforge, rubygems, google code, cpan, pecl and pear.

If interested, you may implement the missing rules for vim, cran, ctan and sourceforge.

The script is available here: https://github.com/iksaif/portage-janitor/blob/master/remoteids.py and should be run like that:
eix --only-names | python remoteids.py --diff

I also suggest to add pecl, pear and rubygems to metadata.dtd (patch will be attached).
Comment 1 Corentin Chary (RETIRED) gentoo-dev 2012-02-29 12:40:44 UTC
Created attachment 303721 [details]
fill-metadata-remotesid.diff

Patch produced by "eix --only-names | ./remoteids.py --diff"
Comment 2 Corentin Chary (RETIRED) gentoo-dev 2012-02-29 12:41:29 UTC
Created attachment 303723 [details]
metadata-dtd-add-pecl-pear-rubygems.patch

Add pecl, pear and rubygems to the list of remoteids.
Comment 3 Corentin Chary (RETIRED) gentoo-dev 2012-02-29 12:41:56 UTC
Created attachment 303725 [details]
fill-metadata-remotesid-full.patch

Patch produced by "eix --only-names | ./remoteids.py --diff" with additionals remoteids.
Comment 4 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2012-02-29 12:52:05 UTC
Why is the tool rewriting unrelated tags like this?

-  <flag name = 'espeak'>Adds support for the espeak tts engine</flag>
+  <flag name="espeak">Adds support for the espeak tts engine</flag>

Also, sometimes indentation seems to be off like here:

--- a/app-admin/phpsyslogng/metadata.xml
+++ b/app-admin/phpsyslogng/metadata.xml
@@ -8,4 +8,7 @@
 	<email>matthias@dsx.at</email>
 	<name>Matthias Schöffmann</name>
 </maintainer>
+        <upstream>
+                <remote-id type="google-code">php-syslog-ng</remote-id>
+        </upstream>
 </pkgmetadata>
Comment 5 Corentin Chary (RETIRED) gentoo-dev 2012-02-29 13:02:33 UTC
The tool parse the xml, update it, and output it. It seems that the python xml parser tends to fix xml the xml (remove spaces, replace ' with "). I think the patch will have to be hand-edited to remove these changes.

Yes, the indentation is not always correct, it's very hard to make it work correctly since all metadata.xml are not indented the same way, but most of the time it works (except when non-root tag like maintainer or herd are not indented at all).
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2012-02-29 15:39:13 UTC
Filing one huge bug report with multiple teams having to change things rarely works. So consider turning this bug into a tracker (just add "Tracker" to the Keywords field), and file new bug reports aimed at separate packages/categories that block this one.
Comment 7 Corentin Chary (RETIRED) gentoo-dev 2012-02-29 16:18:06 UTC
Hmm, 93 categories are impacted by this bug, I don't think I'll create 93 bugs. I'll try to script that to group patchs by herds and/or maintainers, see how many group there are.
Comment 8 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2012-04-02 06:38:53 UTC
I've checked in most of the patch (with my formatting fixes).
Comment 9 Corentin Chary (RETIRED) gentoo-dev 2012-04-02 15:10:28 UTC
(In reply to comment #8)
> I've checked in most of the patch (with my formatting fixes).

Did you also add pecl, pear and rubygems to metadata.dtd or did you merge the minimal patch ?

By the way, I just pushed a script update:
- Added CRAN/CTAN/Sourceforge support
- Fixed Pecl and PEAR
- Guess remote-id using HOMEPAGE
- Remove package version from remote-id
- Added github/bitbucket/gitorious support (not yet in metadata.dtd !!)
- Now almost always preserve old XML indentation style (no more unrelated changes)

You can use "--vanilla" to use only remote id types defined in /usr/portage/metadata/dtd/metadata.dtd.
Comment 10 Corentin Chary (RETIRED) gentoo-dev 2012-04-02 15:13:09 UTC
Created attachment 307503 [details]
fill-remote-id-full.diff

Patch generated with current portage tree and new remoteid.py script

$ python remoteids.py --diff --all > fill-remote-id-full.diff
Comment 11 Corentin Chary (RETIRED) gentoo-dev 2012-04-02 15:14:01 UTC
Created attachment 307507 [details]
fill-remote-id-vanilla.diff

Patch generated with current portage tree and new remoteid.py script

$ python remoteids.py --diff --all --vanilla > fill-remote-id-vanilla.diff
Comment 12 Corentin Chary (RETIRED) gentoo-dev 2012-04-02 15:15:43 UTC
Created attachment 307509 [details]
fill-remote-id-full.diff.gz
Comment 13 Corentin Chary (RETIRED) gentoo-dev 2012-04-02 15:16:34 UTC
Created attachment 307511 [details]
fill-remote-id-vanilla.diff.gz
Comment 14 Corentin Chary (RETIRED) gentoo-dev 2012-04-19 12:24:40 UTC
Created attachment 309505 [details, diff]
metadata_dtd_add_new_remote_id_types.patch

Add rubygems, github, gitorious, pecl, pear, bitbucket.
All of them are handled by my script.
Comment 15 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-04-23 17:54:03 UTC
Created attachment 309869 [details, diff]
Updated, sorted metadata.dtd patch

(from the mailing list)
Comment 16 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-04-23 17:55:18 UTC
CC-ing so they'll update metadata.dtd.
Comment 17 Alec Warner (RETIRED) archtester gentoo-dev Security 2012-05-30 06:48:28 UTC
done.