From 6272280fcf5bb15866237d68c7812a36079e57ae Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 13 Apr 2016 08:53:26 +0200 Subject: [PATCH] xbps-uhelper: support 'XBPS_{,TARGET_}ARCH' env vars in the 'arch' target. --- NEWS | 4 ++++ bin/xbps-uhelper/main.c | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index ee666068..c2c02c9e 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,9 @@ xbps-0.52 (???): + * xbps-uhelper: the 'arch' target now supports the XBPS_ARCH + and XBPS_TARGET_ARCH environmental variables to override the + resulting architecture. + * portableproplib: merged two fixes from NetBSD CVS HEAD. * xbps-create(1): this now creates reproducible pkgs when the file diff --git a/bin/xbps-uhelper/main.c b/bin/xbps-uhelper/main.c index 2978e14e..7211b707 100644 --- a/bin/xbps-uhelper/main.c +++ b/bin/xbps-uhelper/main.c @@ -280,7 +280,11 @@ main(int argc, char **argv) if (argc != 1) usage(); - printf("%s\n", xh.native_arch); + if (xh.native_arch && xh.target_arch && strcmp(xh.native_arch, xh.target_arch)) { + printf("%s\n", xh.target_arch); + } else { + printf("%s\n", xh.native_arch); + } } else if (strcmp(argv[0], "getsystemdir") == 0) { /* returns the xbps system directory (/xbps.d) */ if (argc != 1)