[Included dpatch directory
Jonas Eschenburg <indyjo@gmx.de>**20071226220042] {
addfile ./debian/patches/00list
hunk ./debian/patches/00list 1
+01_fine-grained-installation.dpatch
+03_post-20071212.dpatch
+04_AsyncRequest-depends-on-librt.dpatch
+AVCodec-needs-errno-header.dpatch
+QDBM-needs-include-directory.dpatch
+SoundTouch-remove-dependency.dpatch
+HDB-has-interpreter-in-usr-local.dpatch
+remove-configure-generated-file-in-libsgml-source.dpatch
addfile ./debian/patches/01_fine-grained-installation.dpatch
hunk ./debian/patches/01_fine-grained-installation.dpatch 1
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 01_fine-grained-installation.dpatch by  <indyjo@gmx.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -urNad iolanguage-20071212~/Makefile iolanguage-20071212/Makefile
+--- iolanguage-20071212~/Makefile	2007-12-10 07:35:50.000000000 +0100
++++ iolanguage-20071212/Makefile	2007-12-23 19:03:52.000000000 +0100
+@@ -19,7 +19,9 @@
+ #endif
+ 
+ DLL_SUFFIX := so
+-DLL_COMMAND := -shared -Wl,-soname="libiovmall.so"
++DLL_SOVERSION := .0
++DLL_FULLVERSION := .0.0.0
++DLL_COMMAND := -shared -Wl,-soname="libiovmall.so$(DLL_SOVERSION)"
+ FLAT_NAMESPACE :=
+ 
+ LINKDLL := $(CC)
+@@ -33,6 +35,16 @@
+ AR     ?= ar
+ ARFLAGS := rcu 
+ 
++INSTALL_USER = root
++INSTALL_GROUP = root
++INSTALL	= install -o $(INSTALL_USER) -g $(INSTALL_GROUP)
++INSTALL_DIR_MODE = 755
++INSTALL_DIR = $(INSTALL) -d -m $(INSTALL_DIR_MODE)
++INSTALL_FILE_MODE = 644
++INSTALL_FILE = $(INSTALL) -m $(INSTALL_FILE_MODE)
++INSTALL_XFILE_MODE = 755
++INSTALL_XFILE = $(INSTALL) -m $(INSTALL_XFILE_MODE)
++
+ ifeq ($(SYS),Darwin)
+ DLL_SUFFIX := dylib
+ DLL_COMMAND := -dynamiclib
+@@ -129,6 +141,49 @@
+ 	cp -fR addons $(INSTALL_PREFIX)/lib/io
+ 	chmod -R ugo+rX $(INSTALL_PREFIX)/lib/io
+ 
++installDirs:
++	-$(INSTALL_DIR) $(INSTALL_PREFIX)/bin $(INSTALL_PREFIX)/lib/io
++
++installInterpreter: installDirs
++	$(INSTALL_XFILE) _build/binaries/io$(BINARY_SUFFIX) $(INSTALL_PREFIX)/bin
++
++installStandaloneInterpreter: installDirs
++	$(INSTALL_XFILE) _build/binaries/io_static$(BINARY_SUFFIX) $(INSTALL_PREFIX)/bin
++
++installStaticLibrary: installDirs
++	$(INSTALL_FILE) _build/lib/libiovmall.a $(INSTALL_PREFIX)/lib
++
++installSharedLibrary: installDirs
++	$(INSTALL_XFILE) _build/dll/libiovmall.$(DLL_SUFFIX) $(INSTALL_PREFIX)/lib/libiovmall.$(DLL_SUFFIX)$(DLL_FULLVERSION)
++	ln -sf libiovmall.$(DLL_SUFFIX)$(DLL_FULLVERSION) $(INSTALL_PREFIX)/lib/libiovmall.$(DLL_SUFFIX)$(DLL_SOVERSION)
++
++installDevelopmentFiles: installStaticLibrary
++	-$(INSTALL_DIR) $(INSTALL_PREFIX)/include/iolanguage
++	$(INSTALL_FILE) _build/headers/* $(INSTALL_PREFIX)/include/iolanguage
++	ln -sf libiovmall.$(DLL_SUFFIX)$(DLL_FULLVERSION) $(INSTALL_PREFIX)/lib/libiovmall.$(DLL_SUFFIX)
++
++installAddon:
++	$(INSTALL_DIR) $(INSTALL_PREFIX)/lib/io/addons/$(ADDON_NAME); \
++	for FILE in protos depends build.io ; do \
++	  [ -f addons/$(ADDON_NAME)/$$FILE ] || continue; \
++	  $(INSTALL_FILE) addons/$(ADDON_NAME)/$$FILE $(INSTALL_PREFIX)/lib/io/addons/$(ADDON_NAME)/; \
++	done; \
++	for DIR in io resources samples _build/dll ; do \
++	  [ -d addons/$(ADDON_NAME)/$$DIR ] || continue; \
++	  [ "`echo addons/$(ADDON_NAME)/$$DIR/*`" != "addons/$(ADDON_NAME)/$$DIR/*" ] || continue; \
++	  $(INSTALL_DIR) $(INSTALL_PREFIX)/lib/io/addons/$(ADDON_NAME)/$$DIR; \
++	  cp -r addons/$(ADDON_NAME)/$$DIR/* $(INSTALL_PREFIX)/lib/io/addons/$(ADDON_NAME)/$$DIR; \
++	done; \
++	if [ "`echo addons/$(ADDON_NAME)/_build/dll/*`" != "addons/$(ADDON_NAME)/_build/dll/*" ]; then \
++	  $(INSTALL_DIR) $(INSTALL_PREFIX)/lib/io/addons/$(ADDON_NAME)/_build/dll; \
++	  $(INSTALL_FILE) addons/$(ADDON_NAME)/_build/dll/* $(INSTALL_PREFIX)/lib/io/addons/$(ADDON_NAME)/_build/dll; \
++	fi; \
++	chmod -R $(INSTALL_FILE_MODE) $(INSTALL_PREFIX)/lib/io/addons/$(ADDON_NAME)/ ; \
++	chmod $(INSTALL_DIR_MODE) `find $(INSTALL_PREFIX)/lib/io/addons/$(ADDON_NAME)/ -type d`; \
++	chown -R $(INSTALL_USER):$(INSTALL_GROUP) $(INSTALL_PREFIX)/lib/io/addons/$(ADDON_NAME)/; \
++	echo "Addon $(ADDON_NAME) installed."
++
++
+ linkInstall:
+ 	mkdir -p $(INSTALL_PREFIX)/bin || true
+ 	mkdir -p $(INSTALL_PREFIX)/lib || true
addfile ./debian/patches/03_post-20071212.dpatch
hunk ./debian/patches/03_post-20071212.dpatch 1
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 03_post-20071212.dpatch by  <indyjo@gmx.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: A couple of patches which were added to 20071212, including GNU readline support.
+
+@DPATCH@
+diff -urNad Io-2007-12-12~/Makefile Io-2007-12-12/Makefile
+--- Io-2007-12-12~/Makefile	2007-12-16 21:42:26.000000000 +0100
++++ Io-2007-12-12/Makefile	2007-12-16 21:42:33.000000000 +0100
+@@ -5,7 +5,6 @@
+ NEEDS_DL := Darwin Linux SunOS syllable
+ ifneq (,$(findstring $(SYS),$(NEEDS_DL)))
+ LFLAGS +=-ldl
+-LFLAGS += -ledit
+ endif
+ 
+ NEEDS_M := FreeBSD Linux NetBSD
+diff -urNad Io-2007-12-12~/Makefile.lib Io-2007-12-12/Makefile.lib
+--- Io-2007-12-12~/Makefile.lib	2007-12-16 21:42:26.000000000 +0100
++++ Io-2007-12-12/Makefile.lib	2007-12-16 21:42:33.000000000 +0100
+@@ -62,12 +62,6 @@
+ DLL_SUFFIX := dylib
+ DLL_COMMAND := -dynamiclib
+ FLAT_NAMESPACE := -flat_namespace
+-
+-hasEditLib := $(wildcard ../../tools/editlib_test/editlib_test)
+-ifneq ($(strip $(hasEditLib)),)
+-DLL_EXTRAS := -ledit
+-endif
+-
+ endif
+ 
+ ifeq ($(SYS),Linux)
+diff -urNad Io-2007-12-12~/addons/EditLine/io/EditLine.io Io-2007-12-12/addons/EditLine/io/EditLine.io
+--- Io-2007-12-12~/addons/EditLine/io/EditLine.io	2007-12-16 21:42:26.000000000 +0100
++++ Io-2007-12-12/addons/EditLine/io/EditLine.io	1970-01-01 01:00:00.000000000 +0100
+@@ -1,19 +0,0 @@
+-EditLine do(
+-
+-	# Io wasn't complied with libedit. Fake libedit as best we can so the CLI will work
+-	if(EditLine hasEditLib not,
+-		readLine := method(prompt,
+-			write(prompt)
+-			line := File standardInput readLine
+-			if(line,
+-				line .. "\n"
+-			,
+-				nil
+-			)
+-		)
+-
+-		addHistory := method(line,
+-			nil
+-		)
+-	)
+-)
+diff -urNad Io-2007-12-12~/addons/EditLine/source/IoEditLine.c Io-2007-12-12/addons/EditLine/source/IoEditLine.c
+--- Io-2007-12-12~/addons/EditLine/source/IoEditLine.c	2007-12-16 21:42:26.000000000 +0100
++++ Io-2007-12-12/addons/EditLine/source/IoEditLine.c	2007-12-16 21:42:33.000000000 +0100
+@@ -7,12 +7,11 @@
+   docCategory("Core")
+ */
+ 
++#include <locale.h>
+ #include "IoEditLine.h"
+ 
+-#ifdef IO_HAS_EDITLIB
+ #define DATA(self) ((IoEditLineData *)IoObject_dataPointer(self))
+ static char *promptCallback(EditLine *e);
+-#endif
+ 
+ 
+ IoTag *IoEditLine_newTag(void *state)
+@@ -29,17 +28,18 @@
+ {
+ 	IoMethodTable methodTable[] = {
+ 		{"hasEditLib", IoEditLine_hasEditLib},
+-#ifdef IO_HAS_EDITLIB
+ 		{"readLine", IoEditLine_readLine},
+ 		{"addHistory", IoEditLine_addHistory},
+-#endif
+ 		{NULL, NULL},
+ 	};
+ 
+ 	IoObject *self = IoObject_new(state);
+ 	IoObject_tag_(self, IoEditLine_newTag(state));
+ 
+-#ifdef IO_HAS_EDITLIB
++	/* Make sure editline returns characters in the multi-byte charset
++	   of the locale */
++	setlocale(LC_CTYPE, "");
++
+ 	IoObject_setDataPointer_(self, io_calloc(1, sizeof(IoEditLineData)));
+ 	DATA(self)->prompt  = IOSYMBOL("");
+ 	DATA(self)->editline = el_init("io", stdin, stdout, stderr);
+@@ -57,7 +57,6 @@
+ 	}
+ 
+ 	el_source(DATA(self)->editline, NULL);
+-#endif
+ 
+ 	IoState_registerProtoWithFunc_((IoState *)state, self, IoEditLine_proto);
+ 
+@@ -74,19 +73,15 @@
+ 
+ void IoEditLine_mark(IoEditLine *self)
+ {
+-#ifdef IO_HAS_EDITLIB
+     IoObject_shouldMarkIfNonNull(DATA(self)->prompt);
+-#endif
+ }
+ 
+ void IoEditLine_free(IoEditLine *self)
+ {
+ 	if (IoObject_dataPointer(self))
+ 	{
+-#ifdef IO_HAS_EDITLIB
+ 		el_end(DATA(self)->editline);
+ 		history_end(DATA(self)->history);
+-#endif
+ 	}
+ }
+ 
+@@ -94,14 +89,9 @@
+ 
+ IoObject *IoEditLine_hasEditLib(IoEditLine *self, IoObject *locals, IoMessage *m)
+ {
+-#ifdef IO_HAS_EDITLIB
+ 	return IOTRUE(self);
+-#else
+-	return IOFALSE(self);
+-#endif
+ }
+ 
+-#ifdef IO_HAS_EDITLIB
+ char *promptCallback(EditLine *e)
+ {
+ 	IoEditLine *self;
+@@ -133,4 +123,4 @@
+ 
+ 	return self;
+ }
+-#endif
++
+diff -urNad Io-2007-12-12~/addons/EditLine/source/IoEditLine.h Io-2007-12-12/addons/EditLine/source/IoEditLine.h
+--- Io-2007-12-12~/addons/EditLine/source/IoEditLine.h	2007-12-16 21:42:26.000000000 +0100
++++ Io-2007-12-12/addons/EditLine/source/IoEditLine.h	2007-12-16 21:42:33.000000000 +0100
+@@ -9,9 +9,7 @@
+ #include "Common.h"
+ #include "IoObject.h"
+ 
+-#ifdef IO_HAS_EDITLIB
+ #include <histedit.h>
+-#endif
+ 
+ #ifdef __cplusplus
+ extern "C" {
+@@ -21,14 +19,12 @@
+ 
+ typedef IoObject IoEditLine;
+ 
+-#ifdef IO_HAS_EDITLIB
+ typedef struct
+ {
+ 	EditLine *editline;
+ 	History *history;
+ 	IoSymbol *prompt;
+ } IoEditLineData;
+-#endif
+ 
+ IoEditLine *IoEditLine_proto(void *state);
+ IoEditLine *IoEditLine_rawClone(IoEditLine *self);
+@@ -38,10 +34,8 @@
+ 
+ IoObject *IoEditLine_hasEditLib(IoEditLine *self, IoObject *locals, IoMessage *m);
+ 
+-#ifdef IO_HAS_EDITLIB
+ IoObject *IoEditLine_readLine(IoEditLine *self, IoObject *locals, IoMessage *m);
+ IoObject *IoEditLine_addHistory(IoEditLine *self, IoObject *locals, IoMessage *m);
+-#endif
+ 
+ #ifdef __cplusplus
+ }
+diff -urNad Io-2007-12-12~/addons/ReadLine/build.io Io-2007-12-12/addons/ReadLine/build.io
+--- Io-2007-12-12~/addons/ReadLine/build.io	1970-01-01 01:00:00.000000000 +0100
++++ Io-2007-12-12/addons/ReadLine/build.io	2007-12-16 21:42:33.000000000 +0100
+@@ -0,0 +1,7 @@
++AddonBuilder clone do(
++	dependsOnLib("readline")
++	dependsOnLib("history")
++	dependsOnHeader("readline/readline.h")
++	dependsOnHeader("readline/history.h")
++	dependsOnHeader("locale.h")
++)
+diff -urNad Io-2007-12-12~/addons/ReadLine/depends Io-2007-12-12/addons/ReadLine/depends
+--- Io-2007-12-12~/addons/ReadLine/depends	1970-01-01 01:00:00.000000000 +0100
++++ Io-2007-12-12/addons/ReadLine/depends	2007-12-16 21:42:59.000000000 +0100
+@@ -0,0 +1,2 @@
++
++
+diff -urNad Io-2007-12-12~/addons/ReadLine/source/IoReadLine.c Io-2007-12-12/addons/ReadLine/source/IoReadLine.c
+--- Io-2007-12-12~/addons/ReadLine/source/IoReadLine.c	1970-01-01 01:00:00.000000000 +0100
++++ Io-2007-12-12/addons/ReadLine/source/IoReadLine.c	2007-12-16 21:42:33.000000000 +0100
+@@ -0,0 +1,86 @@
++/*#io
++ReadLine ioDoc(
++  docCopyright("Jonas Eschenburg", 2007)
++  docLicense("BSD revised")
++  docObject("ReadLine")
++  docDescription("Binding to GNU readline.")
++  docCategory("Core")
++*/
++
++#include <locale.h>
++#include <string.h>
++#include <readline/readline.h>
++#include <readline/history.h>
++
++#include "IoReadLine.h"
++
++
++IoTag *IoReadLine_newTag(void *state)
++{
++	IoTag *tag = IoTag_newWithName_("ReadLine");
++	IoTag_state_(tag, state);
++	return tag;
++}
++
++IoReadLine *IoReadLine_proto(void *state)
++{
++	IoMethodTable methodTable[] = {
++		{"readLine", IoReadLine_readLine},
++		{"addHistory", IoReadLine_addHistory},
++		{NULL, NULL},
++	};
++
++	IoObject *self = IoObject_new(state);
++	IoObject_tag_(self, IoReadLine_newTag(state));
++
++	IoObject_setSlot_to_(self, IOSYMBOL("prompt"), IOSYMBOL(""));
++	
++	/* Make sure readline returns characters in the multi-byte charset
++	   of the locale */
++	setlocale(LC_CTYPE, "");
++	/* Actually initialize GNU readly and history */
++	rl_initialize();
++	using_history();
++	
++	IoState_registerProtoWithFunc_((IoState *)state, self, IoReadLine_proto);
++
++	IoObject_addMethodTable_(self, methodTable);
++
++	return self;
++}
++
++
++/* ----------------------------------------------------------- */
++
++IoObject *IoReadLine_readLine(IoReadLine *self, IoObject *locals, IoMessage *m)
++{
++	const char *prompt = NULL;
++	
++	if (IoMessage_argCount(m) == 0) {
++		IoObject *p = IoObject_rawGetSlot_(self, IOSYMBOL("prompt"));
++		if (p && ISSEQ(p)) {
++			prompt = CSTRING(p);
++		} else {
++			prompt = "";
++		}
++	} else {
++		prompt = IoMessage_locals_cStringArgAt_(m, locals, 0);
++	}
++	
++	const char *line = readline(prompt);
++	
++	if (line)
++		return IOSEQ((const unsigned char*)line, strlen(line));
++	else
++		return IONIL(self);
++}
++
++IoObject *IoReadLine_addHistory(IoReadLine *self, IoObject *locals, IoMessage *m)
++{
++	IoSeq *line = IoMessage_locals_seqArgAt_(m, locals, 0);
++
++	add_history(CSTRING(line));
++
++	return self;
++}
++
+diff -urNad Io-2007-12-12~/addons/ReadLine/source/IoReadLine.h Io-2007-12-12/addons/ReadLine/source/IoReadLine.h
+--- Io-2007-12-12~/addons/ReadLine/source/IoReadLine.h	1970-01-01 01:00:00.000000000 +0100
++++ Io-2007-12-12/addons/ReadLine/source/IoReadLine.h	2007-12-16 21:42:33.000000000 +0100
+@@ -0,0 +1,29 @@
++/*#io
++docCopyright("Jonaa Eschenburg", 2007)
++docLicense("BSD revised")
++*/
++
++#ifndef IoReadLine_DEFINED
++#define IoReadLine_DEFINED 1
++
++#include "Common.h"
++#include "IoObject.h"
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++#define ISREADLINE(self) IoObject_hasCloneFunc_(self, (IoTagCloneFunc *)IoReadLine_rawClone)
++
++typedef IoObject IoReadLine;
++
++IoReadLine *IoReadLine_proto(void *state);
++IoReadLine *IoReadLine_rawClone(IoReadLine *self);
++
++IoObject *IoReadLine_readLine(IoReadLine *self, IoObject *locals, IoMessage *m);
++IoObject *IoReadLine_addHistory(IoReadLine *self, IoObject *locals, IoMessage *m);
++
++#ifdef __cplusplus
++}
++#endif
++#endif
+diff -urNad Io-2007-12-12~/libs/iovm/io/Z_CLI.io Io-2007-12-12/libs/iovm/io/Z_CLI.io
+--- Io-2007-12-12~/libs/iovm/io/Z_CLI.io	2007-12-16 21:42:26.000000000 +0100
++++ Io-2007-12-12/libs/iovm/io/Z_CLI.io	2007-12-16 21:42:33.000000000 +0100
+@@ -8,6 +8,8 @@
+ 
+ 	newSlot("commandLineLabel", "Command Line")
+ 	
++	newSlot("lineReader" , nil)
++	
+ 	stop := method(setIsRunning(false))
+ 	
+ 	runFile := method(path,
+@@ -68,13 +70,16 @@
+ 	
+ 	interactiveMultiline := method(
+ 		writeln("Io ", System version)
+-		try(EditLine)
++		
++		/* Use GNU Readline as the default line reader. Fall back to Editline */
++		try(setLineReader(ReadLine))
++		try(lineReader ifNil( setLineReader(EditLine)))
+ 
+ 		while(isRunning,
+-			if(getSlot("EditLine"),
++			if(lineReader isNil not,
+ 				handleInteractiveMultiline
+ 			,
+-				interactiveNoEditLine
++				interactiveNoLineReader
+ 			)
+ 		)
+ 	)
+@@ -115,7 +120,7 @@
+ 	)
+ 	*/
+ 	
+-	interactiveNoEditLine := method(
++	interactiveNoLineReader := method(
+ 		write(prompt)
+ 		File standardOutput flush
+ 		
+@@ -164,7 +169,7 @@
+ 		# If there are unmatched ( or the command ends with a \ then we'll need to read multiple lines
+ 		loop(
+ 			# Write out prompt and read line
+-			nextLine := EditLine readLine(nextPrompt)
++			nextLine := lineReader readLine(nextPrompt)
+ 			
+ 			# If there was no line, exit
+ 			nextLine ifNil(context exit)
+@@ -204,7 +209,7 @@
+ 				return
+ 			)
+ 
+-			EditLine addHistory(line)
++			lineReader addHistory(line)
+ 
+ 			# Execute the line and report any exceptions which happen
+ 			executionError := try(result := context doMessage(lineAsMessage, context))
+diff -urNad Io-2007-12-12~/libs/iovm/source/IoSeq_mutable.c Io-2007-12-12/libs/iovm/source/IoSeq_mutable.c
+--- Io-2007-12-12~/libs/iovm/source/IoSeq_mutable.c	2007-12-16 21:42:26.000000000 +0100
++++ Io-2007-12-12/libs/iovm/source/IoSeq_mutable.c	2007-12-16 21:42:33.000000000 +0100
+@@ -777,7 +777,7 @@
+ 	UArray *string;
+ 	UArray *code;
+ 	IoObject *evaluatedCode;
+-	UArray *evaluatedCodeAsString;
++	UArray *evaluatedCodeAsString = NULL;
+ 	const char *label;
+ 	int from, to;
+ 	UArray begin = UArray_stackAllocedWithCString_("#{");
+@@ -814,11 +814,20 @@
+ 		else
+ 		{
+ 			evaluatedCode = IoState_on_doCString_withLabel_(IOSTATE, context, (char *)UArray_bytes(code), label);
+-			evaluatedCodeAsString = DATA(IoState_on_doCString_withLabel_(IOSTATE, evaluatedCode, "asString", label));
++			evaluatedCode = IoState_on_doCString_withLabel_(IOSTATE, evaluatedCode, "asString", label);
++			if (ISSEQ(evaluatedCode))
++			{
++				evaluatedCodeAsString = DATA(evaluatedCode);
++			}
+ 		}
+ 
+ 		UArray_free(code);
+ 
++		if (evaluatedCodeAsString == NULL)
++		{
++			break;
++		}
++
+ 		UArray_removeRange(string, from, to-from+1);
+ 		UArray_at_putAll_(string, from, evaluatedCodeAsString);
+ 		from = from + UArray_size(evaluatedCodeAsString);
+@@ -826,6 +835,11 @@
+ 	
+ 	IoState_popRetainPool(IOSTATE);
+ 
++	if (from >= 0 && to >= 0)
++	{
++		IOASSERT(evaluatedCodeAsString != NULL, "bad asString results");
++	}
++
+ 	return self;
+ }
+ 
+diff -urNad Io-2007-12-12~/libs/iovm/tests/SequenceTest.io Io-2007-12-12/libs/iovm/tests/SequenceTest.io
+--- Io-2007-12-12~/libs/iovm/tests/SequenceTest.io	2007-12-16 21:42:26.000000000 +0100
++++ Io-2007-12-12/libs/iovm/tests/SequenceTest.io	2007-12-16 21:42:33.000000000 +0100
+@@ -556,7 +556,7 @@
+ 		assertEquals("abcd8", "abcd#{a+b}" interpolate(ctx))
+ 		assertEquals("ab8cd", "ab#{a+b}cd" interpolate(ctx))
+ 	)
+-	
++
+ 	testInterpolateInPlace := method(
+ 		assertEquals("" asMutable interpolateInPlace type, Sequence type)
+ 		
+@@ -575,7 +575,16 @@
+ 		assertEquals("abcd8", "abcd#{1+7}" asMutable interpolateInPlace(ctx))
+ 		assertEquals("ab8cd", "ab#{1+7}cd" asMutable interpolateInPlace(ctx))
+ 	)
+-	
++
++	testBadInterpolateInPlace := method(
++		try(
++			x := Object clone do( asString := nil )
++			"#{x}" interpolate
++			y := Object clone removeAllProtos
++			"#{y}" interpolate
++		)
++	)
++
+ 	_testNextInSequence := method(
+ 		assertEquals("b", "a" nextInSequence)
+ 		assertEquals("aa", "z" nextInSequence)
+diff -urNad Io-2007-12-12~/libs/iovm/tests/UnicodeTest.io Io-2007-12-12/libs/iovm/tests/UnicodeTest.io
+--- Io-2007-12-12~/libs/iovm/tests/UnicodeTest.io	1970-01-01 01:00:00.000000000 +0100
++++ Io-2007-12-12/libs/iovm/tests/UnicodeTest.io	2007-12-16 21:42:33.000000000 +0100
+@@ -0,0 +1,118 @@
++#!/usr/bin/env io
++
++// current state that this test checks:
++// 1. io input files are utf-8
++// 2. strings parsed from io input files are ascii/utf16/utf32
++// 3. io standard printing emits utf-8
++// 4. file read/write does not change string encodings
++// 5. argument treating is the same as for input code
++
++UnicodeTest := UnitTest clone do(
++
++	wdPath := method(Path with(call message label pathComponent)) call
++	tempPath := Path with(wdPath, "UnicodeTest.tmp")
++	textPath := Path with(wdPath, "UnicodeTest.txt")
++
++	fileString := File with(textPath) contents
++	triQuoteString := \
++"""Hello, world!
++Здравствуй, мир!
++この世界お。今日は！
++"""
++	monoQuoteString := "Hello, world!\nЗдравствуй, мир!\n"
++	monoQuoteString = monoQuoteString .. "この世界お。今日は！\n"
++)
++
++if(args at(1) == "--print",
++	UnicodeTest getSlot(args at(2)) print
++	exit
++)
++
++if(args at(1) == "--arg",
++	args at(2) print
++	exit
++)
++
++UnicodeTest do(
++
++	tempWrite := method(s,
++		File with(tempPath) openForUpdating truncateToSize(0) write(s) close
++	)
++
++	tempSystem := method(s,
++		code := (" " .. s) asMutable replaceSeq("$0", args at(0))
++		System system(code .. " > " .. tempPath)
++	)
++
++	assertDiff := method(
++		outcome := System system("diff -q " .. tempPath .. " " .. textPath)
++		File with(tempPath) remove
++		assertTrue(outcome == 0)
++	)
++
++	knownBugDiff := method(
++		File with(tempPath) remove
++		knownBug(System system("diff -q " .. tempPath .. " " .. textPath) == 0)
++	)
++
++	testCompares := method(
++		# do not use assertEquals to avoid damaging terminal
++		assertTrue(triQuoteString asUTF8 == fileString asUTF8)
++		assertTrue(triQuoteString asUTF8 == monoQuoteString asUTF8)
++		assertTrue(triQuoteString asUTF8 == fileString asUTF8)
++	)
++
++	testFileFile := method(
++		tempWrite(fileString)
++		assertDiff
++	)
++
++	testFileTriQuote := method(
++		tempWrite(triQuoteString asUTF8)
++		assertDiff
++	)
++
++	testFileMonoQuote := method(
++		tempWrite(monoQuoteString asUTF8)
++		assertDiff
++	)
++
++	testPrintFile := method(
++		tempSystem("$0 --print fileString")
++		assertDiff
++	)
++
++	testPrintTriQuote := method(
++		tempSystem("$0 --print triQuoteString")
++		assertDiff
++	)
++
++	testPrintMonoQuote := method(
++		tempSystem("$0 --print monoQuoteString")
++		assertDiff
++	)
++
++	testArgsMonoQuote := method(
++		tempSystem("$0 --arg '" .. monoQuoteString asUTF8 .. "'")
++		assertDiff
++	)
++
++	testArgsTriQuote := method(
++		tempSystem("$0 --arg '" .. triQuoteString asUTF8 .. "'")
++		assertDiff
++	)
++
++	testArgsFile := method(
++		tempSystem("$0 --arg '" .. fileString asUTF8 .. "'")
++		assertDiff
++	)
++
++	testArgsEval := method(
++		// this removeLast thing is here to remove last "\n",
++		// which io interpreter adds after executing the code
++		string := monoQuoteString asMutable asUTF8 removeLast escape
++		tempSystem("io -e '\"" .. string .. "\"'")
++		assertDiff
++	)
++
++)
+diff -urNad Io-2007-12-12~/libs/iovm/tests/UnicodeTest.txt Io-2007-12-12/libs/iovm/tests/UnicodeTest.txt
+--- Io-2007-12-12~/libs/iovm/tests/UnicodeTest.txt	1970-01-01 01:00:00.000000000 +0100
++++ Io-2007-12-12/libs/iovm/tests/UnicodeTest.txt	2007-12-16 21:42:33.000000000 +0100
+@@ -0,0 +1,3 @@
++Hello, world!
++Здравствуй, мир!
++この世界お。今日は！
+diff -urNad Io-2007-12-12~/projects/IoFE/Makefile Io-2007-12-12/projects/IoFE/Makefile
+--- Io-2007-12-12~/projects/IoFE/Makefile	2007-12-16 21:42:26.000000000 +0100
++++ Io-2007-12-12/projects/IoFE/Makefile	2007-12-16 21:42:33.000000000 +0100
+@@ -1,7 +1,7 @@
+ CC=gcc
+ IO_CFLAGS=-I../../IoVM/_include
+ IO_LDFLAGS=-L../../IoVM/_libs -lIoVM -lm
+-CFLAGS=-O2 -g -Wall -pedantic $(IO_CFLAGS) $(IO_LDFLAGS) -ledit -ltermcap
++CFLAGS=-O2 -g -Wall -pedantic $(IO_CFLAGS) $(IO_LDFLAGS) -ltermcap
+ 
+ all: clean iofe
+ 
+diff -urNad Io-2007-12-12~/tools/Makefile Io-2007-12-12/tools/Makefile
+--- Io-2007-12-12~/tools/Makefile	2007-12-16 21:42:26.000000000 +0100
++++ Io-2007-12-12/tools/Makefile	2007-12-16 21:42:33.000000000 +0100
+@@ -47,11 +47,6 @@
+ LFLAGS +=-lm
+ endif
+ 
+-hasEditLib := $(wildcard editlib_test/editlib_test)
+-ifneq ($(strip $(hasEditLib)),)
+-LFLAGS += -ledit
+-endif
+-
+ #NEEDS_PTHREAD := FreeBSD Linux NetBSD
+ #ifneq (,$(findstring $(SYS),$(NEEDS_PTHREAD)))
+ #LFLAGS +=-lpthread
addfile ./debian/patches/04_AsyncRequest-depends-on-librt.dpatch
hunk ./debian/patches/04_AsyncRequest-depends-on-librt.dpatch 1
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 04_AsyncRequest-depends-on-librt.dpatch by  <jonas@Athlon>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -urNad Io-2007-12-12~/addons/AsyncRequest/build.io Io-2007-12-12/addons/AsyncRequest/build.io
+--- Io-2007-12-12~/addons/AsyncRequest/build.io	2007-12-10 07:35:50.000000000 +0100
++++ Io-2007-12-12/addons/AsyncRequest/build.io	2007-12-16 21:35:57.000000000 +0100
+@@ -1,3 +1,4 @@
+ AddonBuilder clone do(
+ 	dependsOnHeader("aio.h")
++	dependsOnLib("rt")
+ )
addfile ./debian/patches/AVCodec-needs-errno-header.dpatch
hunk ./debian/patches/AVCodec-needs-errno-header.dpatch 1
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## AVCodec-needs-errno-header.dpatch by  <jonas@Athlon>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -urNad Io-2007-12-12~/addons/AVCodec/source/IoAVCodec.h Io-2007-12-12/addons/AVCodec/source/IoAVCodec.h
+--- Io-2007-12-12~/addons/AVCodec/source/IoAVCodec.h	2007-12-10 07:35:50.000000000 +0100
++++ Io-2007-12-12/addons/AVCodec/source/IoAVCodec.h	2007-12-16 22:59:47.000000000 +0100
+@@ -8,6 +8,7 @@
+ #include "IoObject.h"
+ #include "IoSeq.h"
+ #include "IoList.h"
++#include <errno.h>
+ #include <ffmpeg/avcodec.h>
+ #include <ffmpeg/avformat.h>
+ 
addfile ./debian/patches/HDB-has-interpreter-in-usr-local.dpatch
hunk ./debian/patches/HDB-has-interpreter-in-usr-local.dpatch 1
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## HDB-has-interpreter-in-usr-local.dpatch by  <jonas@Athlon>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -urNad iolanguage-20071212~/addons/HDB/io/HDB.io iolanguage-20071212/addons/HDB/io/HDB.io
+--- iolanguage-20071212~/addons/HDB/io/HDB.io	2007-12-10 07:35:50.000000000 +0100
++++ iolanguage-20071212/addons/HDB/io/HDB.io	2007-12-23 16:31:10.000000000 +0100
+@@ -1,5 +1,3 @@
+-#!/usr/local/bin/io
+-
+ HDBModule := Object clone do(
+     pathSeparator := "/" //0 asCharacter
+     keyFromPathList := method(pathList, pathList join(pathSeparator))
addfile ./debian/patches/QDBM-needs-include-directory.dpatch
hunk ./debian/patches/QDBM-needs-include-directory.dpatch 1
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## QDBM-needs-include-directory.dpatch by  <jonas@Athlon>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -urNad Io-2007-12-12~/addons/QDBM/build.io Io-2007-12-12/addons/QDBM/build.io
+--- Io-2007-12-12~/addons/QDBM/build.io	2007-12-17 00:38:27.000000000 +0100
++++ Io-2007-12-12/addons/QDBM/build.io	2007-12-17 00:40:20.000000000 +0100
+@@ -1,3 +1,5 @@
+ AddonBuilder clone do(
++	appendHeaderSearchPath("/usr/include/qdbm")
++	dependsOnHeader("villa.h")
+ 	dependsOnLib("qdbm")
+ )
addfile ./debian/patches/SoundTouch-remove-dependency.dpatch
hunk ./debian/patches/SoundTouch-remove-dependency.dpatch 1
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## SoundTouch-remove-dependency.dpatch by  <jonas@Athlon>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -urNad Io-2007-12-12~/addons/SoundTouch/build.io Io-2007-12-12/addons/SoundTouch/build.io
+--- Io-2007-12-12~/addons/SoundTouch/build.io	2007-12-10 07:35:50.000000000 +0100
++++ Io-2007-12-12/addons/SoundTouch/build.io	2007-12-16 23:39:44.000000000 +0100
+@@ -1,5 +1,4 @@
+ AddonBuilder clone do(
+-	dependsOnLib("stdc++")
+ 	dependsOnLib("SoundTouch")
+ 	dependsOnHeader("soundtouch/SoundTouch.h")
+ 
addfile ./debian/patches/remove-configure-generated-file-in-libsgml-source.dpatch
hunk ./debian/patches/remove-configure-generated-file-in-libsgml-source.dpatch 1
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## remove-configure-generated-file-in-libsgml-source.dpatch by Jonas Eschenburg <indyjo@gmx.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Remove configure-generated file "config.cache" from libsgml sources to make lintian happy.
+
+@DPATCH@
+diff -urNad iolanguage-20071212~/addons/SGML/source/libsgml/config.cache iolanguage-20071212/addons/SGML/source/libsgml/config.cache
+--- iolanguage-20071212~/addons/SGML/source/libsgml/config.cache	2007-12-10 07:35:50.000000000 +0100
++++ iolanguage-20071212/addons/SGML/source/libsgml/config.cache	1970-01-01 01:00:00.000000000 +0100
+@@ -1,20 +0,0 @@
+-# This file is a shell script that caches the results of configure
+-# tests run on this system so they can be shared between configure
+-# scripts and configure runs.  It is not useful on other systems.
+-# If it contains results you don't want to keep, you may remove or edit it.
+-#
+-# By default, configure uses ./config.cache as the cache file,
+-# creating it if it does not exist already.  You can give configure
+-# the --cache-file=FILE option to use a different cache file; that is
+-# what configure does when it calls configure scripts in
+-# subdirectories, so they share the cache.
+-# Giving --cache-file=/dev/null disables caching, for debugging configure.
+-# config.status only pays attention to the cache file if you give it the
+-# --recheck option to rerun configure.
+-#
+-ac_cv_prog_CC=${ac_cv_prog_CC=gcc}
+-ac_cv_prog_cc_cross=${ac_cv_prog_cc_cross=no}
+-ac_cv_prog_cc_g=${ac_cv_prog_cc_g=yes}
+-ac_cv_prog_cc_works=${ac_cv_prog_cc_works=yes}
+-ac_cv_prog_gcc=${ac_cv_prog_gcc=yes}
+-ac_cv_prog_make_make_set=${ac_cv_prog_make_make_set=yes}
}
