[Pkg-jed-commit] r33 - trunk/packages/jed/debian

Rafael Laboissiere rafael@costa.debian.org
Sun, 24 Apr 2005 19:39:13 +0000


Author: rafael
Date: 2005-04-24 19:39:12 +0000 (Sun, 24 Apr 2005)
New Revision: 33

Added:
   trunk/packages/jed/debian/compile
Modified:
   trunk/packages/jed/debian/changelog
   trunk/packages/jed/debian/jed-common.dirs
   trunk/packages/jed/debian/jed-common.postinst
   trunk/packages/jed/debian/jed-common.prerm
   trunk/packages/jed/debian/rules
Log:
Changes for install-time byte-compilation of *.sl files.  This implements
the scheme for compiling files in all add-on packages, as discussed recently
in pkg-jed-devel.


Modified: trunk/packages/jed/debian/changelog
===================================================================
--- trunk/packages/jed/debian/changelog	2005-04-23 15:14:13 UTC (rev 32)
+++ trunk/packages/jed/debian/changelog	2005-04-24 19:39:12 UTC (rev 33)
@@ -8,14 +8,15 @@
   * Starting with this release, the *.slc files are generated at install
     time and not at build time as before.  This means that the *.sl files
     are included in jed-common and the jed-sl package is dropped.
+  * Also, we have now a new scheme for byte-compiling all files in jed
+    add-on package each time the jed-common package is upgraded.
   * debian/control: 
     - Removed entry for jed-sl package
     - jed-common Conflicts with and Replaces jed-sl
   * debian/rules: Dropped stuff related to jed-sl
-  * debian/jed-common.postinst: Included jed batch command for generation of
-    the *.slc and *.dfa files
-  * debian/jed-common.prerm: Delete *.slc and *.dfa files in
-    /usr/share/jed/lib before removal of the package
+  * debian/compile: New script to compile/remove he *.slc files.
+  * debian/jed-common.postinst, debian/jed-common.prerm: Run files in
+    /usr/share/jed/compile with the approprite arguments.
   * debian/jed-sl.*: Removed files
 
  -- 

Added: trunk/packages/jed/debian/compile
===================================================================
--- trunk/packages/jed/debian/compile	2005-04-23 15:14:13 UTC (rev 32)
+++ trunk/packages/jed/debian/compile	2005-04-24 19:39:12 UTC (rev 33)
@@ -0,0 +1,18 @@
+#!/bin/sh -e
+
+JED=/usr/bin/jed
+LIBDIR=/usr/share/jed/lib/
+PREPARSE=preparse.sl
+
+case "$1" in
+  install)
+	$JED -batch -n -l $PREPARSE
+	;;
+  remove)
+	find $LIBDIR -name \*.slc -o -name \*.dfa | xargs rm -f
+	;;
+  *)
+	echo "unknown argument --> \"$1"\" >&2
+	exit 0
+	;;
+esac

Modified: trunk/packages/jed/debian/jed-common.dirs
===================================================================
--- trunk/packages/jed/debian/jed-common.dirs	2005-04-23 15:14:13 UTC (rev 32)
+++ trunk/packages/jed/debian/jed-common.dirs	2005-04-24 19:39:12 UTC (rev 33)
@@ -4,4 +4,5 @@
 usr/share/info
 usr/share/man/man8
 usr/share/jed/lib
+usr/share/jed/compile
 usr/sbin

Modified: trunk/packages/jed/debian/jed-common.postinst
===================================================================
--- trunk/packages/jed/debian/jed-common.postinst	2005-04-23 15:14:13 UTC (rev 32)
+++ trunk/packages/jed/debian/jed-common.postinst	2005-04-24 19:39:12 UTC (rev 33)
@@ -5,9 +5,20 @@
 
 	install-info --quiet --section Editors Editors --description='Programmers editor.' /usr/share/info/jed.info.gz;
 
-	echo -n "Compiling .slc and .dfa files... "
-	/usr/bin/jed -batch -n -l preparse.sl > /dev/null
-	echo done.
+	TEMP=$(tempfile)
+	for SCRIPT in $(find /usr/share/jed/compile -type f) ; do
+		if test -x $SCRIPT ; then
+			echo -n "Running $SCRIPT... "
+			RET=0
+			$SCRIPT install > $TEMP 2>&1 || RET=$?
+			if test "$RET" -ne 0 ; then
+				echo "failed (see $TEMP)"
+				exit $RET
+			fi
+			echo "done"
+		fi
+	done
+	rm -f $TEMP
 
 	;;
 

Modified: trunk/packages/jed/debian/jed-common.prerm
===================================================================
--- trunk/packages/jed/debian/jed-common.prerm	2005-04-23 15:14:13 UTC (rev 32)
+++ trunk/packages/jed/debian/jed-common.prerm	2005-04-24 19:39:12 UTC (rev 33)
@@ -4,6 +4,19 @@
 # (this used to be the case, I haven't check with woody dh yet)
 install-info --quiet --remove /usr/share/info/jed.info.gz;
 
-find /usr/share/jed/lib/ -name \*.slc -o -name \*.dfa | xargs rm -f
+TEMP=$(tempfile)
+for SCRIPT in $(find /usr/share/jed/compile -type f) ; do
+	if test -x $SCRIPT ; then
+		echo -n "Running $SCRIPT... "
+		RET=0
+		$SCRIPT remove > $TEMP 2>&1 || RET=$?
+		if test "$RET" -ne 0 ; then
+			echo "failed (see $TEMP)"
+			exit $RET
+		fi
+		echo "done"
+	fi
+done
+rm -f $TEMP
 
 #DEBHELPER#

Modified: trunk/packages/jed/debian/rules
===================================================================
--- trunk/packages/jed/debian/rules	2005-04-23 15:14:13 UTC (rev 32)
+++ trunk/packages/jed/debian/rules	2005-04-24 19:39:12 UTC (rev 33)
@@ -85,6 +85,8 @@
 	install -m 644 debian/init.d/*.sl $(jed-common)/etc/jed-init.d
 	# install jed.conf
 	install -m 644 debian/init.d/jed.conf $(jed-common)/etc
+	install -m 755 debian/compile \
+		$(jed-common)/usr/share/jed/compile/jed-common
 	#install -m 755 debian/init.d/jed-update-startup \
 	#	$(jed-common)/usr/sbin
 	install -m 644 debian/init.d/README.Debian-startup \