/* * update-alternatives * * Copyright © 1995 Ian Jackson * Copyright © 2000-2002 Wichert Akkerman * Copyright © 2006-2015 Guillem Jover * Copyright © 2008 Pierre Habouzit * Copyright © 2009-2010 Raphaël Hertzog * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* Global variables: */ #define PROGNAME "update-alternatives" static const char *altdir = SYSCONFDIR "/alternatives"; static const char *admdir; static const char *prog_path = "update-alternatives"; /* Action to perform */ static const char *action = NULL; static const char *log_file = LOGDIR "/alternatives.log"; /* Skip alternatives properly configured in auto mode (for --config) */ static int opt_skip_auto = 0; static int opt_verbose = 0; static int opt_force = 0; #define MAX_OPTS 128 #define PUSH_OPT(a) if (nb_opts < MAX_OPTS) pass_opts[nb_opts++] = a; static char *pass_opts[MAX_OPTS]; static int nb_opts = 0; #define ALT_TMP_EXT ".dpkg-tmp" /* * Functions. */ static void version(void) { printf(_("Debian %s version %s.\n"), PROGNAME, VERSION); printf("\n"); printf(_( "This is free software; see the GNU General Public License version 2 or\n" "later for copying conditions. There is NO warranty.\n")); } static void usage(void) { printf(_( "Usage: %s [