RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: j...@rpm5.org Module: rpm Date: 21-Jun-2012 17:36:53 Branch: rpm-5_4 Handle: 2012062115365300 Modified files: (Branch: rpm-5_4) rpm/rpmio rpmgit.c tgit.c Log: - git: stub-in "git config" options. Summary: Revision Changes Path 2.1.2.27 +0 -1 rpm/rpmio/rpmgit.c 1.1.2.26 +67 -1 rpm/rpmio/tgit.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/rpmio/rpmgit.c ============================================================================ $ cvs diff -u -r2.1.2.26 -r2.1.2.27 rpmgit.c --- rpm/rpmio/rpmgit.c 21 Jun 2012 13:33:51 -0000 2.1.2.26 +++ rpm/rpmio/rpmgit.c 21 Jun 2012 15:36:53 -0000 2.1.2.27 @@ -2030,7 +2030,6 @@ int xx; xx = chkgit(git, "git_repository_open", git_repository_open((git_repository **)&git->R, git->fn)); -fprintf(stderr, "*** xx %d = git_repository_open(%s) git->R %p\n", xx, git->fn, git->R); } } #ifdef NOTYET /* XXX rpmgitRun() uses pre-parsed git->av */ @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/tgit.c ============================================================================ $ cvs diff -u -r1.1.2.25 -r1.1.2.26 tgit.c --- rpm/rpmio/tgit.c 20 Jun 2012 14:21:22 -0000 1.1.2.25 +++ rpm/rpmio/tgit.c 21 Jun 2012 15:36:53 -0000 1.1.2.26 @@ -2207,12 +2207,75 @@ #endif static rpmRC cmd_config(int argc, char *argv[]) { + const char * config_file = NULL; + const char * config_get_colorbool = NULL; + const char * config_get_color = NULL; enum { - _CONFIG_FIXME = (1 << 0), + _CONFIG_REPLACE_ALL = (1 << 0), + _CONFIG_ADD = (1 << 1), + _CONFIG_GET = (1 << 2), + _CONFIG_GET_ALL = (1 << 3), + _CONFIG_GET_REGEXP = (1 << 4), + _CONFIG_GLOBAL = (1 << 5), + _CONFIG_SYSTEM = (1 << 6), + _CONFIG_REMOVE_SECTION = (1 << 7), + _CONFIG_RENAME_SECTION = (1 << 8), + _CONFIG_UNSET = (1 << 9), + _CONFIG_UNSET_ALL = (1 << 10), + _CONFIG_LIST = (1 << 11), + _CONFIG_BOOL = (1 << 12), + _CONFIG_INT = (1 << 13), + _CONFIG_PATH = (1 << 14), + _CONFIG_ZERO = (1 << 16), + _CONFIG_EDIT = (1 << 15), }; int config_flags = 0; #define CONFIG_ISSET(_a) (config_flags & _CONFIG_##_a) struct poptOption configOpts[] = { + { "replace-all", '\0', POPT_BIT_SET, &config_flags, _CONFIG_REPLACE_ALL, + N_("."), NULL }, + { "add", '\0', POPT_BIT_SET, &config_flags, _CONFIG_ADD, + N_("."), NULL }, + { "get", '\0', POPT_BIT_SET, &config_flags, _CONFIG_GET, + N_("."), NULL }, + { "get-all", '\0', POPT_BIT_SET, &config_flags, _CONFIG_GET_ALL, + N_("."), NULL }, + { "get-regexp", '\0', POPT_BIT_SET, &config_flags, _CONFIG_GET_REGEXP, + N_("."), NULL }, + { "get", '\0', POPT_BIT_SET, &config_flags, _CONFIG_GET, + N_("."), NULL }, + { "global", '\0', POPT_BIT_SET, &config_flags, _CONFIG_GLOBAL, + N_("."), NULL }, + { "system", '\0', POPT_BIT_SET, &config_flags, _CONFIG_SYSTEM, + N_("."), NULL }, + { "file", 'f', POPT_ARG_STRING, &config_file, 0, + N_("."), NULL }, + { "remove-section", '\0', POPT_BIT_SET, &config_flags, _CONFIG_REMOVE_SECTION, + N_("."), NULL }, + { "rename-section", '\0', POPT_BIT_SET, &config_flags, _CONFIG_RENAME_SECTION, + N_("."), NULL }, + { "unset", '\0', POPT_BIT_SET, &config_flags, _CONFIG_UNSET, + N_("."), NULL }, + { "unset-all", '\0', POPT_BIT_SET, &config_flags, _CONFIG_UNSET_ALL, + N_("."), NULL }, + { "list", 'l', POPT_BIT_SET, &config_flags, _CONFIG_LIST, + N_("."), NULL }, + { "int", '\0', POPT_BIT_SET, &config_flags, _CONFIG_INT, + N_("."), NULL }, + { "bool", '\0', POPT_BIT_SET, &config_flags, _CONFIG_BOOL, + N_("."), NULL }, + { "bool-or-int", '\0', POPT_BIT_SET, &config_flags, _CONFIG_BOOL|_CONFIG_INT, + N_("."), NULL }, + { "path", '\0', POPT_BIT_SET, &config_flags, _CONFIG_PATH, + N_("."), NULL }, + { "null", 'z', POPT_BIT_SET, &config_flags, _CONFIG_ZERO, + N_("."), NULL }, + { "get-colorbool", '\0', POPT_ARG_STRING, &config_get_colorbool, 0, + N_("Find if a color setting exists for <name>."), N_("<name>") }, + { "get-color", '\0', POPT_ARG_STRING, &config_get_color, 0, + N_("Find the color value configured for <name>."), N_("<name>") }, + { "edit", 'e', POPT_BIT_SET, &config_flags, _CONFIG_EDIT, + N_("Opens an editor to modify the specified config file."), NULL }, POPT_TABLEEND }; rpmRC rc = RPMRC_FAIL; @@ -2229,6 +2292,9 @@ exit: rc = (xx ? RPMRC_FAIL : RPMRC_OK); SPEW(0, rc, git); + config_file = _free(config_file); + config_get_colorbool = _free(config_get_colorbool); + config_get_color = _free(config_get_color); git = rpmgitFree(git); return rc; @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org