1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00

* Removed the 'vercmp' op from pacman. The standalone 'vercmp' binary should be

used instead
* Allow -T/--deptest to work without root privileges
This commit is contained in:
Aaron Griffin 2007-02-12 06:44:00 +00:00
parent 2a7c1de945
commit be85600dfd
3 changed files with 2 additions and 17 deletions

View File

@ -33,7 +33,6 @@ typedef struct __config_t {
unsigned short upgrade;
unsigned short noconfirm;
unsigned short noprogressbar;
unsigned short op_d_vertest;
unsigned short op_d_resolve;
unsigned short op_q_isfile;
unsigned short op_q_info;

View File

@ -49,18 +49,6 @@ int pacman_deptest(alpm_list_t *targets)
return(0);
}
if(config->op_d_vertest) {
const char *pkga, *pkgb;
pkga = alpm_list_getdata(targets);
i = alpm_list_next(targets);
if(pkga && i && (pkgb = alpm_list_getdata(i))) {
int ret = alpm_pkg_vercmp(pkga, pkgb);
printf("%d\n", ret);
return(ret);
}
return(0);
}
/* we create a transaction to hold a dummy package to be able to use
* deps checkings from alpm_trans_prepare() */
if(alpm_trans_init(PM_TRANS_TYPE_ADD, 0, NULL, NULL, NULL) == -1) {

View File

@ -183,7 +183,7 @@ static void cleanup(int signum)
&& (pm_errno == PM_ERR_TRANS_COMMITING)) {
return;
}
if(signum != 0 && config->op_d_vertest == 0) {
if(signum != 0) {
/* TODO why is this here? */
fprintf(stderr, "\n");
}
@ -224,7 +224,6 @@ static int parseargs(int argc, char *argv[])
{"deptest", no_argument, 0, 'T'}, /* used by makepkg */
{"upgrade", no_argument, 0, 'U'},
{"version", no_argument, 0, 'V'},
{"vertest", no_argument, 0, 'Y'}, /* does the same as the 'vercmp' binary */
{"dbpath", required_argument, 0, 'b'},
{"cascade", no_argument, 0, 'c'},
{"changelog", no_argument, 0, 'c'},
@ -328,7 +327,6 @@ static int parseargs(int argc, char *argv[])
case 'V': config->version = 1; break;
case 'Y':
config->op = (config->op != PM_OP_MAIN ? 0 : PM_OP_DEPTEST);
config->op_d_vertest = 1;
break;
case 'b':
if(stat(optarg, &st) == -1 || !S_ISDIR(st.st_mode)) {
@ -479,7 +477,7 @@ int main(int argc, char *argv[])
if((config->op == PM_OP_SYNC && !config->op_s_sync &&
(config->op_s_search || config->group || config->op_q_list || config->op_q_info
|| config->flags & PM_TRANS_FLAG_PRINTURIS))
|| (config->op == PM_OP_DEPTEST && !config->op_d_resolve)
|| (config->op == PM_OP_DEPTEST && config->op_d_resolve)
|| (strcmp(alpm_option_get_root(), PM_ROOT) != 0)) {
/* special case: PM_OP_SYNC can be used w/ config->op_s_search by any user */
/* special case: ignore root user check if -r is specified, fall back on