[pacman-dev] Usefulness of -F option (was: "local version is up to date. Upgrade anyway?" question)
On Nov 21, 2007 11:46 AM, Xavier <shiningxc@gmail.com> wrote:
Except that -F apparently doesn't want to install new packages, only upgrade existing but outdated ones. While the option I had in mind for -S would either install new packages, or upgrading existing but outdated ones.
But I never used -F once in all the time I used Arch. Who uses this option? I actually was surprised when I first saw it some times ago. And I already forgot it existed, since I never see it mentioned anywhere.
Does anyone even use -F anymore? I could see its usefullness before sync DBs were introduced, but I do have a hard time seeing its use anymore. Kill it? Any objections? I dislike stale crud sitting around. -Dan
Kill it? Any objections? I dislike stale crud sitting around. /me never used.
Bye ---------------------------------------------------- SZTE Egyetemi Könyvtár - http://www.bibl.u-szeged.hu This mail sent through IMP: http://horde.org/imp/
2007/11/21, Nagy Gabor <ngaba@bibl.u-szeged.hu>:
Kill it? Any objections? I dislike stale crud sitting around. /me never used.
Same here. Let's kill it. Similar situation with -A/-U - I think it would be ok to just kill them and add support for filenames to -S instead of implementing -A/-U with depends or merging them into -I (see numerous reports). -- Roman Kyrylych (Роман Кирилич)
Idézés Roman Kyrylych <roman.kyrylych@gmail.com>:
2007/11/21, Nagy Gabor <ngaba@bibl.u-szeged.hu>:
Kill it? Any objections? I dislike stale crud sitting around. /me never used.
Same here. Let's kill it. Similar situation with -A/-U - I think it would be ok to just kill them and add support for filenames to -S instead of implementing -A/-U with depends or merging them into -I (see numerous reports).
I agree. I never understood why we have different "uppercase" commands for -A, -F and -U, these should be "lowercase" options for -I. Bye ---------------------------------------------------- SZTE Egyetemi Könyvtár - http://www.bibl.u-szeged.hu This mail sent through IMP: http://horde.org/imp/
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> --- contrib/bash_completion | 6 ++---- contrib/zsh_completion | 11 +---------- doc/pacman.8.txt | 4 ---- lib/libalpm/add.c | 13 ++----------- lib/libalpm/alpm.h | 2 +- pactest/tests/add030.py | 18 ------------------ pactest/tests/add031.py | 18 ------------------ pactest/tests/add032.py | 18 ------------------ src/pacman/pacman.c | 12 +----------- 9 files changed, 7 insertions(+), 95 deletions(-) delete mode 100644 pactest/tests/add030.py delete mode 100644 pactest/tests/add031.py delete mode 100644 pactest/tests/add032.py diff --git a/contrib/bash_completion b/contrib/bash_completion index 6aafc9e..844396d 100644 --- a/contrib/bash_completion +++ b/contrib/bash_completion @@ -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 \ diff --git a/contrib/zsh_completion b/contrib/zsh_completion index 4607bd7..566c39f 100644 --- a/contrib/zsh_completion +++ b/contrib/zsh_completion @@ -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[@]" \ diff --git a/doc/pacman.8.txt b/doc/pacman.8.txt index 7b10bc0..887f912 100644 --- a/doc/pacman.8.txt +++ b/doc/pacman.8.txt @@ -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 diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index e6efe2d..0b40f95 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -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) { diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index b56f575..76c7208 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -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, diff --git a/pactest/tests/add030.py b/pactest/tests/add030.py deleted file mode 100644 index d36311c..0000000 --- a/pactest/tests/add030.py +++ /dev/null @@ -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) diff --git a/pactest/tests/add031.py b/pactest/tests/add031.py deleted file mode 100644 index 38b0485..0000000 --- a/pactest/tests/add031.py +++ /dev/null @@ -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) diff --git a/pactest/tests/add032.py b/pactest/tests/add032.py deleted file mode 100644 index 2c5a11f..0000000 --- a/pactest/tests/add032.py +++ /dev/null @@ -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) diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 31d31da..10f4c24 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -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; -- 1.5.3.6
On Nov 21, 2007 12:27 PM, Dan McGee <dan@archlinux.org> wrote:
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> --- contrib/bash_completion | 6 ++---- contrib/zsh_completion | 11 +---------- doc/pacman.8.txt | 4 ---- lib/libalpm/add.c | 13 ++----------- lib/libalpm/alpm.h | 2 +- pactest/tests/add030.py | 18 ------------------ pactest/tests/add031.py | 18 ------------------ pactest/tests/add032.py | 18 ------------------ src/pacman/pacman.c | 12 +----------- 9 files changed, 7 insertions(+), 95 deletions(-) delete mode 100644 pactest/tests/add030.py delete mode 100644 pactest/tests/add031.py delete mode 100644 pactest/tests/add032.py
I'd love to have another sign-off or two from people on the list, so when someone later goes "OMG Dan removed the -F operation!" I can at least point at the sign-off lines and say "and so did all these people". Just let me know if you agree with the change, and I'll go ahead and add your name as a sign-off. -Dan
On Wed, Nov 21, 2007 at 12:31:08PM -0500, Dan McGee wrote:
I'd love to have another sign-off or two from people on the list, so when someone later goes "OMG Dan removed the -F operation!" I can at least point at the sign-off lines and say "and so did all these people".
Just let me know if you agree with the change, and I'll go ahead and add your name as a sign-off.
Ok for me.
On Nov 21, 2007 11:31 AM, Dan McGee <dan@archlinux.org> wrote:
On Nov 21, 2007 12:27 PM, Dan McGee <dan@archlinux.org> wrote:
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> --- contrib/bash_completion | 6 ++---- contrib/zsh_completion | 11 +---------- doc/pacman.8.txt | 4 ---- lib/libalpm/add.c | 13 ++----------- lib/libalpm/alpm.h | 2 +- pactest/tests/add030.py | 18 ------------------ pactest/tests/add031.py | 18 ------------------ pactest/tests/add032.py | 18 ------------------ src/pacman/pacman.c | 12 +----------- 9 files changed, 7 insertions(+), 95 deletions(-) delete mode 100644 pactest/tests/add030.py delete mode 100644 pactest/tests/add031.py delete mode 100644 pactest/tests/add032.py
I'd love to have another sign-off or two from people on the list, so when someone later goes "OMG Dan removed the -F operation!" I can at least point at the sign-off lines and say "and so did all these people".
Just let me know if you agree with the change, and I'll go ahead and add your name as a sign-off.
I'll just say this - I didn't even know this op existed, and looking at it, I'm still not even all that clear on what it does... looks to be the same functionality as saying 'no' to the "local package is up to date" question. Looks good to me
I'll just say this - I didn't even know this op existed, and looking at it, I'm still not even all that clear on what it does... looks to be the same functionality as saying 'no' to the "local package is up to date" question.
Are we sure that's what it does? That's not how I read it's description in the man page. I'm guessing you could use it if you had downloaded a repo locally to a usbkey/cd (think broadband at work/school, dialup at home). You could then change to that directory and do a pacman -F *.pkg.tar.gz to update preexisting packages and not end up installing them all instead. Dale
On Nov 21, 2007 12:32 PM, Dale Blount <dale@archlinux.org> wrote:
I'll just say this - I didn't even know this op existed, and looking at it, I'm still not even all that clear on what it does... looks to be the same functionality as saying 'no' to the "local package is up to date" question.
Are we sure that's what it does? That's not how I read it's description in the man page.
Rereading it, it's not sync related, it's a parallel to the -A and -U options.
I'm guessing you could use it if you had downloaded a repo locally to a usbkey/cd (think broadband at work/school, dialup at home). You could then change to that directory and do a pacman -F *.pkg.tar.gz to update preexisting packages and not end up installing them all instead.
This is such an edge case though. Using repo-add foo.db.tar.gz *.pkg.tar.gz and then adding a conf entry for that DB will cover this case if it's needed, anyway
On Wed, Nov 21, 2007 at 01:32:33PM -0500, Dale Blount wrote:
I'll just say this - I didn't even know this op existed, and looking at it, I'm still not even all that clear on what it does... looks to be the same functionality as saying 'no' to the "local package is up to date" question.
Are we sure that's what it does? That's not how I read it's description in the man page.
I'm sure that's not what it does. It does as described in the man page, or as I tried to explain a few posts above.
I'm guessing you could use it if you had downloaded a repo locally to a usbkey/cd (think broadband at work/school, dialup at home). You could then change to that directory and do a pacman -F *.pkg.tar.gz to update preexisting packages and not end up installing them all instead.
I see, that's useful in that case indeed. I'm probably lucky I never had to do that. But if you downloaded the whole repo, you will also have the db.tar.gz, right? So you can always extract that, and then use -Su. But that's less nice. /me thinks ..
On Nov 21, 2007 1:47 PM, Xavier <shiningxc@gmail.com> wrote:
On Wed, Nov 21, 2007 at 01:32:33PM -0500, Dale Blount wrote:
I'll just say this - I didn't even know this op existed, and looking at it, I'm still not even all that clear on what it does... looks to be the same functionality as saying 'no' to the "local package is up to date" question.
Are we sure that's what it does? That's not how I read it's description in the man page.
I'm sure that's not what it does. It does as described in the man page, or as I tried to explain a few posts above.
I'm guessing you could use it if you had downloaded a repo locally to a usbkey/cd (think broadband at work/school, dialup at home). You could then change to that directory and do a pacman -F *.pkg.tar.gz to update preexisting packages and not end up installing them all instead.
I see, that's useful in that case indeed. I'm probably lucky I never had to do that. But if you downloaded the whole repo, you will also have the db.tar.gz, right? So you can always extract that, and then use -Su. But that's less nice. /me thinks ..
Make a DB in that case- thats what repo-add is for. Sync repos actually allow you to resolve dependencies anyway. Executive decision has been made- I'm killing this (and a lot of others signed off). I can't think of a use case where creating a sync DB won't solve the problem. Think of it this way- if you want it to stay, you'll have to justify it like you submitted it in a patch. :) -Dan
On Wed, Nov 21, 2007 at 01:32:33PM -0500, Dale Blount wrote:
I'll just say this - I didn't even know this op existed, and looking at it, I'm still not even all that clear on what it does... looks to be the same functionality as saying 'no' to the "local package is up to date" question.
Are we sure that's what it does? That's not how I read it's description in the man page.
I'm guessing you could use it if you had downloaded a repo locally to a usbkey/cd (think broadband at work/school, dialup at home). You could then change to that directory and do a pacman -F *.pkg.tar.gz to update preexisting packages and not end up installing them all instead.
Hm, there is something I overlooked earlier. You actually can't even use it like that, because pacman will fail on the first target that is either not installed, or already up to date. So you can't run it on *.pkg.tar.gz , you would have to select manually the targets which are outdated. Which makes the -F option in its current state totally pointless. Now, it probably wouldn't be too hard to change -F to skip these targets instead of just failing. But then there is a bigger problem of dependencies resolving. If a target you are updating gets a new dependency, the dependency will be skipped by -F because it's not installed. And only after that, it'll check the dependencies of the remaining targets, and will just fail there. We could probably take care of that in the code, but that would result in a more complex implementation of -F, totally different than the current one. And ok, now you have updated all your existing packages. A few days later, you want to install a new package. How do you do that? It's a pita, you would have to do all the dependencies resolving manually. I first thought that the little overhead of building a repo again with repo-add (or getting the db.tar.gz from the mirror and extracting it manually) was not worth it, but not anymore. It's very easy/simple/fast to do, and then has many advantages : * easy upgrade of the existing package with dependencies resolving via -Su * easy install of new packages with dep resolving via -S * -F can be removed
participants (7)
-
Aaron Griffin
-
Dale Blount
-
Dan McGee
-
Dan McGee
-
Nagy Gabor
-
Roman Kyrylych
-
Xavier