tech-pkg archive

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

Re: pkg_install patch to support sysutils/etckeeper



On Wed, 29 May 2013, Thomas Klausner wrote:

> On Wed, May 29, 2013 at 10:58:02PM +1200, Steven Drake wrote:
> > 
> > Correct, what basically need to be automated is
> > 
> > $ etckeeper pre-install
> > $ pkg_add a-package another-package ...
> > $ etckeeper post-install
> > 
> > Whats important is that the pre-install command is run before any package
> > is installed and the post-install command run after all packages have been 
> > installed.  Using a shell script wrapper around pkg_add would work fine.
> 
> So do I understand correctly that it wouldn't fit well in the design
> concept of etckeeper to be called after every pkg_add/pkg_delete?

Depends on whats wanted/preferred, I think that I should explain (partly,
i.e. WRT package management) how etckeeper works:

When 'etckeeper pre-install' is run the current state of etc is committed to
the scm (if needed) and a list of currently installed packages is made.

When 'etckeeper post-install' is run the new state of etc is committed to
the scm (if needed) when the list of changed packages.

Below is what I get if I do the following on in buildbox chroot 
with only the bootstrap kit installed (hope it helps):

-root@pkgbuild# pkg_add etckeeper scmgit-base
-root@pkgbuild# etckeeper init 
Initialized empty Git repository in /usr/pkg/etc/.git/
-root@pkgbuild# etckeeper pre-install 
[master (root-commit) c56a043] saving uncommitted changes in /usr/pkg/etc prior 
to pkg_add run
 39 files changed, 1425 insertions(+)
[...]
-root@pkgbuild# pkg_add wget 
pkg_add: Warning: package `wget-1.14nb2' was built for a platform:
pkg_add: Linux/x86_64 3.2.7 (pkg) vs. Linux/x86_64 3.9.3 (this host)
wget-1.14nb2: copying /usr/pkg/share/examples/wget/wgetrc to /usr/pkg/etc/wgetrc
wget-1.14nb2: registering info file /usr/pkg/share/info/wget.info
-root@pkgbuild# etckeeper post-install 
[master af98d23] committing changes in /usr/pkg/etc after pkg_add run
 2 files changed, 126 insertions(+)
 create mode 100644 wgetrc
-root@pkgbuild# git log 
commit af98d2396c617ad92fb479c68a048b11272b8170
Author: root <root@pkgbuild>
Date:   Wed May 29 23:43:09 2013 +1200

    committing changes in /usr/pkg/etc after pkg_add run
    
    Package changes:
    +wget-1.14nb2

commit c56a0435d16729bf277fd27ec8695111c8d82093
Author: root <root@pkgbuild>
Date:   Wed May 29 23:42:57 2013 +1200

    saving uncommitted changes in /usr/pkg/etc prior to pkg_add run

-- 
Steven



Home | Main Index | Thread Index | Old Index