Remove -F/--freshen operation

This operation made sense in the days before sync DBs existed, but it no
longer has the same usefulness it once did.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
This commit is contained in:
Dan McGee 2007-11-21 11:25:50 -06:00
parent 0144b2ed29
commit f5d2150e9d
9 changed files with 7 additions and 95 deletions

View File

@ -146,7 +146,7 @@ _pacman ()
toparse="${a:2}"
case "${arg}" in
-@(A|U|F|R|S|Q|h|V))
-@(A|U|R|S|Q|h|V))
op="${arg/-}"
mod="${mod}${a:2}"
;;
@ -156,7 +156,6 @@ _pacman ()
add) op="A" ;;
remove) op="R" ;;
upgrade) op="U" ;;
freshen) op="F" ;;
query) op="Q" ;;
sync) op="S" ;;
help) op="h" ;;
@ -204,7 +203,6 @@ _pacman ()
if [ $COMP_CWORD -eq 1 ] && [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '\
-A --add \
-F --freshen \
-h --help \
-Q --query \
-R --remove \
@ -218,7 +216,7 @@ _pacman ()
if [[ "$cur" == -* ]]; then
case "${op}" in
A|U|F)
A|U)
COMPREPLY=( $( compgen -W '\
--asdeps \
-d --nodeps \

View File

@ -7,7 +7,6 @@ typeset -A opt_args
# options for passing to _arguments: main pacman commands
_pacman_opts_commands=(
'-A[Add a package to the system]'
'-F[Upgrade an installed package]'
'-Q[Query the package database]'
'-R[Remove a package from the system]'
'-S[Synchronize packages]'
@ -26,7 +25,7 @@ _pacman_opts_common=(
'--noconfirm[Do not ask for confirmation]'
)
# options for passing to _arguments: options for --add, --freshen and --update commands
# options for passing to _arguments: options for --add, and --update commands
_pacman_opts_pkgfile=(
'-d[Skip dependency checks]'
'-f[Overwrite conflicting files]'
@ -85,13 +84,6 @@ _pacman_action_add() {
"$_pacman_opts_pkgfile[@]"
}
# handles --freshen subcommand
_pacman_action_freshen() {
_arguments -s : \
"$_pacman_opts_common[@]" \
"$_pacman_opts_pkgfile[@]"
}
# handles --help subcommand
_pacman_action_help() {
_arguments -s : \
@ -274,7 +266,6 @@ _pacman_get_command() {
_pacman() {
case $words[2] in
-A*) _pacman_action_add ;;
-F*) _pacman_action_freshen ;;
-Qg) # ipkg groups
_arguments -s : \
"$_pacman_opts_common[@]" \

View File

@ -35,10 +35,6 @@ Operations
version is already installed. *NOTE*: please use '\--upgrade' in place of
this option.
*-F, \--freshen*::
This is like '\--upgrade' except it will only upgrade packages already
installed on the system.
*-Q, \--query*::
Query the package database. This operation allows you to view installed
packages and their files, as well as meta-information about individual

View File

@ -76,19 +76,10 @@ int _alpm_add_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name)
pm_errno = PM_ERR_PKG_INSTALLED;
goto error;
}
} else {
if(trans->flags & PM_TRANS_FLAG_FRESHEN) {
/* only upgrade/install this package if it is already installed and at a lesser version */
pmpkg_t *dummy = _alpm_db_get_pkgfromcache(db, pkgname);
if(dummy == NULL || _alpm_versioncmp(dummy->version, pkgver) >= 0) {
pm_errno = PM_ERR_PKG_CANT_FRESH;
goto error;
}
}
}
/* check if an older version of said package is already in transaction packages.
* if so, replace it in the list */
/* check if an older version of said package is already in transaction
* packages. if so, replace it in the list */
for(i = trans->packages; i; i = i->next) {
pmpkg_t *pkg = i->data;
if(strcmp(pkg->name, pkgname) == 0) {

View File

@ -271,7 +271,7 @@ typedef enum _pmtransflag_t {
PM_TRANS_FLAG_NODEPS = 0x01,
PM_TRANS_FLAG_FORCE = 0x02,
PM_TRANS_FLAG_NOSAVE = 0x04,
PM_TRANS_FLAG_FRESHEN = 0x08,
/* 0x08 flag can go here */
PM_TRANS_FLAG_CASCADE = 0x10,
PM_TRANS_FLAG_RECURSE = 0x20,
PM_TRANS_FLAG_DBONLY = 0x40,

View File

@ -1,18 +0,0 @@
self.description = "Freshen a package"
lp = pmpkg("dummy")
lp.files = ["bin/dummy",
"usr/man/man1/dummy.1"]
self.addpkg2db("local", lp)
p = pmpkg("dummy", "1.0-2")
p.files = ["bin/dummy",
"usr/man/man1/dummy.1"]
self.addpkg(p)
self.args = "-F %s" % p.filename()
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_VERSION=dummy|1.0-2")
for f in p.files:
self.addrule("FILE_MODIFIED=%s" % f)

View File

@ -1,18 +0,0 @@
self.description = "Freshen a package (installed is newer)"
lp = pmpkg("dummy", "1.0-2")
lp.files = ["bin/dummy",
"usr/man/man1/dummy.1"]
self.addpkg2db("local", lp)
p = pmpkg("dummy")
p.files = ["bin/dummy",
"usr/man/man1/dummy.1"]
self.addpkg(p)
self.args = "-F %s" % p.filename()
self.addrule("PACMAN_RETCODE=1")
self.addrule("!PKG_MODIFIED=dummy")
for f in p.files:
self.addrule("!FILE_MODIFIED=%s" % f)

View File

@ -1,18 +0,0 @@
self.description = "Freshen a package (installed is same)"
lp = pmpkg("dummy")
lp.files = ["bin/dummy",
"usr/man/man1/dummy.1"]
self.addpkg2db("local", lp)
p = pmpkg("dummy")
p.files = ["bin/dummy",
"usr/man/man1/dummy.1"]
self.addpkg(p)
self.args = "-F %s" % p.filename()
self.addrule("PACMAN_RETCODE=1")
self.addrule("!PKG_MODIFIED=dummy")
for f in p.files:
self.addrule("!FILE_MODIFIED=%s" % f)

View File

@ -71,7 +71,6 @@ static void usage(int op, const char * const myname)
printf(" %s {-h --help}\n", myname);
printf(" %s {-V --version}\n", myname);
printf(" %s {-A --add} [%s] <%s>\n", myname, str_opt, str_file);
printf(" %s {-F --freshen} [%s] <%s>\n", myname, str_opt, str_file);
printf(" %s {-Q --query} [%s] [%s]\n", myname, str_opt, str_pkg);
printf(" %s {-R --remove} [%s] <%s>\n", myname, str_opt, str_pkg);
printf(" %s {-S --sync} [%s] [%s]\n", myname, str_opt, str_pkg);
@ -93,11 +92,7 @@ static void usage(int op, const char * const myname)
printf(_(" -n, --nosave remove configuration files as well\n"));
printf(_(" -s, --recursive remove dependencies also (that won't break packages)\n"));
} else if(op == PM_OP_UPGRADE) {
if(config->flags & PM_TRANS_FLAG_FRESHEN) {
printf("%s: %s {-F --freshen} [%s] <%s>\n", str_usg, myname, str_opt, str_file);
} else {
printf("%s: %s {-U --upgrade} [%s] <%s>\n", str_usg, myname, str_opt, str_file);
}
printf("%s: %s {-U --upgrade} [%s] <%s>\n", str_usg, myname, str_opt, str_file);
printf("%s:\n", str_opt);
printf(_(" --asdeps install packages as non-explicitly installed\n"));
printf(_(" -d, --nodeps skip dependency checks\n"));
@ -266,7 +261,6 @@ static int parseargs(int argc, char *argv[])
static struct option opts[] =
{
{"add", no_argument, 0, 'A'},
{"freshen", no_argument, 0, 'F'},
{"query", no_argument, 0, 'Q'},
{"remove", no_argument, 0, 'R'},
{"sync", no_argument, 0, 'S'},
@ -387,10 +381,6 @@ static int parseargs(int argc, char *argv[])
FREELIST(list);
break;
case 'A': config->op = (config->op != PM_OP_MAIN ? 0 : PM_OP_ADD); break;
case 'F':
config->op = (config->op != PM_OP_MAIN ? 0 : PM_OP_UPGRADE);
config->flags |= PM_TRANS_FLAG_FRESHEN;
break;
case 'Q': config->op = (config->op != PM_OP_MAIN ? 0 : PM_OP_QUERY); break;
case 'R': config->op = (config->op != PM_OP_MAIN ? 0 : PM_OP_REMOVE); break;
case 'S': config->op = (config->op != PM_OP_MAIN ? 0 : PM_OP_SYNC); break;