Fix #69 (No way to set globally a custom architecture)
The "architecture" configuration keyword is now available to override the native machine architecture returned by (uname(2)). The XBPS_ARCH environment variable still has preference.
This commit is contained in:
@@ -45,7 +45,7 @@ usage(void)
|
||||
" Available actions:\n"
|
||||
" binpkgarch, binpkgver, cmpver, digest, fetch, getpkgdepname,\n"
|
||||
" getpkgname, getpkgrevision, getpkgversion, pkgmatch, version,\n"
|
||||
" real-version.\n"
|
||||
" real-version, arch.\n"
|
||||
"\n"
|
||||
" Action arguments:\n"
|
||||
" binpkgarch\t<binpkg>\n"
|
||||
@@ -138,6 +138,7 @@ main(int argc, char **argv)
|
||||
|
||||
if ((strcmp(argv[0], "version") == 0) ||
|
||||
(strcmp(argv[0], "real-version") == 0) ||
|
||||
(strcmp(argv[0], "arch") == 0) ||
|
||||
(strcmp(argv[0], "fetch") == 0)) {
|
||||
/*
|
||||
* Initialize libxbps.
|
||||
@@ -269,6 +270,12 @@ main(int argc, char **argv)
|
||||
usage();
|
||||
|
||||
exit(xbps_cmpver(argv[1], argv[2]));
|
||||
} else if (strcmp(argv[0], "arch") == 0) {
|
||||
/* returns the xbps native arch */
|
||||
if (argc != 1)
|
||||
usage();
|
||||
|
||||
printf("%s\n", xh.native_arch);
|
||||
} else if (strcmp(argv[0], "digest") == 0) {
|
||||
/* Prints SHA256 hashes for specified files */
|
||||
if (argc < 2)
|
||||
|
Reference in New Issue
Block a user