Index: trunk/essentials/sys-apps/prefix-portage/bin/dispatch-conf
===================================================================
--- trunk/essentials/sys-apps/prefix-portage/bin/dispatch-conf	(revision 3512)
+++ trunk/essentials/sys-apps/prefix-portage/bin/dispatch-conf	(revision 3513)
@@ -356,13 +356,18 @@
 	# from ASPN - Danny Yoo
 	#
-	import sys, tty, termios
-
-	fd = sys.stdin.fileno()
-	old_settings = termios.tcgetattr(fd)
-	try:
-		tty.setraw(sys.stdin.fileno())
+
+	# bird: XXX: termios.tcgetattr ++ doesn't exist on OS/2 yet.
+	if sys.platform != "os2knix":
+		import sys, tty, termios
+	
+		fd = sys.stdin.fileno()
+		old_settings = termios.tcgetattr(fd)
+		try:
+			tty.setraw(sys.stdin.fileno())
+			ch = sys.stdin.read(1)
+		finally:
+			termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
+	else
 		ch = sys.stdin.read(1)
-	finally:
-		termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
 	return ch
 
Index: trunk/essentials/sys-apps/prefix-portage/pym/portage/__init__.py
===================================================================
--- trunk/essentials/sys-apps/prefix-portage/pym/portage/__init__.py	(revision 3512)
+++ trunk/essentials/sys-apps/prefix-portage/pym/portage/__init__.py	(revision 3513)
@@ -2371,58 +2371,68 @@
 		elif 1 not in fd_pipes or 2 not in fd_pipes:
 			raise ValueError(fd_pipes)
