tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: one for the wishlist

On Thu, Aug 11, 2011 at 12:50 AM, Jörn Clausen 
<> wrote:
> Hi!
> Maybe this is already doable somehow, maybe this is not worth it...
> Probably I get told to do it myself... Anyway:
> I'd like to see a feature in pkgsrc that creates an automatic log of
> the packages installed, preferably in a human readable format, e.g. a
> text file with one line per record. It should contain information
> - when a package was installed (name, version, timestamp)
> - why it was installed (as dependency of what other package)
> - when a package was updated
> - when a package was removed

Have a look at pkgtools/nih. This is a package manager
manipulating binary packages. In the last release I added "history"
subcommand that does exactly what you need.
At the moment at doesn't show that packages were installed as a
dependency. I'll implement this in the next release and change output
format a little bit. Internally every time you "nih install" or "nih
remove" it saves shortened summary of installed packages in
~/.nih/installed_YYYYMMDD_MMHH.txt file where
PKGNAME,PKGPATH,automatic,BUILD_TIME and some others are stored. "nih
history" uses these files.

# nih history
2011-06-27 14:29 vs. 2011-06-27 14:30:
    + x11/inputproto inputproto 2.0
2011-06-27 14:30 vs. 2011-06-28 15:41:
    < devel/libmaa libmaa 1.2.0 1.3.0
    + pkgtools/osabi osabi-NetBSD 5.99.53
    + pkgtools/x11-links x11-links 0.65
    < editors/emacs22 emacs 22.3nb13 22.3nb14
    + parallel/paexec paexec 0.16.1nb1
    < textproc/dict-client dict-client 1.12.0 1.12.0nb1
    < textproc/dict-server dict-server 1.12.0 1.12.0nb1
    - x11/kbproto kbproto 1.0.5
    - x11/xcb-proto xcb-proto 1.6
    - x11/inputproto inputproto 2.0
    - x11/xproto xproto 7.0.18
    - x11/xextproto xextproto 7.1.2
2011-06-28 15:41 vs. 2011-06-28 15:42:
    + net/samba35 samba 3.5.8
    - pkgtools/x11-links x11-links 0.65

"+" means "installed", "-" -- "removed", "<" -- updated,
">" -- downgraded. "!" -- changed (BUILD_TIME changed)
In the next release I'll add letter modifies "a"/"u" for
"installed as a dependency" and "installed by user" and some other
nih-specific flags.

> When testing a package and
> removing it later, I find it hard to clean up all dependencies that
> are no longer used.

"nih" removes leaf packages installed as a dependency automatically.
pkgsrc pkgdb keeps all required information for this (flag
"automatic", see pkg_add -A).
You can also set/reset this flag manually using "nih mark -a"
or "nih mark -u".

"nih" also provides "nih leaf" command for seeing/removing such
packages manually.

> pkg_add could be a reasonable place to
> implement this.

Personally, I would prefer to keep pkg_* utilities as low-level
package management utilities just like Linux's rpm and dpkg.
But our pkg_* are better ;-)
Again, have a look "pkgtools/nih". Our pkg_* are power enough
for making sysadmin/user's life much easier.

Home | Main Index | Thread Index | Old Index