Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 14321 | Differences between
and this patch

Collapse All | Expand All

(-)a/bin/etc-update (-2 / +10 lines)
Lines 33-38 function scan() { Link Here
33
	mkdir ${TMP}/files || die "Failed mkdir command!" 1
33
	mkdir ${TMP}/files || die "Failed mkdir command!" 1
34
	count=0
34
	count=0
35
	input=0
35
	input=0
36
	local find_opts
37
	local my_basename
36
38
37
	# Sanity check to make sure diff exists and works
39
	# Sanity check to make sure diff exists and works
38
	if ! diff -v &>/dev/null ; then
40
	if ! diff -v &>/dev/null ; then
Lines 41-50 function scan() { Link Here
41
	fi
43
	fi
42
44
43
	for path in ${CONFIG_PROTECT} ; do
45
	for path in ${CONFIG_PROTECT} ; do
44
		[ ! -d ${path} ] && continue
46
		find_opts="-name ._cfg????_*"
47
		if [ ! -d "${path}" ]; then
48
			[ ! -f "${path}" ] && continue
49
			my_basename="${path##*/}"
50
			path="${path%/*}"
51
			find_opts="-maxdepth 1 -name ._cfg????_${my_basename}"
52
		fi
45
53
46
		ofile=""
54
		ofile=""
47
		for file in $(find ${path}/ -iname '._cfg????_*' ! -name '.*~' ! -name '.*.bak' |
55
		for file in $(find ${path}/ ${find_opts} ! -name '.*~' ! -name '.*.bak' |
48
			   sed -e "s:\(^.*/\)\(\._cfg[0-9]*_\)\(.*$\):\1\2\3\%\2\%\3:" |
56
			   sed -e "s:\(^.*/\)\(\._cfg[0-9]*_\)\(.*$\):\1\2\3\%\2\%\3:" |
49
			   sort -t'%' -k3 -k2 | LANG=POSIX LC_ALL=POSIX cut -f1 -d'%'); do
57
			   sort -t'%' -k3 -k2 | LANG=POSIX LC_ALL=POSIX cut -f1 -d'%'); do
50
			rpath=$(echo "${file/\/\///}" | sed -e "s:/[^/]*$::")
58
			rpath=$(echo "${file/\/\///}" | sed -e "s:/[^/]*$::")

Return to bug 14321