summaryrefslogtreecommitdiff
path: root/post-install.d/50vcs-commit
blob: 6cb6bd1a5ff0b5bc8f1f2ab3837c493484562989 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
set -e
		
pl="/var/cache/etckeeper/packagelist"
NL="
"

if etckeeper unclean; then
	message="committing changes in /etc after $HIGHLEVEL_PACKAGE_MANAGER run"

	if [ -e $pl.pre-install ]; then
		diff="$(etckeeper list-installed | diff -U0 $pl.pre-install - | tail -n+4 | egrep '^[-+]')" || true
		if [ -n "$diff" ]; then
			message="$message$NL${NL}Package changes:$NL$diff"
		fi
	fi

	etckeeper commit "$(printf "$message")"
fi
	
if [ -e $pl.pre-install ]; then
	rm -f $pl.pre-install
fi