[med-svn] r9491 - trunk/packages/fis-gtm/fis-gtm-initial/trunk/debian

Luis Ibanez luisibanez-guest at alioth.debian.org
Sat Jan 28 23:59:25 UTC 2012


Author: luisibanez-guest
Date: 2012-01-28 23:59:25 +0000 (Sat, 28 Jan 2012)
New Revision: 9491

Modified:
   trunk/packages/fis-gtm/fis-gtm-initial/trunk/debian/postinst
Log:

Improving management of temporary directories during
post-installation. Before it was using FISGTM_ROOT 
that is usually set to /usr/lib/fis-gtm, as the place
to create a subdirectory in which the tar.gz files of
the distribution were expanded, and later configured.

Now, it creates such temporary directory under /tmp, and
by using mktemp. In this way it keeps the distribution
cleaner and follows a safer process as in indicated by
lintian.

The process was made a bit more verbose by adding echoes.



Modified: trunk/packages/fis-gtm/fis-gtm-initial/trunk/debian/postinst
===================================================================
--- trunk/packages/fis-gtm/fis-gtm-initial/trunk/debian/postinst	2012-01-28 23:28:04 UTC (rev 9490)
+++ trunk/packages/fis-gtm/fis-gtm-initial/trunk/debian/postinst	2012-01-28 23:59:25 UTC (rev 9491)
@@ -21,6 +21,10 @@
 . /usr/share/debconf/confmodule
 TEMPLATE="/usr/share/fis-gtm-initial/defaults.template"
 CONFFILE="/etc/default/fis-gtm-initial"
+TMPPOSTINST=`mktemp --directory /tmp/fis-gtm-initial.XXXXXXXX`
+chmod 644 $TMPPOSTINST
+echo "Created temporary directory: "
+echo $TMPPOSTINST
 
 case "$1" in
     configure)
@@ -50,13 +54,20 @@
 	fi
 
 	cd $FISGTM_ROOT
-	rm -rf TMPPOSTINST
-	mkdir TMPPOSTINST
-	cd TMPPOSTINST
 	eval `dpkg-architecture -s`
-	lastversion=`ls -1 ../distribution|grep "$DEB_BUILD_ARCH"|head -1`
-	tar -zxf ../distribution/$lastversion
+	lastversion=`ls -1 distribution|grep "$DEB_BUILD_ARCH"|head -1`
 
+	cd $TMPPOSTINST
+        echo "Extracting last version from: "
+        echo "$FISGTM_ROOT/distribution/$lastversion"
+        echo "into: $TMPPOSTINST"
+	tar -zxf $FISGTM_ROOT/distribution/$lastversion
+        echo "$lastversion has been extracted"
+	cd $TMPPOSTINST/fis-gtm-initial
+        tarfile_version_architecture=`ls -1 . | grep "$DEB_BUILD_ARCH" | head -1`
+        echo "Extracting $tarfile_version_architecture"
+        tar -zxf $TMPPOSTINST/fis-gtm-initial/$tarfile_version_architecture
+
 	mkdir -p $FISGTM_ROOT/$FISGTM_VERSION_INITIAL-initial
 	echo " "
 	echo "##############################################"
@@ -83,7 +94,8 @@
 	echo "... automatic configuration finished"
 	echo "##############################################"
 	cd ..
-	rm -rf TMPPOSTINST
+        echo "Removing directory ",$TMPPOSTINST
+	rm -rf $TMPPOSTINST
     ;;
 
     abort-upgrade|abort-remove|abort-deconfigure)




More information about the debian-med-commit mailing list