From 972dcfcdbfe75dcfeb777150c136576cf1a71e99 Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Fri, 9 Oct 2015 22:59:03 +0200 Subject: initial commit for Enea Linux 5.0 arm Signed-off-by: Tudor Florea --- meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch | 136 ++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch (limited to 'meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch') diff --git a/meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch b/meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch new file mode 100644 index 0000000000..41ab498a0f --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch @@ -0,0 +1,136 @@ +lib/rpmrc.c: Update --target processing to support full GNU canonical arch + +Prior to this patch, when using --target, RPM supported the format: + + - + --gnu + -- + ---gnu + +This patch changes the list of supported items to: + + - + --gnu + -- + --- + +Upstream-Status: Pending + +Signed-off-by: Mark Hatle + +Index: rpm-5.4.14/lib/rpmrc.c +=================================================================== +--- rpm-5.4.14.orig/lib/rpmrc.c ++++ rpm-5.4.14/lib/rpmrc.c +@@ -925,8 +925,8 @@ static void getMachineInfo(int type, /*@ + + static void rpmRebuildTargetVars(const char ** target, const char ** canontarget) + { +- +- char *ca = NULL, *co = NULL, *ct = NULL; ++ /* ca = arch, cv = vendor, co = os, ce = extension, ct = canon target */ ++ char *ca = NULL, *cv = NULL, *co = NULL, *ce = NULL, *ct = NULL; + int x; + + /* Rebuild the compat table to recalculate the current target arch. */ +@@ -936,23 +936,60 @@ static void rpmRebuildTargetVars(const c + rpmSetTables(RPM_MACHTABLE_BUILDARCH, RPM_MACHTABLE_BUILDOS); + + if (target && *target) { ++ /* GNU canonical format is: ++ * --[-extension] ++ * ++ * We support the both the GNU canonical format ++ * as well as the traditional RPM formats: ++ * ++ * -[-gnu] ++ */ + char *c; + /* Set arch and os from specified build target */ + ca = xstrdup(*target); +- if ((c = strchr(ca, '-')) != NULL) { ++ if ((c = strchr(ca, '-')) == NULL) { ++ /* Format is */ ++ ; ++ } else { + *c++ = '\0'; +- +- if ((co = strrchr(c, '-')) == NULL) { +- co = c; ++ cv = c; ++ ++ if ((c = strchr(c, '-')) == NULL) { ++ /* Format is - */ ++ co = cv; ++ cv = NULL; + } else { +- if (!xstrcasecmp(co, "-gnu")) +- *co = '\0'; +- if ((co = strrchr(c, '-')) == NULL) +- co = c; +- else +- co++; ++ *c++ = '\0'; ++ co = c; ++ ++ if ((c = strchr(c, '-')) == NULL) { ++ /* Might be: ++ * -- ++ * --gnu ++ */ ++ if (!xstrcasecmp(co, "gnu")) { ++ /* Format was --gnu */ ++ ce = co; ++ co = cv; ++ cv = NULL; ++ } ++ } else { ++ /* Format was --- */ ++ *c++ = '\0'; ++ ce = c; ++ } + } ++ if (cv != NULL) cv = xstrdup(cv); + if (co != NULL) co = xstrdup(co); ++ if (ce != NULL) { ++ /* We need to prefix it with a "-" */ ++ char * lce = NULL; ++ ++ lce = xmalloc(strlen(ce) + sizeof("-")); ++ sprintf(lce, "-%s", ce); ++ ++ ce = lce; ++ } + } + } else { + const char *a = NULL; +@@ -995,8 +1032,16 @@ static void rpmRebuildTargetVars(const c + addMacro(NULL, "_target", NULL, ct, RMIL_RPMRC); + delMacro(NULL, "_target_cpu"); + addMacro(NULL, "_target_cpu", NULL, ca, RMIL_RPMRC); ++ if (cv) { ++ delMacro(NULL, "_target_vendor"); ++ addMacro(NULL, "_target_vendor", NULL, cv, RMIL_RPMRC); ++ } + delMacro(NULL, "_target_os"); + addMacro(NULL, "_target_os", NULL, co, RMIL_RPMRC); ++ if (ce) { ++ delMacro(NULL, "_gnu"); ++ addMacro(NULL, "_gnu", NULL, ce, RMIL_RPMRC); ++ } + + if (canontarget) + *canontarget = ct; +@@ -1004,8 +1049,12 @@ static void rpmRebuildTargetVars(const c + ct = _free(ct); + ca = _free(ca); + /*@-usereleased@*/ ++ cv = _free(cv); ++ /*@-usereleased@*/ + co = _free(co); + /*@=usereleased@*/ ++ ce = _free(ce); ++ /*@-usereleased@*/ + } + + void rpmFreeRpmrc(void) -- cgit v1.2.3-54-g00ecf