[Pkg-ocaml-maint-commits] r1410 - in trunk/packages/mldonkey/trunk/debian: . utils

Sylvain LE GALL gildor-guest@costa.debian.org
Thu, 23 Jun 2005 22:49:24 +0000


Author: gildor-guest
Date: 2005-06-23 22:49:23 +0000 (Thu, 23 Jun 2005)
New Revision: 1410

Modified:
   trunk/packages/mldonkey/trunk/debian/TODO
   trunk/packages/mldonkey/trunk/debian/changelog
   trunk/packages/mldonkey/trunk/debian/mldonkey-server.config
   trunk/packages/mldonkey/trunk/debian/mldonkey-server.postinst
   trunk/packages/mldonkey/trunk/debian/mldonkey-server.templates
   trunk/packages/mldonkey/trunk/debian/rules
   trunk/packages/mldonkey/trunk/debian/utils/common_options.ml
   trunk/packages/mldonkey/trunk/debian/utils/lexer_options.mll
   trunk/packages/mldonkey/trunk/debian/utils/mldonkey_files.ml
   trunk/packages/mldonkey/trunk/debian/utils/parse_options.mly
   trunk/packages/mldonkey/trunk/debian/utils/type_options.ml
Log:
Modify debconf template for forcing server stop after upgrade, correct bugs in mldonkey_file (Int64 instead of Int32) -- SLG


Modified: trunk/packages/mldonkey/trunk/debian/TODO
===================================================================
--- trunk/packages/mldonkey/trunk/debian/TODO	2005-06-22 22:18:55 UTC (rev 1409)
+++ trunk/packages/mldonkey/trunk/debian/TODO	2005-06-23 22:49:23 UTC (rev 1410)
@@ -20,10 +20,6 @@
   #263094: mldonkey: Extra files to distribute
   #270371: mldonkey-gui: graphical availablility isn't displayed
   #285202: disconnect mldonkey-server if non-iso8859-1 characters typed in search section
-  #291451: mldonkey-server: Server not starting after reboot
 
-  Minor bugs - outstanding
-  #300547: mldonkey-server: package un-install forgets to stop server
-
   Wishlist items - outstanding
   #274460: consider packaging KMLDonkey

