File: 40vcs-init

package info (click to toggle)
etckeeper 1.18.23-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,640 kB
  • sloc: sh: 1,267; python: 111; makefile: 109; ansic: 81
file content (18 lines) | stat: -rwxr-xr-x 503 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
set -e

description="$(hostname 2>/dev/null || cat /etc/hostname) /etc repository"
if [ "$VCS" = git ] && [ ! -e .git ]; then
	git init
	echo "$description" > .git/description
elif [ "$VCS" = hg ] && [ ! -e .hg ]; then
	hg init
	echo  "[web]" > .hg/hgrc
	echo  "description = $description" >> .hg/hgrc
elif [ "$VCS" = bzr ] && [ ! -e .bzr ]; then
	bzr init
	bzr nick "$description"
elif [ "$VCS" = darcs ] && [ ! -e _darcs ]; then
	darcs initialize
	echo "$description" > _darcs/prefs/motd
fi