summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch
blob: 2eb6e0f26bfa3ff59a11728cb190e32902a3ed4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Debug the platform score generation...

Index: rpm-5.4.14/lib/rpmrc.c
===================================================================
--- rpm-5.4.14.orig/lib/rpmrc.c
+++ rpm-5.4.14/lib/rpmrc.c
@@ -465,6 +465,8 @@ static rpmRC rpmPlatform(const char * pl
 
     rc = (rpmRC) rpmiobSlurp(platform, &iob);
 
+    fprintf(stderr, "D: rpmPlatform file %s\n", platform);
+
     if (rc || iob == NULL) {
 	rc = RPMRC_FAIL;
 	goto exit;
@@ -486,6 +488,7 @@ static rpmRC rpmPlatform(const char * pl
 	    while (--t > p && xisspace(*t))
 		*t = '\0';
 	    if (t > p) {
+		fprintf(stderr, "D: rpmPlatform mireAppend REGEX %s\n", p);
 		xx = mireAppend(RPMMIRE_REGEX, 0, p, NULL, &mi_re, &mi_nre);
 	    }
 	    continue;
@@ -503,6 +506,11 @@ static rpmRC rpmPlatform(const char * pl
 		_gnu = rpmExpand("-", cvog->gnu, NULL);
 
 	    addMacro(NULL, "_platform_gnu", NULL, (_gnu ? _gnu : ""), -1);
+	    fprintf(stderr, "D: rpmPlatform addMacro %s-%s-%s(%s)\n",
+	    	rpmExpand("%{_platform_cpu}", NULL),
+		rpmExpand("%{_platform_vendor}", NULL),
+		rpmExpand("%{_platform_os}", NULL),
+		rpmExpand("%{_platform_gnu}", NULL));
 #else
 	    addMacro(NULL, "_host_cpu", NULL, cvog->cpu, -1);
 	    addMacro(NULL, "_host_vendor", NULL, cvog->vendor, -1);
@@ -510,6 +518,7 @@ static rpmRC rpmPlatform(const char * pl
 #endif
 	}
 
+	fprintf(stderr, "D: rpmPlatform mireAppend STRCMP %s -- ", p);
 #if !defined(RPM_VENDOR_OE) /* Skip the explicit-platform */
 #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */
 	/* do not use vendor and GNU attribution */
@@ -519,6 +528,7 @@ static rpmRC rpmPlatform(const char * pl
 		(cvog && *cvog->gnu ? "-" : NULL),
 		(cvog ? cvog->gnu : NULL), NULL);
 #endif
+	fprintf(stderr, "%s\n", p);
 	xx = mireAppend(RPMMIRE_STRCMP, 0, p, NULL, &mi_re, &mi_nre);
 	p = _free(p);
 #endif
@@ -688,9 +698,12 @@ int rpmPlatformScore(const char * platfo
 
     if ((mire = (miRE) mi_re) != NULL)
     for (i = 0; i < mi_nre; i++) {
-	if (mireRegexec(mire + i, platform, 0) >= 0)
+	if (mireRegexec(mire + i, platform, 0) >= 0) {
+	    fprintf(stderr, "D: rpmPlatformScore %s (%d)\n", platform, i + 1);
 	    return (i + 1);
+	}
     }
+    fprintf(stderr, "D: rpmPlatformScore %s (%d)\n", platform, 0);
     return 0;
 }
 /*@=onlytrans@*/