From: root Date: Mon, 1 Jul 1996 21:36:36 +0000 (+0000) Subject: added stuff to handle --arch and --os and X-Git-Tag: tznext/4.11.0.1.tizen20130304~11253 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3fc67229c0e4b7613e15b743cae0eef1f3e9f5ae;p=tools%2Flibrpm-tizen.git added stuff to handle --arch and --os and wacky new arch handling stuff CVS patchset: 707 CVS date: 1996/07/01 21:36:36 --- diff --git a/rpm.c b/rpm.c index d870980..437b67a 100755 --- a/rpm.c +++ b/rpm.c @@ -236,11 +236,14 @@ int main(int argc, char ** argv) { char * prefix = "/"; char * specFile; char *passPhrase = ""; + char *arch = NULL; + char *os = NULL; char * smallArgv[2] = { NULL, NULL }; char ** currarg; int ec = 0; struct option optionsTable[] = { { "all", 0, 0, 'a' }, + { "arch", 1, 0, 0 }, { "build", 1, 0, 'b' }, { "checksig", 0, 0, 'K' }, { "clean", 0, &clean, 0 }, @@ -263,6 +266,7 @@ int main(int argc, char ** argv) { { "nopgp", 0, &noPgp, 0 }, { "noscripts", 0, &noScripts, 0 }, { "oldpackage", 0, &oldPackage, 0 }, + { "os", 1, 0, 0 }, { "package", 0, 0, 'p' }, { "percent", 0, &showPercents, 0 }, { "provides", 0, 0, 0 }, @@ -305,19 +309,23 @@ int main(int argc, char ** argv) { bindtextdomain(NLSPACKAGE, "/usr/lib/locale"); textdomain(NLSPACKAGE); - /* make a first pass through the arguments, looking for --rcfile. We - need to handle that before dealing with the rest of the arguments */ + /* Make a first pass through the arguments, looking for --rcfile */ + /* as well as --arch and --os. We need to handle that before */ + /* dealing with the rest of the arguments. */ currarg = argv; while (*currarg) { if (!strcmp(*currarg, "--rcfile")) { rcfile = *(currarg + 1); - break; + } else if (!strcmp(*currarg, "--arch")) { + arch = *(currarg + 1); + } else if (!strcmp(*currarg, "--os")) { + os = *(currarg + 1); } currarg++; } /* reading this early makes it easy to override */ - if (readConfigFiles(rcfile)) + if (readConfigFiles(rcfile, arch, os)) exit(1); while (1) {