From patchwork Wed Feb 25 21:17:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Erdmann?= X-Patchwork-Id: 443659 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id ACB21140083 for ; Thu, 26 Feb 2015 08:23:14 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=mailerd.de header.i=@mailerd.de header.b=ZjUiAQ7M; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id D9B44A3411; Wed, 25 Feb 2015 21:23:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dwhyUTOw7e2e; Wed, 25 Feb 2015 21:23:11 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 924E2A343C; Wed, 25 Feb 2015 21:23:11 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id CD27B1C2214 for ; Wed, 25 Feb 2015 21:23:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id C913C33420 for ; Wed, 25 Feb 2015 21:23:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id or5IXmoobtIB for ; Wed, 25 Feb 2015 21:23:08 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-we0-f176.google.com (mail-we0-f176.google.com [74.125.82.176]) by silver.osuosl.org (Postfix) with ESMTPS id 4643532E44 for ; Wed, 25 Feb 2015 21:23:08 +0000 (UTC) Received: by wesk11 with SMTP id k11so6235225wes.11 for ; Wed, 25 Feb 2015 13:23:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerd.de; s=mails; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=5vvA7JXvIGrljCV+VFbd+qyVqCU4rwzxCO9sjYDG/wQ=; b=ZjUiAQ7MYJjJ1usGrLMNJz2LiNgn7eP62dWJO4hrKADjEL2CnRV3Ph0Zt0WSjJdyYp gv8Z43zF0p7/+oadpPBbxsk6L84EqrAT2UaRvNRV5074K4suLT8gdY3O+2CwPeVoGFvc tOpyGhOSa35n+RHSteMdBVvBUyA9nbOhpU5AM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-type :content-transfer-encoding; bh=5vvA7JXvIGrljCV+VFbd+qyVqCU4rwzxCO9sjYDG/wQ=; b=KEVvW0cb9K5FLxnIIqmmB37QfNoUNyNLtllOwaYdTNP4rOh20QTuE36ZclVbc5MO5q Qa6nLh0ylmjCEb0yJ4sOHLwk2qorzH7ULnaqfgMX+FVUbOU8338XRycRpBJRGrGb1Yah DxP0PpoB2qc+La6a3EF1SlaCr9LsO6nppG5ST24XpY5YRlyS16sFyJQyUHFEjVqMpuwF SSMUOmUjhd9nraJtp9wA8rxbYjcbaL9eMo+0Ap9GWSr+eZ30SAhQjntxZNBJxhdSPtMy RjAsidw9hxONvCD1o9nLwUyBQ/KYzZYOQ/I1iMP/zhVuAphjuOekMXKbjQ2NWZRlM8B+ BBYw== X-Gm-Message-State: ALoCoQlGe0wUTC4NEFZqFMatDKcQnmzNYD4hvL6ScGiMEAlBGnaTXm36a4bIQL+A0OmdvKFF5ZiJ X-Received: by 10.194.186.200 with SMTP id fm8mr10207990wjc.138.1424899065550; Wed, 25 Feb 2015 13:17:45 -0800 (PST) Received: from localhost.localdomain (dslb-188-105-009-107.188.105.pools.vodafone-ip.de. [188.105.9.107]) by mx.google.com with ESMTPSA id fo9sm26800926wib.16.2015.02.25.13.17.44 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Feb 2015 13:17:44 -0800 (PST) From: =?UTF-8?q?Andr=C3=A9=20Erdmann?= To: buildroot@buildroot.org Date: Wed, 25 Feb 2015 22:17:19 +0100 Message-Id: <1424899050-24932-3-git-send-email-dywi@mailerd.de> X-Mailer: git-send-email 2.3.0 In-Reply-To: <1424899050-24932-1-git-send-email-dywi@mailerd.de> References: <1424899050-24932-1-git-send-email-dywi@mailerd.de> MIME-Version: 1.0 Cc: thomas.petazzoni@free-electrons.com Subject: [Buildroot] [PATCH 02/13] autobuild-run, python3: urllib.request<>urllib2 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" urllib2 has been split into several modules, urlopen() is now part of urllib.request. Py2k compatibility: import urllib2 if python version < 3 Signed-off-by: André Erdmann --- scripts/autobuild-run | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/autobuild-run b/scripts/autobuild-run index 2354893..be2f482 100755 --- a/scripts/autobuild-run +++ b/scripts/autobuild-run @@ -59,7 +59,6 @@ from __future__ import print_function -import urllib2 import csv from random import randint import subprocess @@ -73,6 +72,13 @@ import hashlib import argparse import ConfigParser +if sys.hexversion >= 0x3000000: + import urllib.request as _urllib +else: + import urllib2 as _urllib + +urlopen = _urllib.urlopen + MAX_DURATION = 60 * 60 * 4 VERSION = 1 @@ -81,7 +87,7 @@ def log_write(logf, msg): logf.flush() def check_version(): - r = urllib2.urlopen('http://autobuild.buildroot.org/version') + r = urlopen('http://autobuild.buildroot.org/version') version = int(r.readline().strip()) if version > VERSION: print("ERROR: script version too old, please upgrade.") @@ -136,7 +142,7 @@ def get_toolchain_configs(): - contents: an array of lines of the defconfig """ - r = urllib2.urlopen('http://autobuild.buildroot.org/toolchains/configs/toolchain-configs.csv') + r = urlopen('http://autobuild.buildroot.org/toolchains/configs/toolchain-configs.csv') l = r.readlines() configs = [] for row in csv.reader(l): @@ -151,7 +157,7 @@ def get_toolchain_configs(): if hostarch != config["hostarch"]: continue config["libc"] = row[2] - r = urllib2.urlopen(config["url"]) + r = urlopen(config["url"]) config["contents"] = r.readlines() configs.append(config) return configs