commit:     dad100bf745aef2739c56ac53c7d34c84956c0eb
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 25 21:55:01 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Jan 26 08:28:43 2022 +0000
URL:        https://gitweb.gentoo.org/proj/gentoo-syntax.git/commit/?id=dad100bf

newmetadata: Include pypi remote-id

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Closes: https://github.com/gentoo/gentoo-syntax/pull/38
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 plugin/newmetadata.vim | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/plugin/newmetadata.vim b/plugin/newmetadata.vim
index 356bb8c..82f5e07 100644
--- a/plugin/newmetadata.vim
+++ b/plugin/newmetadata.vim
@@ -27,6 +27,8 @@ fun! <SID>MakeNewMetadata()
     else
         let l:category = substitute(l:filename,
                     \ "^.*/\\([^/]\\+\\)/[^/]\\+/metadata\\.xml", "\\1", "g")
+        let l:package = substitute(l:filename,
+                    \ "^.*/\\([^/]\\+\\)/metadata\\.xml", "\\1", "g")
         let l:iscatmetadata = 0
         let l:user = GentooGetUser()
         let l:email = matchstr(l:user, "\\(<\\)\\@<=[^>]\\+\\(>\\)\\@=")
@@ -83,6 +85,11 @@ fun! <SID>MakeNewMetadata()
             put ='<name>' . l:name . '</name>'
         endif
         put ='</maintainer>'
+        if l:category ==# "dev-python"
+            put ='<upstream>'
+            put ='<remote-id type=\"pypi\">' . l:package . '</remote-id>'
+            put ='</upstream>'
+        endif
         put ='</pkgmetadata>'
         exec "normal gg=G"
         " }}}

Reply via email to