Modified: trunk/packages/mldonkey/trunk/debian/changelog
===================================================================
--- trunk/packages/mldonkey/trunk/debian/changelog	2005-06-22 22:18:55 UTC (rev 1409)
+++ trunk/packages/mldonkey/trunk/debian/changelog	2005-06-23 22:49:23 UTC (rev 1410)
@@ -61,6 +61,12 @@
     * Update the manual page according to these changes.
   * Correct the way you can change password in README.Debian, thanks to
     Spiralvoice. (Closes: #312370)
+  * Doesn't offer the possibility to keep the server running after upgrade:
+    this option can cause a lot of problems (version mismatch between server
+    and gui). (Closes: #300547)
+  * Use Int64 to store integer extracted from ini files, in mldonkey_files. This 
+    is more compliant with the way mldonkey write this value in his ini files.
+    (Closes: #291451)
 
  -- Sylvain Le Gall <sylvain.le-gall@polytechnique.org>  Wed, 22 Jun 2005 01:11:44 +0200
 

Modified: trunk/packages/mldonkey/trunk/debian/mldonkey-server.config
===================================================================
--- trunk/packages/mldonkey/trunk/debian/mldonkey-server.config	2005-06-22 22:18:55 UTC (rev 1409)
+++ trunk/packages/mldonkey/trunk/debian/mldonkey-server.config	2005-06-23 22:49:23 UTC (rev 1410)
@@ -75,9 +75,6 @@
 
 if [ "$launch_at_startup" = "true" ]; then
   
-  db_input medium mldonkey-server/restart_after_upgrade || true
-  db_go 
-  
   db_input medium mldonkey-server/run_as_user || true
   db_go
 

Modified: trunk/packages/mldonkey/trunk/debian/mldonkey-server.postinst
===================================================================
--- trunk/packages/mldonkey/trunk/debian/mldonkey-server.postinst	2005-06-22 22:18:55 UTC (rev 1409)
+++ trunk/packages/mldonkey/trunk/debian/mldonkey-server.postinst	2005-06-23 22:49:23 UTC (rev 1410)
@@ -10,9 +10,6 @@
 # For the rest
 #DEBHELPER#
 
-db_get mldonkey-server/restart_after_upgrade
-restart_after_upgrade="$RET"
-
 db_get mldonkey-server/launch_at_startup 
 launch_at_startup="$RET"
 
@@ -23,12 +20,6 @@
   else
     /etc/init.d/mldonkey-server stop || true
   fi
-elif [ "$restart_after_upgrade" = "true" ] && [ "$launch_at_startup" = "true" ]; then
-  if command -v invoke-rc.d >/dev/null 2>&1; then
-    invoke-rc.d mldonkey-server stop
-  else
-    /etc/init.d/mldonkey-server stop
-  fi
 fi
 
 case "$1" in
@@ -243,12 +234,4 @@
   ;;
 esac
 
-if [ -z "$restart_after_upgrade" ] || [ "$restart_after_upgrade" = "true" ]; then
-  if command -v invoke-rc.d >/dev/null 2>&1; then
-    invoke-rc.d mldonkey-server start
-  else
-    /etc/init.d/mldonkey-server start
-  fi
-fi
-
 exit 0

Modified: trunk/packages/mldonkey/trunk/debian/mldonkey-server.templates
===================================================================
--- trunk/packages/mldonkey/trunk/debian/mldonkey-server.templates	2005-06-22 22:18:55 UTC (rev 1409)
+++ trunk/packages/mldonkey/trunk/debian/mldonkey-server.templates	2005-06-23 22:49:23 UTC (rev 1410)
@@ -55,20 +55,6 @@
  If you choose no, you will need to launch MLDonkey yourself each time you want to
  use it.
 
-Template: mldonkey-server/restart_after_upgrade
-Type: boolean
-Default: true
-_Description: Restart after upgrade?
- MLDonkey uses a credit system based on upload speed and MLDonkey's uptime.
- .
- If you choose yes, each time the package is installed or upgraded the MLDonkey server
- will be first stopped and then restarted, loosing its credits for each protocol.
- .
- If you choose no, the server won't be restarted automatically, but you will
- have to restart it yourself to benefit from the package upgrade. If you
- don't restart it after an upgrade, then there could be some problems
- when using the GUI (due to protocol incompatibilities).
-
 Template: mldonkey-server/run_as_user
 Type: string
 Default: mldonkey

Modified: trunk/packages/mldonkey/trunk/debian/rules
===================================================================
--- trunk/packages/mldonkey/trunk/debian/rules	2005-06-22 22:18:55 UTC (rev 1409)
+++ trunk/packages/mldonkey/trunk/debian/rules	2005-06-23 22:49:23 UTC (rev 1410)
@@ -154,7 +154,7 @@
 	rm -r $(CURDIR)/debian/mldonkey-server/usr/share/doc/mldonkey-server/distrib/Copying.txt
 	dh_installexamples -a
 	dh_installmenu -a
-	dh_installinit -a --no-start
+	dh_installinit -a 
 	dh_installcron -a
 	dh_installman -a
 	dh_installchangelogs distrib/ChangeLog -a

Modified: trunk/packages/mldonkey/trunk/debian/utils/common_options.ml
===================================================================
--- trunk/packages/mldonkey/trunk/debian/utils/common_options.ml	2005-06-22 22:18:55 UTC (rev 1409)
+++ trunk/packages/mldonkey/trunk/debian/utils/common_options.ml	2005-06-23 22:49:23 UTC (rev 1410)
@@ -1,4 +1,5 @@
-open Type_options
+open Type_options;;
+open Lexing;;
 
 exception Too_complicated
 
@@ -8,7 +9,7 @@
 		ValModule(_) ->
 			raise Too_complicated
 		| ValInt(i) ->
-			Printf.fprintf stdout "%s" (Int32.to_string i);
+			Printf.fprintf stdout "%s" (Int64.to_string i);
 		| ValFloat(f) ->
 			Printf.fprintf stdout "%f" f;
 		| ValList(lst) ->
@@ -64,7 +65,7 @@
 			save_one_option f;
 			Printf.fprintf file "}"
 		| ValInt(i) ->
-			Printf.fprintf file "%s" (Int32.to_string i);
+			Printf.fprintf file "%s" (Int64.to_string i);
 		| ValFloat(f) ->
 			Printf.fprintf file "%f" f;
 		| ValList(lst) ->
@@ -100,19 +101,35 @@
 	let lexbuf = Lexing.from_channel file
 	in
 	try 
-        	let res = Parse_options.main Lexer_options.token lexbuf
-		in
-		close_in file;
-		res
-	with Parsing.Parse_error ->
-		print_string "Unable to parse file";
-		print_newline ();
-		print_string ("Last word seen : " ^ (Lexing.lexeme lexbuf));
-		print_newline ();
-		print_string ("Position : "^(string_of_int (Lexing.lexeme_start lexbuf))^
-			"-" ^ (string_of_int (Lexing.lexeme_end lexbuf)));
-		print_newline ();
-		raise Parsing.Parse_error
+          lexbuf.lex_curr_p <- { lexbuf.lex_curr_p with
+            pos_fname = filename;
+            pos_lnum  = 1;
+            pos_bol   = 0;
+          };
+          let res = Parse_options.main Lexer_options.token lexbuf
+          in
+          close_in file;
+          res
+	with 
+          Parsing.Parse_error 
+        | Failure "int_of_string" ->
+            let start_position =
+              Lexing.lexeme_start_p lexbuf
+            in
+            let end_position =
+              Lexing.lexeme_end_p lexbuf
+            in
+            Printf.fprintf stderr
+            ( "Unable to parse file: %s\n"
+            ^^"Last word seen : %S\n"
+            ^^"Position : line %d, char. %d-%d\n" )
+            (start_position.pos_fname)
+            (Lexing.lexeme lexbuf)
+            (start_position.pos_lnum)
+            (start_position.pos_cnum - start_position.pos_bol)
+            (end_position.pos_cnum - start_position.pos_bol);
+            raise Parsing.Parse_error
+;;
 
 let parse_option str =
 	let lexbuf = Lexing.from_channel stdin

Modified: trunk/packages/mldonkey/trunk/debian/utils/lexer_options.mll
===================================================================
--- trunk/packages/mldonkey/trunk/debian/utils/lexer_options.mll	2005-06-22 22:18:55 UTC (rev 1409)
+++ trunk/packages/mldonkey/trunk/debian/utils/lexer_options.mll	2005-06-23 22:49:23 UTC (rev 1410)
@@ -1,11 +1,19 @@
 {
 open Parse_options;;
+open Lexing;;
 }
 
 rule token = parse
-[' ' '\t' '\n']			{ token lexbuf }
-| ['0'-'9']+ '.' ['0'-'9']*	{ FLOAT(float_of_string(Lexing.lexeme lexbuf)) }
-| ['0'-'9']+			{ INT(Int32.of_string(Lexing.lexeme lexbuf)) }
+[' ' '\t']			{ token lexbuf }
+| '\n'                          {
+                                  lexbuf.lex_curr_p <- { lexbuf.lex_curr_p with 
+                                    pos_lnum = lexbuf.lex_curr_p.pos_lnum + 1;
+                                    pos_bol = lexbuf.lex_curr_p.pos_cnum + 1;
+                                  };
+                                  token lexbuf
+                                }
+| ['0'-'9']+ '.' ['0'-'9']*	{ FLOAT(float_of_string(lexeme lexbuf)) }
+| ['0'-'9']+			{ INT(Int64.of_string(lexeme lexbuf)) }
 | '='				{ EQUAL }
 | '{' 				{ BEG_MOD }
 | '}'				{ END_MOD }

Modified: trunk/packages/mldonkey/trunk/debian/utils/mldonkey_files.ml
===================================================================
--- trunk/packages/mldonkey/trunk/debian/utils/mldonkey_files.ml	2005-06-22 22:18:55 UTC (rev 1409)
+++ trunk/packages/mldonkey/trunk/debian/utils/mldonkey_files.ml	2005-06-23 22:49:23 UTC (rev 1410)
@@ -30,7 +30,8 @@
 	List.partition is_arg_network files_lst
 
 let load_files_ini filename =
-	let options = load_option filename
+	let options = 
+          load_option filename
 	in
 	let done_files =
 		match find_option "done_files" options with
@@ -93,9 +94,11 @@
 			in
 			save_files_ini part0 (done_files1@done_files2,files1@files2)
 		| (Split(net),Some(part0),Some(part1),Some(part2)) ->
-			let (done_files0,files0) = load_files_ini part0
+			let (done_files0,files0) = 
+                          load_files_ini part0
 			in
-			let (files1,files2) = filter_network net files0
+			let (files1,files2) = 
+                          filter_network net files0
 			in
 			save_files_ini part1 ([]         ,files1);
 			save_files_ini part2 (done_files0,files2)

Modified: trunk/packages/mldonkey/trunk/debian/utils/parse_options.mly
===================================================================
--- trunk/packages/mldonkey/trunk/debian/utils/parse_options.mly	2005-06-22 22:18:55 UTC (rev 1409)
+++ trunk/packages/mldonkey/trunk/debian/utils/parse_options.mly	2005-06-23 22:49:23 UTC (rev 1410)
@@ -5,7 +5,7 @@
 %}
 %token EOF 
 %token <float> FLOAT 
-%token <int32> INT 
+%token <int64> INT 
 %token <string> COMMENT 
 %token <string> STRING 
 %token <string> IDENT

Modified: trunk/packages/mldonkey/trunk/debian/utils/type_options.ml
===================================================================
--- trunk/packages/mldonkey/trunk/debian/utils/type_options.ml	2005-06-22 22:18:55 UTC (rev 1409)
+++ trunk/packages/mldonkey/trunk/debian/utils/type_options.ml	2005-06-23 22:49:23 UTC (rev 1410)
@@ -1,6 +1,6 @@
 type options_value =
 ValModule of file
-| ValInt of int32
+| ValInt of int64
 | ValFloat of float
 | ValList of ( options_value list )
 | ValString of string