X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from dal-a2.localdomain (unknown [74.117.189.115]) by mail.alpinelinux.org (Postfix) with ESMTP id A212EDC0097 for ; Mon, 1 Jul 2013 13:15:38 +0000 (UTC) Received: from ncopa-desktop.alpinelinux.org (3.203.202.84.customer.cdi.no [84.202.203.3]) (using SSLv3 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: ncopa@tanael.org) by dal-a2.localdomain (Postfix) with ESMTPSA id A12D4BC29F0; Mon, 1 Jul 2013 13:15:37 +0000 (UTC) Date: Mon, 1 Jul 2013 15:15:33 +0200 From: Natanael Copa To: Dubiousjim Cc: alpine-devel@lists.alpinelinux.org Subject: Re: [alpine-devel] futher apk ideas Message-ID: <20130701151533.079b3256@ncopa-desktop.alpinelinux.org> In-Reply-To: <20130628171945.GD1712@zen.nyu.edu> References: <20130628154631.4d18107d@ncopa-desktop.alpinelinux.org> <20130628163747.GB1712@zen.nyu.edu> <20130628171945.GD1712@zen.nyu.edu> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.17; x86_64-unknown-linux-gnu) X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 28 Jun 2013 13:19:45 -0400 Dubiousjim wrote: ... > > What if you want list 'depends' without recursing? (apk info ) > > Right, I agree it should be possible to do both. I was thinking maybe > "apk info -D" for all the depends, recursively, and "apk info -D -1" for > just a single level. But maybe it'd be better to have "apk info -D" just > do the single level (as it does now), and "apk info -D --recursive" do > the recursing. And maybe it'd be better to use "-R" as the short-form > for "--recursive". > > Instead of -R/--rdepends, then, we'd need something like --N/--needers. > But perhaps we can find a better name. I like -r/--rdepends better than -N/--needers. ... > > I think recursive operation makes no sense for apk info, but for apk > > search, yes. > > No, I've several times had to hand-script recursive operations for "apk > info". If you're just going downwards, then you could use apk search > too; but you might want to go recursively upwards, limited just to > installed packages. When and why would you need something like that? Situations where I have needed something similar: * figuring out build order (but then I need to use makedepends so I can not really use apk here) * figuring out which files are needed to get downloaded to build an iso. I use apk fetch --recursive --simulate for this http://git.alpinelinux.org/cgit/alpine-iso/tree/Makefile#n34 * figure out what packages would get installed (use apk add --simulate) * figure out what package would get deleted (use apk del --simulate) > > When i think of it, --recursive only make sense downwards in dependency > > tree (similar when talking about directories in file system) with the > > exception of 'apk del' > > As I said, I can remember needing this several times over the past > months. Don't remember the details though; or anyway, can't remember > them in a form where I can easily abstract away the idiosyncracies of > what I happened to be doing. It would be interesting to know what kind of problems you needed to solve. Might be it could be solved in a different way. (I must admit, I am not too happy with apk fetch --simluate 2>&1 | sed 's/^Downloading: //' so yes there is room for improvements here) > > The above summary would be change to (* means a breakage from current): > > Options for del command: > > -r, --rdepends Recursively delete all top-level reverse dependencies > > too > > Options for fix command: > > * -R, --recursive Recursively fix all dependencies too > > > > Options for fetch command: > > -R, --recursive Recursively fetch the PACKAGE and all its dependencies > > > > Options for audit command: > > * -R, --recursive Recursively list individually all entries in new directories > > > > > > Since -R now means 'recursive' and -d already means 'description' we > > could change apk info's non recursive to -D > > > > Options for info command: > > * -D, --depends List packages that the PACKAGE depends on > > > > But i am also ok with keeping 'apk info -R' as an exception. (i think > > -R was originally taken to correspond to BSD's pkg_info -R) > > > > how does that sound? > > > How about this: > > > Options for del command: > -N, --needed Recursively delete all top-level reverse dependencies too > -r Synonym for -N (deprecated) I kinda still prefer -r/--rdepends > No option is needed here to recursively delete all downward dependencies > that aren't required by anything in 'world', right? Because we are > always going to do that by design. > > > Options for fix command: > -R, --recursive Recursively fix all dependencies too > -d Synonym for -R (deprecated) Those are good IMHO. > -r, --reinstall Reinstall the package (default) <--- would > prefer not to have "apk del -r" be canonical, to avoid confusion with > other uses of "-r" like this We could maybe remove (or mark as deprecated) -r/--reinstall for apk fix, since it is the default now anyways. > Options for fetch command: > -R, --recursive Recursively fetch the PACKAGE and all its dependencies Good. > Options for audit command: > -R, --recursive Recursively list individually all entries in new directories > -r Synonym for -R (deprecated) <-- as with "apk > fix -r" Good. > Options for info command: (or "apk info --world", if we go that route) > -d, --description Print description for PACKAGE > -D, --depends List packages that the PACKAGE (directly) depends on > -R Synonym for -D (deprecated) I'm ok with those. (But i think I'd be ok to keep -R too for --depends) > -N, --needed List all installed packages (directly) depending on PACKAGE > -r Synonym for -N (deprecated) > > Except we might introduce breakage here and have -R combine with -D and > -N to make them recursive. I understand what you mean, and, yes you definitively have a point here. But, lets say that you want figure the total size (including depends). Now, you'd want run 'apk info --recursive -s' but you'd don't want print the --depends. (specially if we fix 'apk info -q -s pkg' to print ' ' so it could be sort -n, or similar) So, basically, we need differ 'print depends' and 'run recursively on depends'. I don't think we can use -R in combination with --depends/--needed/--rdepends. *if* we want keep the possibility open to run apk info recursively, we should probably use: -R(?)/--recursive recursively display info for dependency packages -?/--recursive-reverse Recursively display info for packages required by the specified > Options for search command: (or "apk info" without "--world", if we go > that route) > -d, --description Search package descriptions (implies -a) > -N, --needed List all (installed and uninstalled) packages (directly) depending on PACKAGE > -r Synonym for -N (deprecated) > -R Combines with -N to make it recursive > > > Again, I'm not especially fond of the particular choice -N/--needed. > Just using it because I don't have something better. agree. Not too fond of -N/--needed either. 'needed' sounds like a synonym for 'depends' maybe -b/--required-by or some combination of -b and --needed-by/--required-by. for recursing the reverse deps (apk del/apk info) maybe --recurse-required-by or --recurse-needed-by I think -b and -B are 'free'. 'B' as in required-'B'y/needed-'B'y or 'B'ackwards. -nc --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---