From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QhkwN-0000Yt-M0 for garchives@archives.gentoo.org; Fri, 15 Jul 2011 16:08:35 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 72B4721C310; Fri, 15 Jul 2011 16:08:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 48F1621C310 for ; Fri, 15 Jul 2011 16:08:23 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A1E412AC320 for ; Fri, 15 Jul 2011 16:08:22 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id A92418003D for ; Fri, 15 Jul 2011 16:08:21 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: Subject: [gentoo-commits] proj/gentoopm:master commit in: gentoopm/bash/ X-VCS-Repository: proj/gentoopm X-VCS-Files: gentoopm/bash/bashserver.py X-VCS-Directories: gentoopm/bash/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: b4682ea50b068eb923c34bb4d26459711fa9cf04 Date: Fri, 15 Jul 2011 16:08:21 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 254c633d60d2cbffe463569f0602f87e commit: b4682ea50b068eb923c34bb4d26459711fa9cf04 Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Fri Jul 15 14:49:55 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Fri Jul 15 14:49:55 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gentoopm.git;= a=3Dcommit;h=3Db4682ea5 BashServer: pass a complete command to the server. --- gentoopm/bash/bashserver.py | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gentoopm/bash/bashserver.py b/gentoopm/bash/bashserver.py index 9fbd33e..f8740fd 100644 --- a/gentoopm/bash/bashserver.py +++ b/gentoopm/bash/bashserver.py @@ -11,8 +11,8 @@ _bash_script =3D ''' while true; do ( source %s - while read -r __GENTOOPM_VARS; do - eval set -- ${__GENTOOPM_VARS} + while read -r __GENTOOPM_CMD; do + eval ${__GENTOOPM_CMD} if [[ ${#} -eq 0 ]]; then # reload env file break @@ -48,7 +48,7 @@ class BashServer(BashParser): shutil.copyfileobj(envf, f) f.flush() =20 - self._bashproc.stdin.write('\n'.encode('ASCII')) + self._bashproc.stdin.write('set --\n'.encode('ASCII')) self._bashproc.stdin.flush() =20 def _read1(self): @@ -59,14 +59,14 @@ class BashServer(BashParser): return buf[1:-1].decode('utf-8') =20 def __getitem__(self, k): - self._bashproc.stdin.write(('"${%s}"\n' % k).encode('ASCII')) + self._bashproc.stdin.write(('set -- "${%s}"\n' % k).encode('ASCII')) self._bashproc.stdin.flush() =20 return self._read1() =20 def copy(self, *varlist): q =3D ' '.join(['"${%s}"' % v for v in varlist]) - self._bashproc.stdin.write(('%s\n' % q).encode('ASCII')) + self._bashproc.stdin.write(('set -- %s\n' % q).encode('ASCII')) self._bashproc.stdin.flush() =20 ret =3D [self._read1() for v in varlist]