2005-03-14 20:51:43 -05:00
|
|
|
/*
|
|
|
|
* conf.h
|
2007-11-16 21:18:45 -05:00
|
|
|
*
|
2011-01-05 23:45:15 -05:00
|
|
|
* Copyright (c) 2006-2011 Pacman Development Team <pacman-dev@archlinux.org>
|
2009-07-01 03:08:33 -04:00
|
|
|
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
|
2007-11-16 21:18:45 -05:00
|
|
|
*
|
2005-03-14 20:51:43 -05:00
|
|
|
* 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
|
2007-12-10 23:55:22 -05:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2005-03-14 20:51:43 -05:00
|
|
|
*/
|
|
|
|
#ifndef _PM_CONF_H
|
|
|
|
#define _PM_CONF_H
|
|
|
|
|
2007-01-19 04:28:44 -05:00
|
|
|
#include <alpm.h>
|
|
|
|
|
2005-10-29 03:00:56 -04:00
|
|
|
typedef struct __config_t {
|
2005-10-28 08:20:40 -04:00
|
|
|
unsigned short op;
|
2007-11-07 02:05:33 -05:00
|
|
|
unsigned short quiet;
|
2005-10-28 08:20:40 -04:00
|
|
|
unsigned short verbose;
|
|
|
|
unsigned short version;
|
|
|
|
unsigned short help;
|
|
|
|
unsigned short noconfirm;
|
2006-01-28 00:07:50 -05:00
|
|
|
unsigned short noprogressbar;
|
2007-06-07 15:42:26 -04:00
|
|
|
unsigned short logmask;
|
2009-07-19 05:15:11 -04:00
|
|
|
unsigned short print;
|
2011-06-03 17:13:04 -04:00
|
|
|
unsigned short checkspace;
|
|
|
|
unsigned short usesyslog;
|
|
|
|
unsigned short usedelta;
|
|
|
|
char *arch;
|
2009-07-19 05:15:11 -04:00
|
|
|
char *print_format;
|
2007-12-02 13:20:55 -05:00
|
|
|
/* unfortunately, we have to keep track of paths both here and in the library
|
|
|
|
* because they can come from both the command line or config file, and we
|
|
|
|
* need to ensure we get the order of preference right. */
|
|
|
|
char *configfile;
|
|
|
|
char *rootdir;
|
|
|
|
char *dbpath;
|
|
|
|
char *logfile;
|
2008-12-14 13:59:39 -05:00
|
|
|
char *gpgdir;
|
2011-06-03 17:13:04 -04:00
|
|
|
alpm_list_t *cachedirs;
|
2007-06-07 15:42:26 -04:00
|
|
|
|
2005-10-28 08:20:40 -04:00
|
|
|
unsigned short op_q_isfile;
|
|
|
|
unsigned short op_q_info;
|
|
|
|
unsigned short op_q_list;
|
2005-12-13 21:23:14 -05:00
|
|
|
unsigned short op_q_foreign;
|
2008-01-10 09:59:43 -05:00
|
|
|
unsigned short op_q_unrequired;
|
2007-07-14 18:44:06 -04:00
|
|
|
unsigned short op_q_deps;
|
|
|
|
unsigned short op_q_explicit;
|
2005-10-28 08:20:40 -04:00
|
|
|
unsigned short op_q_owns;
|
|
|
|
unsigned short op_q_search;
|
2006-10-15 15:34:52 -04:00
|
|
|
unsigned short op_q_changelog;
|
2007-02-04 03:26:52 -05:00
|
|
|
unsigned short op_q_upgrade;
|
2009-03-30 12:48:15 -04:00
|
|
|
unsigned short op_q_check;
|
2007-08-21 21:28:05 -04:00
|
|
|
|
2005-10-28 08:20:40 -04:00
|
|
|
unsigned short op_s_clean;
|
|
|
|
unsigned short op_s_downloadonly;
|
|
|
|
unsigned short op_s_info;
|
|
|
|
unsigned short op_s_sync;
|
|
|
|
unsigned short op_s_search;
|
|
|
|
unsigned short op_s_upgrade;
|
2007-08-21 21:28:05 -04:00
|
|
|
|
2005-10-28 08:20:40 -04:00
|
|
|
unsigned short group;
|
Re-add the non-user friendly --ask option
This re-implements the --ask option which was removed in commit
1ff8e7f364a9f640ada7526384646d510ac29967.
This option does not have to be exposed to the user (help,doc,etc), but is
very very useful for pactest if we want to have more coverage there.
This was rewritten in a smarter way, without code duplication. And with a
different behavior : this option is now only used to inverse default
behavior to questions.
We still use bit operations based on the following struct :
/* Transaction Conversations (ie, questions) */
typedef enum _pmtransconv_t {
PM_TRANS_CONV_INSTALL_IGNOREPKG = 0x01,
PM_TRANS_CONV_REPLACE_PKG = 0x02,
PM_TRANS_CONV_CONFLICT_PKG = 0x04,
PM_TRANS_CONV_CORRUPTED_PKG = 0x08,
PM_TRANS_CONV_LOCAL_NEWER = 0x10,
PM_TRANS_CONV_REMOVE_PKGS = 0x20,
} pmtransconv_t;
for each conv matched, the default answer is inversed.
--ask 0 : all default answers are preserved
--ask 4 : only conflict question is inversed
--ask 63 : all questions are inversed (63 == 1+2+4+8+16+32)
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-08-31 14:17:05 -04:00
|
|
|
unsigned short noask;
|
|
|
|
unsigned int ask;
|
2011-06-28 00:42:24 -04:00
|
|
|
alpm_transflag_t flags;
|
2011-06-27 17:29:49 -04:00
|
|
|
alpm_siglevel_t siglevel;
|
2007-08-21 21:28:05 -04:00
|
|
|
|
2007-06-04 12:12:13 -04:00
|
|
|
/* conf file options */
|
2011-02-20 09:00:26 -05:00
|
|
|
/* I Love Candy! */
|
|
|
|
unsigned short chomp;
|
|
|
|
/* format target pkg lists as table */
|
|
|
|
unsigned short verbosepkglists;
|
2008-02-16 10:01:13 -05:00
|
|
|
/* When downloading, display the amount downloaded, rate, ETA, and percent
|
|
|
|
* downloaded of the total download list */
|
|
|
|
unsigned short totaldownload;
|
2011-02-20 09:00:26 -05:00
|
|
|
/* select -Sc behavior */
|
|
|
|
unsigned short cleanmethod;
|
2008-08-24 17:24:53 -04:00
|
|
|
alpm_list_t *holdpkg;
|
2008-01-28 13:49:27 -05:00
|
|
|
alpm_list_t *syncfirst;
|
2011-06-03 17:13:04 -04:00
|
|
|
alpm_list_t *ignorepkg;
|
|
|
|
alpm_list_t *ignoregrp;
|
|
|
|
alpm_list_t *noupgrade;
|
|
|
|
alpm_list_t *noextract;
|
2009-04-04 04:17:30 -04:00
|
|
|
char *xfercommand;
|
2011-06-03 17:13:04 -04:00
|
|
|
|
|
|
|
/* our connection to libalpm */
|
2011-06-28 00:04:00 -04:00
|
|
|
alpm_handle_t *handle;
|
2005-10-29 03:00:56 -04:00
|
|
|
} config_t;
|
2005-10-28 08:20:40 -04:00
|
|
|
|
2007-06-07 22:20:40 -04:00
|
|
|
/* Operations */
|
|
|
|
enum {
|
|
|
|
PM_OP_MAIN = 1,
|
|
|
|
PM_OP_REMOVE,
|
|
|
|
PM_OP_UPGRADE,
|
|
|
|
PM_OP_QUERY,
|
|
|
|
PM_OP_SYNC,
|
2009-05-20 15:46:23 -04:00
|
|
|
PM_OP_DEPTEST,
|
|
|
|
PM_OP_DATABASE
|
2007-06-07 22:20:40 -04:00
|
|
|
};
|
|
|
|
|
2009-10-12 23:14:56 -04:00
|
|
|
/* Long Operations */
|
|
|
|
enum {
|
|
|
|
OP_NOCONFIRM = 1000,
|
|
|
|
OP_CONFIG,
|
|
|
|
OP_IGNORE,
|
|
|
|
OP_DEBUG,
|
|
|
|
OP_NOPROGRESSBAR,
|
|
|
|
OP_NOSCRIPTLET,
|
|
|
|
OP_ASK,
|
|
|
|
OP_CACHEDIR,
|
|
|
|
OP_ASDEPS,
|
|
|
|
OP_LOGFILE,
|
|
|
|
OP_IGNOREGROUP,
|
|
|
|
OP_NEEDED,
|
|
|
|
OP_ASEXPLICIT,
|
2009-07-19 05:15:11 -04:00
|
|
|
OP_ARCH,
|
2008-12-14 13:59:39 -05:00
|
|
|
OP_PRINTFORMAT,
|
|
|
|
OP_GPGDIR
|
2009-10-12 23:14:56 -04:00
|
|
|
};
|
|
|
|
|
2008-02-16 10:01:13 -05:00
|
|
|
/* clean method */
|
|
|
|
enum {
|
2011-01-29 13:10:05 -05:00
|
|
|
PM_CLEAN_KEEPINST = 1,
|
|
|
|
PM_CLEAN_KEEPCUR = (1 << 1)
|
2008-02-16 10:01:13 -05:00
|
|
|
};
|
|
|
|
|
2007-11-04 13:05:22 -05:00
|
|
|
/* global config variable */
|
|
|
|
extern config_t *config;
|
|
|
|
|
2005-11-07 08:14:19 -05:00
|
|
|
config_t *config_new(void);
|
2007-09-10 20:13:38 -04:00
|
|
|
int config_free(config_t *oldconfig);
|
2005-03-14 20:51:43 -05:00
|
|
|
|
2011-05-05 12:12:49 -04:00
|
|
|
int config_set_arch(const char *arch);
|
|
|
|
int parseconfig(const char *file);
|
2005-03-14 20:51:43 -05:00
|
|
|
#endif /* _PM_CONF_H */
|
|
|
|
|
|
|
|
/* vim: set ts=2 sw=2 noet: */
|