diff options
author | Mathieu Clabaut <mathieu.clabaut@gmail.com> | 2007-12-21 15:47:30 -0600 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-01-03 19:53:46 -0500 |
commit | c65ad8cba4ebf8eb7625b4e0801a6c68125384ac (patch) | |
tree | 204484985d654749dc696e25bb200fb3f2e9da58 /hg | |
parent | b7ea2156e88479a2fe829894a606707df5555b6f (diff) |
Tranlsation of init.d in mercurial idiom
Diffstat (limited to 'hg')
-rw-r--r-- | hg/init.d/40hg-init | 7 | ||||
-rw-r--r-- | hg/init.d/50hg-ignore | 51 | ||||
-rw-r--r-- | hg/init.d/50hg-perm | 2 | ||||
-rw-r--r-- | hg/init.d/50hg-pre-commit-hook | 15 | ||||
-rw-r--r-- | hg/init.d/70hg-add | 4 |
5 files changed, 56 insertions, 23 deletions
diff --git a/hg/init.d/40hg-init b/hg/init.d/40hg-init index 69867c4..cf9733b 100644 --- a/hg/init.d/40hg-init +++ b/hg/init.d/40hg-init @@ -1,6 +1,7 @@ #!/bin/sh set -e -if [ ! -e .git ]; then - git-init - echo "$(hostname) /etc repository" > .git/description +if [ ! -e .hg ]; then + hg init + echo "[web]\n" > .hg/hgrc + echo "$(hostname) /etc repository" > .hg/hgrc fi diff --git a/hg/init.d/50hg-ignore b/hg/init.d/50hg-ignore index f931592..b02107e 100644 --- a/hg/init.d/50hg-ignore +++ b/hg/init.d/50hg-ignore @@ -1,22 +1,57 @@ #!/bin/sh set -e -if [ ! -e .gitignore ]; then - cat >.gitignore <<EOF -*~ +if [ ! -e .hgignore ]; then + cat >.hgignore <<EOF +*~$ +.lock$ +/\.keep +^X11/xdm/authdir/authfiles/.*:[0-9]- +^mail/aliases\.db$ +adjtime +axfrdns/log/ +axfrdns/supervise/ +^blkid\.tab +config-archive +cups/.*\.O +dnscache/log/ +dnscache/root/servers/ +dnscache/seed +dnscache/supervise/ +^mtab$ +group- +ld.so.cache +mtab\.fuselock +openvpn/.*\.wav +passwd- +postfix/.*\.db +shadow- +skey/skeykeys +splash/.*/images/ +splash/.*\.ttf +tinydns/log/ +tinydns/root/\.serial +tinydns/root/data.cdb +tinydns/supervise/ +vmware/vmnet.*/dhcpd/dhcpd.lease* +.old$ +.rpmsave$ +.rpmorig$ +.bak$ +squid/errors +.OLD$ +.orig$ +.swp$ +^.java/.* # new and old versions of conffiles, stored by dpkg *.dpkg-* -# mount(8) records system state here, no need to keep these in git +# mount(8) records system state here, no need to keep these in hg blkid.tab blkid.tab.old # some other files in /etc that typically do not need to be tracked -ld.so.cache -mtab -.pwd.lock network/run -adjtime EOF fi diff --git a/hg/init.d/50hg-perm b/hg/init.d/50hg-perm index 564e489..fb4c89e 100644 --- a/hg/init.d/50hg-perm +++ b/hg/init.d/50hg-perm @@ -1,3 +1,3 @@ #!/bin/sh set -e -chmod 700 .git +chmod 700 .hg diff --git a/hg/init.d/50hg-pre-commit-hook b/hg/init.d/50hg-pre-commit-hook index 0efd5e4..0603d30 100644 --- a/hg/init.d/50hg-pre-commit-hook +++ b/hg/init.d/50hg-pre-commit-hook @@ -1,15 +1,12 @@ #!/bin/sh set -e -if [ -x .git/hooks/pre-commit ]; then - if ! grep -q "etckeeper pre-commit" .git/hooks/pre-commit; then - echo "etckeeper warning: .git/hooks/pre-commit needs to be manually modifed to run: etckeeper pre-commit `pwd`" >&2 - fi +if [ -e .hg/hgrc ] && grep "^\[hooks\]" .hg/hgrc; then + echo "etckeeper warning: [hooks] section in .hg/hgrc needs to be manually modified to run: etckeeper pre-commit `pwd`" >&2 else - cat >.git/hooks/pre-commit <<EOF -#!/bin/sh + touch + cat >>.hg/hgrc <<EOF +[hooks] # pre-commit hook for etckeeper, to store metadata and do sanity checks -set -e -etckeeper pre-commit `pwd` +precommit = etckeeper pre-commit `pwd` EOF - chmod +x .git/hooks/pre-commit fi diff --git a/hg/init.d/70hg-add b/hg/init.d/70hg-add index 06504b4..6ecc799 100644 --- a/hg/init.d/70hg-add +++ b/hg/init.d/70hg-add @@ -1,5 +1,5 @@ #!/bin/sh set -e -if ! git-add .; then - echo "etckeeper warning: git-add failed" >&2 +if ! hg addremove .; then + echo "etckeeper warning: hg addremove failed" >&2 fi |