]> git.pld-linux.org Git - packages/adapter.git/commitdiff
replace perl(xxx) mods with actual package name if unversioned
authorElan Ruusamäe <glen@delfi.ee>
Thu, 4 Jun 2015 08:05:22 +0000 (11:05 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Thu, 4 Jun 2015 08:05:22 +0000 (11:05 +0300)
adapter.awk

index de742ea802f4e28a5ea7a8886ab6d30a7cd27f1e..f96ba77fc02fb4a4c49b0669e8fda828521f19a3 100644 (file)
@@ -2154,6 +2154,26 @@ function replace_pkgconfig(pkg,    cmd, path, n, i, line) {
 }
 # }}}
 
+# {{{ replace_perlmod(pkg)
+function replace_perlmod(pkg, version,   cmd, line) {
+       # do nothing if version is specified
+       if (version) {
+               return
+       }
+       cmd = "rpm -q --qf '%{N}\n' --whatprovides 'perl(" pkg ")' "
+
+       # Getline returns 0 on end-of-file, -1 on error, otherwise 1.
+       if ((cmd | getline line) <= 0) {
+               return
+       }
+
+       if (line !~ /no package provides/) {
+               # @modifies global $2
+               $2 = line
+               return
+       }
+}
+
 # {{{ replace_pythonegg(pkg)
 function replace_pythonegg(pkg,    cmd, line) {
        cmd = "rpm -q --qf '%{N}' --whatprovides 'pythonegg(" pkg ")'"
@@ -2188,6 +2208,12 @@ function replace_requires(field,   pkg) {
                replace_pythonegg(pkg)
        }
 
+       # perl() -> package names
+       if (match($2, /perl\(([^)]+)\)/)) {
+               pkg = substr($2, RSTART + 5, RLENGTH - 6)
+               replace_perlmod(pkg, $3)
+       }
+
        sub(/^python-setuptools-devel$/, "python-distribute", $2)
        sub(/^gcc-g77/, "gcc-fortran", $2)
 
This page took 0.037908 seconds and 4 git commands to generate.