Mantis - pkg_get
Viewing Issue Advanced Details
3904 regular use minor always 2009-09-17 16:39 2009-10-30 17:45
skayser  
bonivart  
normal  
closed  
fixed  
none    
none  
0003904: pkgutil 1.7: --transform doesn't work when package is already installed
Me again. In contrary to the -s/--stream option, --transform seems to check the requested package against the ones that are already installed and doesn't proceed if the package is already installed.

skayser @ ray42 ~$ pkgutil --transform wget
You're not root and didn't set -W, using current dir.
Parsing catalog, may take a while...
Current packages: CSWcacertificates-20090108,REV=2009.01.08 CSWcommon-1.4.6,REV=2008.04.28 CSWcswclassutils-1.18,REV=2009.08.10 CSWosslrt-0.9.8,REV=2009.03.27_rev=k CSWwget-1.11.4,REV=2009.04.15
$

The primary usage of --transform for me is to cross-check ongoing packaging work with other packages. Whether a requested package is already installed doesn't really matter to me, i just want to have a look at the full package structure.

IIRC i was in favor of --transform to work as a switch to -d and to have -d download a package independently of whether it is already installed. Similar to "aptitude download <pkgname>" on Debian. Did we talk about that?
Issue History
2009-09-17 16:39 skayser New Issue
2009-09-23 18:09 bonivart Status new => assigned
2009-09-23 18:09 bonivart Assigned To => bonivart
2009-09-23 18:12 bonivart Note Added: 0006743
2009-09-23 19:36 skayser Note Added: 0006746
2009-09-23 19:37 skayser Note Edited: 0006746
2009-09-23 19:38 skayser Note Edited: 0006746
2009-10-09 18:36 bonivart Note Added: 0006823
2009-10-09 18:42 bonivart Note Added: 0006824
2009-10-09 20:57 bonivart Note Added: 0006825
2009-10-13 11:59 trygvis Issue Monitored: trygvis
2009-10-19 20:30 bonivart Note Added: 0006877
2009-10-30 17:45 bonivart Note Added: 0006916
2009-10-30 17:45 bonivart Status assigned => closed
2009-10-30 17:45 bonivart Resolution open => fixed

Notes
(0006743)
bonivart   
2009-09-23 18:12   
I agree with that --transform should disregard whether or not a package is installed. I will have to fix this.

But for -d I'm not really sure since it would change the current/old behavior (--transform is new) and someone might file a bug about that too. :-/
(0006746)
skayser   
2009-09-23 19:36   
(edited on: 2009-09-23 19:38)
Overall, --transform shouldn't behave that much different from -d (just an additional transform after the package has been downloaded - more a variant of the -d mode than a mode on its own). So IMHO we should see whether we can do something about both of them.

Now that -d had skipped locally installed pkgs in the past, i see two options

1) Add a switch to ignore the installation state of a pkg, so that one can force the download of all requested pkgs

  pkgutil -d [--transform] --all foobar
  pkgutil -d [--transform] --force foobar
  pkgutil -d [--transform] --?? foobar

Both are not very intuitive (i can't come up with an intuitive one right now), but should demonstrate what i mean.

2) Break with existing behavior, ignore the installation state of a pkg, and introduce an additional switch (could either be for the -d or the -i mode, see below) which would restore previous behavior. Needs to be noted in the changelog of course.

I am in favor of option number 2 for two reason. First, it is consistent with the -s behavior which just downloads all pkgs. Second, if i want to download pkgs, i want to download them. It is not as if i was saying "pkgutil, please do as if you were installing, but only download". If i wanted that, i would rather say something like: "pkgutil -i --download-only".

To draw a comparison with the Debian's aptitude: to download a pkg on Debian i have two options

 aptitude install -d foobar
 aptitude download foobar

The first one is the installation mode and would download foobar only if it wasn't installed yet. Feels intuitive, no? One knows that aptitude is in installation mode, does all the usual, clever logic, but then simply downloads instead of installing. The second one is the download mode which simply downloads foobar without honoring any local pkg states. Also feels intuitive to me (although i somehow like our download behavior of downloading deps also ;).

In pkgutil we could thus have

 pkgutil -i --download foobar (or pkgutil -d --skip-installed)
 pkgutil -u --download foobar

^^ Do as if you were installing/upgrading, but stop after the download.

 pkgutil -d foobar

^^ Simply download a package (plus its dependencies?).

Plus variants of the -d mode.

 pkgutil -d --transform foobar
 pkgutil -d --stream foobar

What do you think? Any possible comparisons to how things work with yum on RHEL?

(0006823)
bonivart   
2009-10-09 18:36   
I like your (2nd) suggestion a lot. It makes sense that you don't care about installed packages when not installing/upgrading. I'm changing the behavior for --download and --transform.

r123 now contains part of your suggestion:

http://pkgutil.svn.sourceforge.net/viewvc/pkgutil/trunk/pkgutil?revision=123 [^]

Download and transform now fetches all needed packages regardless of what's installed. You can add --nodeps or --exclude if you want less.
(0006824)
bonivart   
2009-10-09 18:42   
Note that I haven't implemented --transform and --stream as suboptions to --download. I think that's nicer and that they belong together but I haven't gotten that far yet. :-)
(0006825)
bonivart   
2009-10-09 20:57   
r125 should be close to a complete fix for this.
(0006877)
bonivart   
2009-10-19 20:30   
There's a 1.8 beta 1 including this fix in testing.
(0006916)
bonivart   
2009-10-30 17:45   
1.8 released to current.