-		from pty import openpty
-		master_fd, slave_fd = openpty()
-		fd_pipes.setdefault(0, sys.stdin.fileno())
-		stdin_fd = fd_pipes[0]
-		if os.isatty(stdin_fd):
-			# Copy the termios attributes from stdin_fd to the slave_fd and put
-			# the stdin_fd into raw mode with ECHO disabled.  The stdin
-			# termios attributes are reverted before returning, or via the
-			# atexit hook in portage.process when killed by a signal.
-			import termios, tty
-			stdin_termios = termios.tcgetattr(stdin_fd)
-			tty.setraw(stdin_fd)
-			term_attr = termios.tcgetattr(stdin_fd)
-			term_attr[3] &= ~termios.ECHO
-			termios.tcsetattr(stdin_fd, termios.TCSAFLUSH, term_attr)
-			termios.tcsetattr(slave_fd, termios.TCSAFLUSH, stdin_termios)
-			from output import get_term_size, set_term_size
-			rows, columns = get_term_size()
-			set_term_size(rows, columns, slave_fd)
-			pre_exec = keywords.get("pre_exec")
-			def setup_ctty():
-				os.setsid()
-				# Make it into the "controlling terminal".
-				import termios
-				if hasattr(termios, "TIOCSCTTY"):
-					# BSD 4.3 approach
-					import fcntl
-					fcntl.ioctl(0, termios.TIOCSCTTY)
-				else:
-					# SVR4 approach
-					fd = os.open(os.ttyname(0), os.O_RDWR)
-					for x in 0, 1, 2:
-						os.dup2(fd, x)
-					os.close(fd)
-				if pre_exec:
-					pre_exec()
-			keywords["pre_exec"] = setup_ctty
-		# tee will always exit with an IO error, so ignore it's stderr.
-		null_file = open('/dev/null', 'w')
-		mypids.extend(portage.process.spawn(['tee', '-i', '-a', logfile],
-			returnpid=True, fd_pipes={0:master_fd, 1:fd_pipes[1],
-			2:null_file.fileno()}))
-		output_pid = mypids[-1]
-		mypids.extend(portage.process.spawn(['cat'],
-			returnpid=True, fd_pipes={0:fd_pipes[0], 1:master_fd,
-			2:null_file.fileno()}))
-		input_pid = mypids[-1]
-		os.close(master_fd)
-		null_file.close()
-		fd_pipes[0] = slave_fd
-		fd_pipes[1] = slave_fd
-		fd_pipes[2] = slave_fd
-		keywords["fd_pipes"] = fd_pipes
-
+		# bird: XXX: pty and termios.tcgetattr doesn't work/exist on OS/2 yet.
+        if sys.platform == "os2knix":
+			pr, pw = os.pipe()
+			mypids.extend(portage.process.spawn(('tee', '-i', '-a', logfile),
+			              returnpid=True, fd_pipes={0:pr, 1:fd_pipes[1], 2:fd_pipes[2]}))
+			os.close(pr)
+			fd_pipes[1] = pw
+			fd_pipes[2] = pw
+			keywords["fd_pipes"] = fd_pipes
+        else:
+			from pty import openpty
+			master_fd, slave_fd = openpty()
+			fd_pipes.setdefault(0, sys.stdin.fileno())
+			stdin_fd = fd_pipes[0]
+			if os.isatty(stdin_fd):
+				# Copy the termios attributes from stdin_fd to the slave_fd and put
+				# the stdin_fd into raw mode with ECHO disabled.  The stdin
+				# termios attributes are reverted before returning, or via the
+				# atexit hook in portage.process when killed by a signal.
+				import termios, tty
+				stdin_termios = termios.tcgetattr(stdin_fd)
+				tty.setraw(stdin_fd)
+				term_attr = termios.tcgetattr(stdin_fd)
+				term_attr[3] &= ~termios.ECHO
+				termios.tcsetattr(stdin_fd, termios.TCSAFLUSH, term_attr)
+				termios.tcsetattr(slave_fd, termios.TCSAFLUSH, stdin_termios)
+				from output import get_term_size, set_term_size
+				rows, columns = get_term_size()
+				set_term_size(rows, columns, slave_fd)
+				pre_exec = keywords.get("pre_exec")
+				def setup_ctty():
+					os.setsid()
+					# Make it into the "controlling terminal".
+					import termios
+					if hasattr(termios, "TIOCSCTTY"):
+						# BSD 4.3 approach
+						import fcntl
+						fcntl.ioctl(0, termios.TIOCSCTTY)
+					else:
+						# SVR4 approach
+						fd = os.open(os.ttyname(0), os.O_RDWR)
+						for x in 0, 1, 2:
+							os.dup2(fd, x)
+						os.close(fd)
+					if pre_exec:
+						pre_exec()
+				keywords["pre_exec"] = setup_ctty
+			# tee will always exit with an IO error, so ignore it's stderr.
+			null_file = open('/dev/null', 'w')
+			mypids.extend(portage.process.spawn(['tee', '-i', '-a', logfile],
+				returnpid=True, fd_pipes={0:master_fd, 1:fd_pipes[1],
+				2:null_file.fileno()}))
+			output_pid = mypids[-1]
+			mypids.extend(portage.process.spawn(['cat'],
+				returnpid=True, fd_pipes={0:fd_pipes[0], 1:master_fd,
+				2:null_file.fileno()}))
+			input_pid = mypids[-1]
+			os.close(master_fd)
+			null_file.close()
+			fd_pipes[0] = slave_fd
+			fd_pipes[1] = slave_fd
+			fd_pipes[2] = slave_fd
+			keywords["fd_pipes"] = fd_pipes
+    
 	features = mysettings.features
 	restrict = mysettings.get("PORTAGE_RESTRICT","").split()
Index: trunk/essentials/sys-apps/prefix-portage/pym/portage/util.py
===================================================================
--- trunk/essentials/sys-apps/prefix-portage/pym/portage/util.py	(revision 3512)
+++ trunk/essentials/sys-apps/prefix-portage/pym/portage/util.py	(revision 3513)
@@ -655,4 +655,7 @@
 				raise OperationNotPermitted(func_call)
 			elif oe.errno == errno.EACCES:
+				# For now, just ignore this on OS/2 since triggers on the /var/../temp/build.log.
+				if sys.platform == "os2knix":
+					return modified;
 				raise PermissionDenied(func_call)
 			elif oe.errno == errno.EROFS:
