From f5164b2dd3fbf5652c46cba6e2653fc27cd762ef Mon Sep 17 00:00:00 2001 From: Martin Vidner Date: Thu, 9 Nov 2006 15:22:18 +0000 Subject: [PATCH] Fixed option parsing broken by unterminated option lists (install -t was thinking -t stood for --terse). If "install"ing more resolvables at a time, don't commit one by one. --- VERSION | 2 +- package/zypper.changes | 7 +++++++ src/zypper.cc | 49 ++++++++++++++++++++++++++++++++----------------- 3 files changed, 40 insertions(+), 18 deletions(-) diff --git a/VERSION b/VERSION index 40e6cec..1a8f299 100644 --- a/VERSION +++ b/VERSION @@ -10,5 +10,5 @@ dnl phase) dnl ================================================== m4_define([ZYPPER_MAJOR], [0]) m4_define([ZYPPER_MINOR], [6]) -m4_define([ZYPPER_PATCH], [5]) +m4_define([ZYPPER_PATCH], [6]) dnl ================================================== diff --git a/package/zypper.changes b/package/zypper.changes index b09a2a2..cc7ee76 100644 --- a/package/zypper.changes +++ b/package/zypper.changes @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Thu Nov 9 16:21:33 CET 2006 - mvidner@suse.cz + +- Fixed option parsing broken by unterminated option lists (install -t + was thinking -t stood for --terse). +- If "install"ing more resolvables at a time, don't commit one by one. +- 0.6.6 +------------------------------------------------------------------- Wed Nov 8 20:08:30 CET 2006 - jkupec@suse.cz - Several exit codes defined for use in scripts. diff --git a/src/zypper.cc b/src/zypper.cc index 5bf1985..a069cc6 100644 --- a/src/zypper.cc +++ b/src/zypper.cc @@ -205,7 +205,8 @@ int one_command(const string& command, int argc, char **argv) {"catalog", required_argument, 0, 'c'}, {"type", required_argument, 0, 't'}, {"no-confirm", no_argument, 0, 'y'}, - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = install_options; specific_help = " Command options:\n" @@ -218,7 +219,8 @@ int one_command(const string& command, int argc, char **argv) static struct option remove_options[] = { {"type", required_argument, 0, 't'}, {"no-confirm", no_argument, 0, 'y'}, - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = remove_options; specific_help = " Command options:\n" @@ -231,7 +233,8 @@ int one_command(const string& command, int argc, char **argv) {"disabled", no_argument, 0, 'd'}, {"no-refresh", no_argument, 0, 'n'}, {"repo", required_argument, 0, 'r'}, - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = service_add_options; specific_help = "service-add [options] URI [alias]\n" @@ -245,7 +248,8 @@ int one_command(const string& command, int argc, char **argv) } else if (command == "service-list" || command == "sl") { static struct option service_list_options[] = { - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = service_list_options; specific_help = "service-list\n" @@ -257,7 +261,8 @@ int one_command(const string& command, int argc, char **argv) } else if (command == "service-delete" || command == "sd") { static struct option service_delete_options[] = { - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = service_delete_options; specific_help = "service-delete [options] \n" @@ -269,7 +274,8 @@ int one_command(const string& command, int argc, char **argv) } else if (command == "service-rename" || command == "sr") { static struct option service_rename_options[] = { - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = service_rename_options; specific_help = "service-rename [options] \n" @@ -281,7 +287,8 @@ int one_command(const string& command, int argc, char **argv) } else if (command == "refresh" || command == "ref") { static struct option refresh_options[] = { - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = refresh_options; specific_help = _("zypper refresh\n" @@ -292,7 +299,8 @@ int one_command(const string& command, int argc, char **argv) else if (command == "list-updates" || command == "lu") { static struct option list_updates_options[] = { {"type", required_argument, 0, 't'}, - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = list_updates_options; specific_help = "list-updates [options]\n" @@ -307,7 +315,8 @@ int one_command(const string& command, int argc, char **argv) static struct option update_options[] = { {"type", required_argument, 0, 't'}, {"no-confirm", no_argument, 0, 'y'}, - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = update_options; specific_help = " Command options:\n" @@ -329,7 +338,8 @@ int one_command(const string& command, int argc, char **argv) {"type", required_argument, 0, 't'}, {"sort-by-name", no_argument, 0, 0}, {"sort-by-catalog", no_argument, 0, 0}, - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = search_options; specific_help = @@ -356,7 +366,8 @@ int one_command(const string& command, int argc, char **argv) } else if (command == "patch-check" || command == "pchk") { static struct option patch_check_options[] = { - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = patch_check_options; specific_help = "patch-check\n" @@ -368,7 +379,8 @@ int one_command(const string& command, int argc, char **argv) } else if (command == "patches" || command == "pch") { static struct option patches_options[] = { - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = patches_options; specific_help = "patches\n" @@ -380,7 +392,8 @@ int one_command(const string& command, int argc, char **argv) } else if (command == "info" || command == "if") { static struct option info_options[] = { - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = info_options; specific_help = @@ -391,7 +404,8 @@ int one_command(const string& command, int argc, char **argv) } else if (command == "patch-info") { static struct option patch_info_options[] = { - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = patch_info_options; specific_help = @@ -402,7 +416,8 @@ int one_command(const string& command, int argc, char **argv) } else if (command == "moo") { static struct option moo_options[] = { - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = moo_options; specific_help = @@ -684,9 +699,9 @@ int one_command(const string& command, int argc, char **argv) else { mark_for_uninstall(kind, *it); } - - solve_and_commit (copts.count("no-confirm")); } + + solve_and_commit (copts.count("no-confirm")); return ZYPPER_EXIT_OK; } -- 2.7.4