Subject: [alpine-devel] RFC: apk-tools user interface

From: Natanael Copa <[email-masked]>
Date: Tue, 2 Mar 2010 10:18:08 +0100

Hi,

The apk-tools user interface have some leftovers from apk-tools-1.x
which had an user interface similar to freebsd's pkg-tools. I don't
see any point in that anymore and i think its time to think over the
user interface for apk tools. I think we want keep 'apk add' and 'apk
del' like they are more or less for compatibility but I think it might
be good redo some of the other applets, at least 'apk info'.

How about we make a new applet called 'apk query' that eventually will
replace the 'apk info' applet?

Some ideas:
list files owned by package(s):
  apk query --list <package>...
  apk query -l <package>...

list installed package:
  apk query --installed
  apk query -I

find package that owns given file(s):
 apk query --owns <file>...
 apk query -o <file>...

list toplevel packages:
 apk query --world
 apk query -w

list dependencies for package(s):
 apk query --depend <package>...
 apk query -d <package>...
 (maybe have recursive option for this...)

list reverse dependencies for package(s):
 apk query --revdep <package>...
 apk query -D <package>...

list orphans (installed packages that is not in world nor have reverse deps)
 apk query --orphans (or --unrequired?)
 apk query -O

list packages installed thats not in index (this useful before doing upgrades):
 apk query --foreign

show information for package (same as 'apk query --description
--homepage --size')

We could have flags for opening either index, installed database or
both (by default only installed db?)

Might also want the stuff thats provided by apk info:
 --homepage, -H (or --url, -u)
 --pre-install
 --post-install
 --scripts, -S
 --description (or --summary or --comment?), -c
 --triggers, -t
 --size, -s
 --is-installed, -q (or --query -q or --evaluate, -e or something else)

Maybe we could have a flag for opening a file instead of installed db
or index, so you can:
apk query --info foo-1.9-r0.apk

I'm open to other ideas for apk-tools command line interface.

-- 
Natanael Copa

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Timo Teräs <[email-masked]>
Date: Tue, 02 Mar 2010 11:49:56 +0200

> be good redo some of the other applets, at least 'apk info'.

If you have strong arguments why to do it, then sure. I remember we
decided to clone old shell interface to maintain compatibility with
scripts.

> replace the 'apk info' applet?

Yes, this would be the way to do it.

I'm not against this, as the old style is slightly non-obvious and
strange at points.

However, doing this will require updating all scripts and have the
users learn a new set of commands. Is it worth it? -- If the new
commands are same as in e.g. apt, dpkg, rpm or some other popular
package manager, then I think it's a good direction.

- Timo

---

---

From: Natanael Copa <[email-masked]>
Date: Tue, 2 Mar 2010 11:54:53 +0100

> I'm not against this, as the old style is slightly non-obvious and

This is the main reason.

There are also some missing features. Like finding top level packages
and orphans. Been thinking that the output format could be different
too. Then I thought, if we decide to break compat then we should
probably do things correctly.

> users learn a new set of commands. Is it worth it?

I think we want keep the most common stuff as is, i.e 'apk add' and
'apk del' to not make it a too big chock.

> -- If the new

i picked some ideas from pacman, but i'm open to other suggestions.
The point is that it might be a good time to rethink the command line
interface now, before alpine-2.0

-- 
Natanael Copa

---