[packages/adapter: 565/631] adapter: replace pythoneggs virtuals with package names if found match

glen glen at pld-linux.org
Mon Sep 12 20:21:48 CEST 2016


commit 3d5a56db80501d6001ef6fd7154a6f5876f463d5
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sun Jan 27 17:38:17 2013 +0200

    adapter: replace pythoneggs virtuals with package names if found match

 adapter.awk | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)
---
diff --git a/adapter.awk b/adapter.awk
index d1b1779..ab95e4c 100644
--- a/adapter.awk
+++ b/adapter.awk
@@ -1964,7 +1964,7 @@ function replace_groupnames(group) {
 	return group;
 }
 
-function replace_pkgconfig(pkg,    cmd, path, n, i, line, r) {
+function replace_pkgconfig(pkg,    cmd, path, n, i, line) {
 	n = split("/usr/lib64/pkgconfig /usr/lib/pkgconfig /usr/share/pkgconfig", path, / /);
 	for (i = 1; i <= n; i++) {
 		cmd = "rpm -qf --qf '%{N}' " path[i] "/" pkg ".pc";
@@ -1981,6 +1981,20 @@ function replace_pkgconfig(pkg,    cmd, path, n, i, line, r) {
 	}
 }
 
+function replace_pythonegg(pkg,    cmd, line) {
+	cmd = "rpm -q --qf '%{N}' --whatprovides 'pythonegg(" 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;
+	}
+}
+
 function replace_requires(field,   pkg) {
 	# pkg-config -> package names
 	if (match($2, /pkgconfig\(([^)]+)\)/)) {
@@ -1988,6 +2002,12 @@ function replace_requires(field,   pkg) {
 		replace_pkgconfig(pkg);
 	}
 
+	# pythonegg -> package names
+	if (match($2, /pythonegg\(([^)]+)\)/)) {
+		pkg = substr($2, RSTART + 10, RLENGTH - 11);
+		replace_pythonegg(pkg);
+	}
+
 	sub(/^python-setuptools-devel$/, "python-distribute", $2);
 	sub(/^gcc-g77/, "gcc-fortran", $2);
 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/adapter.git/commitdiff/6ca0126d4d0c8c79feb7db10b0a0fade0f3b8885



More information about the pld-cvs-commit mailing list