Return-Path: Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by mail.openembedded.org (Postfix) with ESMTP id 2CF6A60746 for ; Tue, 14 Jun 2016 14:02:05 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id m124so22633239wme.3 for ; Tue, 14 Jun 2016 07:02:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=a3dq4GFolmTqY24PUkVwcBxFKq0JwXemDf9y0Qd4Ivw=; b=EGLl71rFqcyphkJ2fbelW0J0VSIBsR3Kvb2n31mDii1/mXI+2PpOiw/ljN/JjVEg1Z FB4M40kjhZ7U+sh1runplLq6c355UqLMdaQXlCYL0KDVbVMtNvuwBHsi68tJfZe/XKrG 4IIbbKBy3DoairkMtn4wEA/or6shZwwP1Kgkk7aE4xrNetqsGO60D+VPmeRmaXcrHfjk H8rLK3r+fLdmOQ9YO/QQ6NiyFbTddBp1+Fs7nBcXy/BSB26StL7ub6VEs4k30WZb2oWF rEQaKIFrj1LD/S0vgFTw/Z6JW7vQP9HktSu1BJR1HV8YPm0Wa8lgR0niYLpXHnoMeHc6 oJcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=a3dq4GFolmTqY24PUkVwcBxFKq0JwXemDf9y0Qd4Ivw=; b=F8eglBTDndi1k3nUpBTgme2GGlHUrBFqdGxZoSLJpaKGeUczKPVBavXtObPRxoPZpt A8cSjem/MQSnpqNv7vhTYP+VUO8Pd0vHHYdzTZ1VUvtih1I9SHkXOnXm1I2ZZgQjO30a 1pHGLnWr0a+9asEuyPV4Xuydef3SKAe3ZaHVEzAVVlnouOH8PSRgMHyRqxr1NsOxNYAE QUypIvzrOMOF/eGHxQIx+kwzDGHaUFewfOgyCbw4Ky39dmYwccZaUCvKZIc9MDTs0mhl xCfIFsmwoMUYjXEBynliC3CuIQoqvZsQsmeMoKwmBcFOF9m/7Ml4dNtVr7yn+ys4HIVu quZQ== X-Gm-Message-State: ALyK8tK1pm4ISrQnrggl/A8KtO2MdovLgZ7Jf4au8z/dm4AQOnaZyb8f5uonIztBeSC5pw== X-Received: by 10.194.192.193 with SMTP id hi1mr6359124wjc.4.1465912926320; Tue, 14 Jun 2016 07:02:06 -0700 (PDT) Received: from localhost (ip-86-49-34-37.net.upcbroadband.cz. [86.49.34.37]) by smtp.gmail.com with ESMTPSA id e8sm4333325wma.2.2016.06.14.07.02.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Jun 2016 07:02:04 -0700 (PDT) From: Martin Jansa X-Google-Original-From: Martin Jansa To: bitbake-devel@lists.openembedded.org Date: Tue, 14 Jun 2016 16:02:20 +0200 Message-Id: <20160614140220.32534-1-Martin.Jansa@gmail.com> X-Mailer: git-send-email 2.9.0 Subject: [PATCH] fetch: fix unpacking .deb and .ipk with python3 X-BeenThere: bitbake-devel@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussion that advance bitbake development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 14:02:06 -0000 * otherwise e.g. libjs-jquery-1.7.2-r0 do_unpack fails like this: http://errors.yoctoproject.org/Errors/Details/69433/ DEBUG: Executing python function do_unpack DEBUG: Executing python function base_do_unpack ERROR: Error executing a python function in exec_python_func() autogenerated: The stack trace of python calls that resulted in this exception/failure was: File: 'exec_python_func() autogenerated', lineno: 2, function: 0001: *** 0002:base_do_unpack(d) 0003: File: ' /openembedded-core/meta/classes/base.bbclass', lineno: 155, function: base_do_unpack 0151: bb.utils.remove(p_dir, True) 0152: 0153: try: 0154: fetcher = bb.fetch2.Fetch(src_uri, d) *** 0155: fetcher.unpack(rootdir) 0156: except bb.fetch2.BBFetchException as e: 0157: raise bb.build.FuncFailed(e) 0158:} 0159: File: ' /bitbake/lib/bb/fetch2/__init__.py', lineno: 1681, function: unpack 1677: 1678: if ud.lockfile: 1679: lf = bb.utils.lockfile(ud.lockfile) 1680: *** 1681: ud.method.unpack(ud, root, self.d) 1682: 1683: if ud.lockfile: 1684: bb.utils.unlockfile(lf) 1685: File: ' /bitbake/lib/bb/fetch2/__init__.py', lineno: 1399, function: unpack 1395: output = subprocess.check_output('ar -t %s' % file, preexec_fn=subprocess_setup, shell=True) 1396: datafile = None 1397: if output: 1398: for line in output.splitlines(): *** 1399: if line.startswith('data.tar.'): 1400: datafile = line 1401: break 1402: else: 1403: raise UnpackError("Unable to unpack deb/ipk package - does not contain data.tar.* file", urldata.url) Exception: TypeError: startswith first arg must be bytes or a tuple of bytes, not str DEBUG: Python function base_do_unpack finished DEBUG: Python function do_unpack finished ERROR: Function failed: base_do_unpack Signed-off-by: Martin Jansa --- lib/bb/fetch2/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py index f612318..325a66c 100644 --- a/lib/bb/fetch2/__init__.py +++ b/lib/bb/fetch2/__init__.py @@ -1392,7 +1392,7 @@ class FetchMethod(object): else: cmd = 'rpm2cpio.sh %s | cpio -id' % (file) elif file.endswith('.deb') or file.endswith('.ipk'): - output = subprocess.check_output('ar -t %s' % file, preexec_fn=subprocess_setup, shell=True) + output = subprocess.check_output('ar -t %s' % file, preexec_fn=subprocess_setup, shell=True).decode("utf-8") datafile = None if output: for line in output.splitlines(): -- 2.9.0