[debian-edu-commits] debian-edu/ 21/30: fix /etc file name prefix, fix variable in prerm while loop

Mike Gabriel sunweaver at debian.org
Fri Oct 9 03:44:05 UTC 2015


This is an automated email from the git hooks/post-receive script.

sunweaver pushed a commit to branch multi-distro-support
in repository educlient.

commit b36e331d134a98e6edf70ca2f94bcd9a06e14219
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Tue Aug 25 19:10:44 2015 +0200

    fix /etc file name prefix, fix variable in prerm while loop
---
 debian/educlient.postinst | 31 ++++++++++++++++---------------
 debian/educlient.prerm    |  8 ++++----
 2 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/debian/educlient.postinst b/debian/educlient.postinst
index a8af7cd..49f7292 100755
--- a/debian/educlient.postinst
+++ b/debian/educlient.postinst
@@ -41,7 +41,8 @@ ETC_DISTRIB_COMMON="/usr/share/educlient/etc-distrib/${DISTRIB_ID}/common"
 ETC_COMMON="/usr/share/educlient/etc-common"
 
 mkdir -p /etc/debian-edu
-echo "" > /etc/debian-edu/educlient.modified-files
+echo "" > /etc/debian-edu/educlient.files-diverted
+echo "" > /etc/debian-edu/educlient.files-added
 
 for working_dir in ${ETC_DISTRIB_VERSION} ${ETC_DISTRIB_COMMON}  ${ETC_COMMON}; do
 
@@ -52,33 +53,33 @@ for working_dir in ${ETC_DISTRIB_VERSION} ${ETC_DISTRIB_COMMON}  ${ETC_COMMON};
 	NEEDED_DIRECTORIES=$(find . -type d | cut -c 3-)
 	for i in $NEEDED_DIRECTORIES
 		do
-			if [ ! -d "/$i" ]; then
-				mkdir -p /$i
-				echo "Directory: mkdir -p /$i"
+			if [ ! -d "/etc/$i" ]; then
+				mkdir -p /etc/$i
+				echo "Directory: mkdir -p /etc/$i"
 			fi
 		done
 
 	COPY_DIVERT_FILES=$(find . -type f | cut -c 3-)
 	for i in $COPY_DIVERT_FILES
 		do
-			if [ -e "/$i" ]; then
+			if [ -e "/etc/$i" ]; then
 
 				# remove previously made diversions
-				if [ "$(dpkg-divert --listpackage /$i)" = "educlient" ] && [ -h /$i ]; then
-					dpkg-divert --package educlient --rename --remove /$i
+				if [ "$(dpkg-divert --listpackage /etc/$i)" = "educlient" ] && [ -h /etc/$i ]; then
+					dpkg-divert --package educlient --rename --remove /etc/$i
 				fi
 
-				dpkg-divert --package educlient --add --divert /$i.educlient-orig --rename /$i
-				echo "dpkg-divert --package educlient --add --divert /$i.educlient-orig --rename /$i"
-				ln -s ${working_dir}/$i /$i
-				echo "ln -s ${working_dir}/$i /$i"
-				echo $i >> /etc/debian-edu/educlient.files-diverted
+				dpkg-divert --package educlient --add --divert /etc/$i.educlient-orig --rename /$i
+				echo "dpkg-divert --package educlient --add --divert /etc/$i.educlient-orig --rename /etc/$i"
+				ln -s ${working_dir}/etc/$i /etc/$i
+				echo "ln -s ${working_dir}/etc/$i /etc/$i"
+				echo /etc/$i >> /etc/debian-edu/educlient.files-diverted
 
 			else
 
-				cp ${working_dir}/$i /$i
-				echo "cp ${working_dir}/$i /$i"
-				echo $i >> /etc/debian-edu/educlient.files-added
+				cp ${working_dir}/etc/$i /etc/$i
+				echo "cp ${working_dir}/etc/$i /etc/$i"
+				echo /etc/$i >> /etc/debian-edu/educlient.files-added
 
 			fi
 		done
diff --git a/debian/educlient.prerm b/debian/educlient.prerm
index cfad37f..de55a0e 100755
--- a/debian/educlient.prerm
+++ b/debian/educlient.prerm
@@ -33,12 +33,12 @@ fi
 cat /etc/debian-edu/educlient.files-* | while read file;
 	do
 		if [ "$(dpkg-divert --listpackage /$i)" = "educlient" ]; then
-			if [ -h "/$i" ]; then
-				rm -f /$i
+			if [ -h "$file" ]; then
+				rm -f $file
 			fi
-			dpkg-divert --package educlient --rename --remove /$i
+			dpkg-divert --package educlient --rename --remove $file
 		else
-			mv  /$i /$i.educlient-removed
+			mv  $file $file.educlient-removed
 		fi
 	done
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/upstream/educlient.git



More information about the debian-edu-commits mailing list