Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
etckeeper is a collection of tools to let /etc be stored in a git,
mercurial, darcs, or bzr repository. It hooks into apt (and other
package managers including yum and pacman-g2) to automatically commit
changes made to /etc during package upgrades. It tracks file metadata
that revison control systems do not normally support, but that is
important for /etc, such as the permissions of /etc/shadow.
It's quite modular and configurable, while also being simple to use
if you understand the basics of working with revision control.
+79
View File
@@ -0,0 +1,79 @@
# $NetBSD: Makefile,v 1.3 2013/06/26 14:26:47 joerg Exp $
#
DISTNAME= etckeeper_1.3
PKGNAME= ${DISTNAME:S/_/-/}
PKGREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_DEBIAN:=pool/main/e/etckeeper/}
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://joeyh.name/code/etckeeper/
COMMENT= Store /etc in git, mercurial, bzr or darcs
LICENSE= gnu-gpl-v2
WRKSRC= ${WRKDIR}/etckeeper
USE_LANGUAGES= # none
USE_TOOLS+= sed perl:run
NO_CONFIGURE= yes
NO_BUILD= yes
AUTO_MKDIRS= yes
BUILD_DEFS+= VARBASE
.include "cf-files.mk"
PKG_SYSCONFSUBDIR= etckeeper
OWN_DIRS+= ${VARBASE}/cache/etckeeper
OWN_DIRS+= ${PKG_SYSCONFDIR}
OWN_DIRS+= ${CF_FILES:H:O:u:S@^@${PKG_SYSCONFDIR}/@}
EGDIR= ${PREFIX}/share/examples/etckeeper
CONF_FILES+= ${EGDIR}/etckeeper.conf ${PKG_SYSCONFDIR}/etckeeper.conf
.for file in ${CF_FILES:M*/README}
CONF_FILES+= ${EGDIR}/${file} ${PKG_SYSCONFDIR}/${file}
.endfor
.for file in ${CF_FILES:N*/README}
CONF_FILES_PERMS+= ${EGDIR}/${file} ${PKG_SYSCONFDIR}/${file} \
${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 755
.endfor
SUBST_CLASSES+= config
SUBST_STAGE.config= pre-install
SUBST_FILES.config+= etckeeper
SUBST_FILES.config+= etckeeper.8
SUBST_FILES.config+= pre-install.d/10packagelist
SUBST_FILES.config+= post-install.d/50vcs-commit
SUBST_FILES.config+= bash_completion
SUBST_FILES.config+= debian/cron.daily
SUBST_VARS.config+= PKG_SYSCONFBASEDIR
SUBST_VARS.config+= PKG_SYSCONFDIR
SUBST_VARS.config+= VARBASE
SUBST_VARS.config+= PREFIX
do-install:
${INSTALL_SCRIPT} ${WRKSRC}/etckeeper ${DESTDIR}${PREFIX}/bin
${INSTALL_DATA} ${WRKSRC}/etckeeper.conf ${DESTDIR}${EGDIR}
for file in ${CF_FILES}; do \
${INSTALL_DATA} ${WRKSRC}/$${file} ${DESTDIR}${EGDIR}/$${file} ;\
done
${RM} -f ${DESTDIR}${EGDIR}/*.d/*.orig
${INSTALL_SCRIPT} ${WRKSRC}/debian/cron.daily \
${DESTDIR}${PREFIX}/libexec/etckeeper.daily
${INSTALL_MAN} ${WRKSRC}/etckeeper.8 \
${DESTDIR}${PREFIX}/${PKGMANDIR}/man8
${INSTALL_DATA} ${WRKSRC}/README \
${DESTDIR}${PREFIX}/share/doc/etckeeper/README
${INSTALL_DATA} ${WRKSRC}/bash_completion \
${DESTDIR}${PREFIX}/share/bash-completion.d/etckeeper
.PHONY:gen-cf-files
gen-cf-files:
grep '[$$]NetBSD' >cf-files.mk
${ECHO} '#' >>cf-files.mk
${SH} -c 'cd ${WRKSRC} && ${LS} -1 *.d/*' | \
${SED} -e'/\.orig$$/d' -e's@^@CF_FILES+= @' >>cf-files.mk
.include "../../mk/bsd.pkg.mk"
+42
View File
@@ -0,0 +1,42 @@
@comment $NetBSD: PLIST,v 1.1 2013/05/27 08:36:00 sbd Exp $
bin/etckeeper
libexec/etckeeper.daily
share/bash-completion.d/etckeeper
share/doc/etckeeper/README
share/examples/etckeeper/commit.d/10vcs-test
share/examples/etckeeper/commit.d/30bzr-add
share/examples/etckeeper/commit.d/30darcs-add
share/examples/etckeeper/commit.d/30git-add
share/examples/etckeeper/commit.d/30hg-addremove
share/examples/etckeeper/commit.d/50vcs-commit
share/examples/etckeeper/commit.d/99push
share/examples/etckeeper/commit.d/README
share/examples/etckeeper/etckeeper.conf
share/examples/etckeeper/init.d/10restore-metadata
share/examples/etckeeper/init.d/20restore-etckeeper
share/examples/etckeeper/init.d/40vcs-init
share/examples/etckeeper/init.d/50vcs-ignore
share/examples/etckeeper/init.d/50vcs-perm
share/examples/etckeeper/init.d/50vcs-pre-commit-hook
share/examples/etckeeper/init.d/60darcs-deleted-symlinks
share/examples/etckeeper/init.d/70vcs-add
share/examples/etckeeper/init.d/README
share/examples/etckeeper/list-installed.d/50list-installed
share/examples/etckeeper/post-install.d/50vcs-commit
share/examples/etckeeper/post-install.d/README
share/examples/etckeeper/pre-commit.d/20warn-problem-files
share/examples/etckeeper/pre-commit.d/30store-metadata
share/examples/etckeeper/pre-commit.d/README
share/examples/etckeeper/pre-install.d/10packagelist
share/examples/etckeeper/pre-install.d/50uncommitted-changes
share/examples/etckeeper/pre-install.d/README
share/examples/etckeeper/unclean.d/50test
share/examples/etckeeper/unclean.d/README
share/examples/etckeeper/uninit.d/01prompt
share/examples/etckeeper/uninit.d/50remove-metadata
share/examples/etckeeper/uninit.d/50vcs-uninit
share/examples/etckeeper/uninit.d/README
share/examples/etckeeper/update-ignore.d/01update-ignore
share/examples/etckeeper/update-ignore.d/README
share/examples/etckeeper/vcs.d/50vcs-cmd
man/man8/etckeeper.8
+37
View File
@@ -0,0 +1,37 @@
# $NetBSD: cf-files.mk,v 1.1 2013/05/27 08:36:00 sbd Exp $
#
CF_FILES+= commit.d/10vcs-test
CF_FILES+= commit.d/30bzr-add
CF_FILES+= commit.d/30darcs-add
CF_FILES+= commit.d/30git-add
CF_FILES+= commit.d/30hg-addremove
CF_FILES+= commit.d/50vcs-commit
CF_FILES+= commit.d/99push
CF_FILES+= commit.d/README
CF_FILES+= init.d/10restore-metadata
CF_FILES+= init.d/20restore-etckeeper
CF_FILES+= init.d/40vcs-init
CF_FILES+= init.d/50vcs-ignore
CF_FILES+= init.d/50vcs-perm
CF_FILES+= init.d/50vcs-pre-commit-hook
CF_FILES+= init.d/60darcs-deleted-symlinks
CF_FILES+= init.d/70vcs-add
CF_FILES+= init.d/README
CF_FILES+= list-installed.d/50list-installed
CF_FILES+= post-install.d/50vcs-commit
CF_FILES+= post-install.d/README
CF_FILES+= pre-commit.d/20warn-problem-files
CF_FILES+= pre-commit.d/30store-metadata
CF_FILES+= pre-commit.d/README
CF_FILES+= pre-install.d/10packagelist
CF_FILES+= pre-install.d/50uncommitted-changes
CF_FILES+= pre-install.d/README
CF_FILES+= unclean.d/50test
CF_FILES+= unclean.d/README
CF_FILES+= uninit.d/01prompt
CF_FILES+= uninit.d/50remove-metadata
CF_FILES+= uninit.d/50vcs-uninit
CF_FILES+= uninit.d/README
CF_FILES+= update-ignore.d/01update-ignore
CF_FILES+= update-ignore.d/README
CF_FILES+= vcs.d/50vcs-cmd
+16
View File
@@ -0,0 +1,16 @@
$NetBSD: distinfo,v 1.1 2013/05/27 08:36:00 sbd Exp $
SHA1 (etckeeper_1.3.tar.gz) = 8716d5cfc9fc584bf0069932383ec1ca956f4788
RMD160 (etckeeper_1.3.tar.gz) = 43404007c3d5b727ee2040477245591ab17372ca
Size (etckeeper_1.3.tar.gz) = 47387 bytes
SHA1 (patch-bash__completion) = 95936127f98a76b4b7b66ddc170ba6c1e1e4c0d9
SHA1 (patch-debian_cron.daily) = 5473807c2bcab9931e6324436f1d1ff3363ee3d2
SHA1 (patch-etckeeper) = 07a6b61b6c79096065953d22087c32ea5d776f2c
SHA1 (patch-etckeeper.8) = bb6e59169edac6ae16cebd25c05aa3c2305b3990
SHA1 (patch-etckeeper.conf) = c246bf082a1b7137c3f50fa43e432ea9c1587464
SHA1 (patch-init.d_40vcs-init) = d267d4e7e2b82353614ed15455c2739e1c8f92d6
SHA1 (patch-list-installed.d_50list-installed) = b0c9a500fa80c97686f229b8f936de6f1c8de7e0
SHA1 (patch-post-install.d_50vcs-commit) = c79cd3c5f195cbc4808074557818f5f7d9a4e457
SHA1 (patch-pre-install.d_10packagelist) = c2383ef03e2f360c581acb2c4c3ca09bad8cac10
SHA1 (patch-pre-install.d_50uncommitted-changes) = 908a2cf5a107346a57f3fde1f1076c2ec7f92b9f
SHA1 (patch-update-ignore.d_01update-ignore) = 3e73493f268da3d40623fcd192d3da911357acee
@@ -0,0 +1,15 @@
$NetBSD: patch-bash__completion,v 1.1 2013/05/27 08:36:00 sbd Exp $
Add SUBST_VARS token.
--- bash_completion.orig 2011-02-22 20:19:36.000000000 +0000
+++ bash_completion
@@ -2,7 +2,7 @@ _etckeeper() {
local cur;
COMPREPLY=();
cur=${COMP_WORDS[COMP_CWORD]};
- COMPREPLY=( $( compgen -W '$(cd /etc/etckeeper/; for i in *.d/; do echo ${i%.d/}; done)' -- $cur ) );
+ COMPREPLY=( $( compgen -W '$(cd @PKG_SYSCONFDIR@; for i in *.d/; do echo ${i%.d/}; done)' -- $cur ) );
}
complete -F _etckeeper etckeeper
@@ -0,0 +1,20 @@
$NetBSD: patch-debian_cron.daily,v 1.1 2013/05/27 08:36:00 sbd Exp $
Add SUBST_VARS tokens.
--- debian/cron.daily.orig 2011-12-05 15:41:29.000000000 +0000
+++ debian/cron.daily
@@ -1,10 +1,10 @@
#!/bin/sh
set -e
-if [ -x /usr/bin/etckeeper ] && [ -e /etc/etckeeper/etckeeper.conf ]; then
- . /etc/etckeeper/etckeeper.conf
+if [ -x @PREFIX@/bin/etckeeper ] && [ -e @PKG_SYSCONFDIR@/etckeeper.conf ]; then
+ . @PKG_SYSCONFDIR@/etckeeper.conf
if [ "$AVOID_DAILY_AUTOCOMMITS" != "1" ]; then
# avoid autocommit if an install run is in progress
- lockfile=/var/cache/etckeeper/packagelist.pre-install
+ lockfile=@VARBASE@/cache/etckeeper/packagelist.pre-install
if [ -e "$pe" ] && [ -n "$(find "$lockfile" -mtime +1)" ]; then
rm -f "$lockfile" # stale
fi
@@ -0,0 +1,24 @@
$NetBSD: patch-etckeeper,v 1.1 2013/05/27 08:36:00 sbd Exp $
Add SUBST_VARS tokens.
--- etckeeper.orig 2012-12-28 16:09:51.000000000 +0000
+++ etckeeper
@@ -2,7 +2,7 @@
set -e
if [ -z "$ETCKEEPER_CONF_DIR" ]; then
- ETCKEEPER_CONF_DIR=/etc/etckeeper
+ ETCKEEPER_CONF_DIR=@PKG_SYSCONFDIR@
fi
conf="$ETCKEEPER_CONF_DIR/etckeeper.conf"
@@ -86,7 +86,7 @@ if [ "x$1" = "x-d" ]; then
fi
if [ -z "$ETCKEEPER_DIR" ]; then
- ETCKEEPER_DIR=/etc
+ ETCKEEPER_DIR=@PKG_SYSCONFBASEDIR@
fi
cd "$ETCKEEPER_DIR"
export ETCKEEPER_DIR
@@ -0,0 +1,51 @@
$NetBSD: patch-etckeeper.8,v 1.1 2013/05/27 08:36:00 sbd Exp $
Add SUBST_VARS tokens.
--- etckeeper.8.orig 2012-06-02 22:14:44.000000000 +0000
+++ etckeeper.8
@@ -5,21 +5,21 @@ etckeeper \- store /etc in git, mercuria
.SH SYNOPSIS
.B etckeeper command [-d directory]
.SH DESCRIPTION
-etckeeper manages /etc be stored in a git, mercurial, bazaar, or darcs
-repository. By default each of the commands operates on /etc, but a
-different directory can be specified to operate on a clone of the /etc
+etckeeper manages @PKG_SYSCONFBASEDIR@ be stored in a git, mercurial, bazaar, or darcs
+repository. By default each of the commands operates on @PKG_SYSCONFBASEDIR@, but a
+different directory can be specified to operate on a clone of the @PKG_SYSCONFBASEDIR@
repository located elsewhere.
.SH COMMANDS
.TP
.B init
This initialises and sets up a git, mercurial, bazaar, or darcs
repository (depending on the VCS setting in
-/etc/etckeeper/etckeeper.conf). Typically this is run in /etc once
+@PKG_SYSCONFDIR@/etckeeper.conf). Typically this is run in @PKG_SYSCONFBASEDIR@ once
when starting to use etckeeper on a machine. It can also be used to
-initialise a clone of the /etc repository located elsewhere.
+initialise a clone of the @PKG_SYSCONFBASEDIR@ repository located elsewhere.
.TP
.B commit [message]
-Commits all changes in /etc to the repository. A commit message can be
+Commits all changes in @PKG_SYSCONFBASEDIR@ to the repository. A commit message can be
specified. You may also use the underlying VCS to commit manually.
(Note that etckeeper commit will notice if a user has used sudo or su to
become root, and record the original username in the commit.)
@@ -60,13 +60,13 @@ uninit, then modify etckeeper.conf to us
etckeeper init. (The -f switch can be used to force uninit without
prompting.)
.SH FILES
-/etc/etckeeper/etckeeper.conf is the configuration file.
+@PKG_SYSCONFDIR@/etckeeper.conf is the configuration file.
-/etc/etckeeper also contains directories containing the programs that are
+PKG_SYSCONFDIR also contains directories containing the programs that are
run for each of the above commands.
.SH ENVIRONMENT VARIABLES
ETCKEEPER_CONF_DIR path to configuration directory instead of default /etc/etckeeper.
.SH SEE ALSO
-/usr/share/doc/etckeeper/README.gz
+@PREFIX@/share/doc/etckeeper/README
.SH AUTHOR
Joey Hess <joey@kitenet.net>
@@ -0,0 +1,20 @@
$NetBSD: patch-etckeeper.conf,v 1.1 2013/05/27 08:36:00 sbd Exp $
Make pkg_install the package manager.
--- etckeeper.conf.orig 2012-11-19 16:07:40.000000000 +0000
+++ etckeeper.conf
@@ -31,11 +31,11 @@ DARCS_COMMIT_OPTIONS="-a"
# The high-level package manager that's being used.
# (apt, pacman-g2, yum, zypper etc)
-HIGHLEVEL_PACKAGE_MANAGER=apt
+HIGHLEVEL_PACKAGE_MANAGER=pkg_add
# The low-level package manager that's being used.
# (dpkg, rpm, pacman-g2, etc)
-LOWLEVEL_PACKAGE_MANAGER=dpkg
+LOWLEVEL_PACKAGE_MANAGER=pkg_install
# To push each commit to a remote, put the name of the remote here.
# (eg, "origin" for git).
@@ -0,0 +1,26 @@
$NetBSD: patch-init.d_40vcs-init,v 1.1 2013/05/27 08:36:00 sbd Exp $
Change '/etc' to ${ETCKEEPER_DIR}
--- init.d/40vcs-init.orig 2011-02-22 20:19:36.000000000 +0000
+++ init.d/40vcs-init
@@ -3,15 +3,15 @@ set -e
if [ "$VCS" = git ] && [ ! -e .git ]; then
git init
- echo "$(hostname) /etc repository" > .git/description
+ echo "$(hostname) ${ETCKEEPER_DIR} repository" > .git/description
elif [ "$VCS" = hg ] && [ ! -e .hg ]; then
hg init
echo "[web]" > .hg/hgrc
- echo "description = $(hostname) /etc repository" >> .hg/hgrc
+ echo "description = $(hostname) ${ETCKEEPER_DIR} repository" >> .hg/hgrc
elif [ "$VCS" = bzr ] && [ ! -e .bzr ]; then
bzr init
- bzr nick "$(hostname) /etc repository"
+ bzr nick "$(hostname) ${ETCKEEPER_DIR} repository"
elif [ "$VCS" = darcs ] && [ ! -e _darcs ]; then
darcs initialize
- echo "$(hostname) /etc repository" > _darcs/prefs/motd
+ echo "$(hostname) ${ETCKEEPER_DIR} repository" > _darcs/prefs/motd
fi
@@ -0,0 +1,17 @@
$NetBSD: patch-list-installed.d_50list-installed,v 1.1 2013/05/27 08:36:00 sbd Exp $
Add pkg_install support.
--- list-installed.d/50list-installed.orig 2011-02-22 20:19:36.000000000 +0000
+++ list-installed.d/50list-installed
@@ -2,7 +2,9 @@
# Output to stdout a *sorted* list of all currently installed
# (or removed but still with config-files) packages, in the
# format "package version\n" (or something similar).
-if [ "$LOWLEVEL_PACKAGE_MANAGER" = dpkg ]; then
+if [ "$LOWLEVEL_PACKAGE_MANAGER" = pkg_install ]; then
+ pkg_info -a -I | awk '{print $1}' | sort
+elif [ "$LOWLEVEL_PACKAGE_MANAGER" = dpkg ]; then
dpkg-query -W -f '${Status}\t${Package} ${Version}\n' | \
egrep '(ok installed|ok config-files)' | cut -f2,3
elif [ "$LOWLEVEL_PACKAGE_MANAGER" = rpm ]; then
@@ -0,0 +1,19 @@
$NetBSD: patch-post-install.d_50vcs-commit,v 1.1 2013/05/27 08:36:00 sbd Exp $
Add SUBST_VARS token.
--- post-install.d/50vcs-commit.orig 2011-02-22 20:19:36.000000000 +0000
+++ post-install.d/50vcs-commit
@@ -1,10 +1,10 @@
#!/bin/sh
set -e
-pl="/var/cache/etckeeper/packagelist"
+pl="@VARBASE@/cache/etckeeper/packagelist"
if etckeeper unclean; then
- message="committing changes in /etc after $HIGHLEVEL_PACKAGE_MANAGER run"
+ message="committing changes in ${ETCKEEPER_DIR} after $HIGHLEVEL_PACKAGE_MANAGER run"
if [ -e $pl.pre-install ]; then
(
@@ -0,0 +1,13 @@
$NetBSD: patch-pre-install.d_10packagelist,v 1.1 2013/05/27 08:36:00 sbd Exp $
Add SUBST_VARS token.
--- pre-install.d/10packagelist.orig 2011-02-22 20:19:36.000000000 +0000
+++ pre-install.d/10packagelist
@@ -1,4 +1,4 @@
#!/bin/sh
# This list will be later used when committing.
-mkdir -p /var/cache/etckeeper/
-etckeeper list-installed > /var/cache/etckeeper/packagelist.pre-install
+mkdir -p @VARBASE@/cache/etckeeper/
+etckeeper list-installed > @VARBASE@/cache/etckeeper/packagelist.pre-install
@@ -0,0 +1,26 @@
$NetBSD: patch-pre-install.d_50uncommitted-changes,v 1.1 2013/05/27 08:36:00 sbd Exp $
Change '/etc' to ${ETCKEEPER_DIR}.
--- pre-install.d/50uncommitted-changes.orig 2011-02-22 20:19:36.000000000 +0000
+++ pre-install.d/50uncommitted-changes
@@ -13,16 +13,16 @@ fi
if etckeeper unclean; then
if [ "$AVOID_COMMIT_BEFORE_INSTALL" = 1 ]; then
echo "" >&2
- echo "** etckeeper detected uncommitted changes in /etc prior to $HIGHLEVEL_PACKAGE_MANAGER run" >&2
+ echo "** etckeeper detected uncommitted changes in ${ETCKEEPER_DIR} prior to $HIGHLEVEL_PACKAGE_MANAGER run" >&2
echo "** Aborting $HIGHLEVEL_PACKAGE_MANAGER run. Manually commit and restart." >&2
echo "" >&2
exit 1
fi
- if ! etckeeper commit "saving uncommitted changes in /etc prior to $HIGHLEVEL_PACKAGE_MANAGER run"; then
+ if ! etckeeper commit "saving uncommitted changes in ${ETCKEEPER_DIR} prior to $HIGHLEVEL_PACKAGE_MANAGER run"; then
if [ -e /usr/share/debconf/confmodule ]; then
$0 fail-debconf
else
- echo "error: etckeeper failed to commit changes in /etc using $VCS"
+ echo "error: etckeeper failed to commit changes in ${ETCKEEPER_DIR} using $VCS"
exit 1
fi
fi
@@ -0,0 +1,15 @@
$NetBSD: patch-update-ignore.d_01update-ignore,v 1.1 2013/05/27 08:36:00 sbd Exp $
Change '/etc' to ${ETCKEEPER_DIR}.
--- update-ignore.d/01update-ignore.orig 2013-05-09 02:35:47.000000000 +0000
+++ update-ignore.d/01update-ignore
@@ -115,7 +115,7 @@ writefile () {
ignore blkid.tab.old
nl
- comment "some other files in /etc that typically do not need to be tracked"
+ comment "some other files in ${ETCKEEPER_DIR} that typically do not need to be tracked"
ignore nologin
ignore ld.so.cache
ignore prelink.cache