From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 9308813800E for ; Mon, 23 Jul 2012 15:46:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 943A8E06C0; Mon, 23 Jul 2012 15:46:07 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 69BCBE06C0 for ; Mon, 23 Jul 2012 15:46:07 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 356691B4348 for ; Mon, 23 Jul 2012 15:46:06 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id CA402E5436 for ; Mon, 23 Jul 2012 15:46:04 +0000 (UTC) From: "Anthony G. Basile" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anthony G. Basile" Message-ID: <1343058352.9d645eec26ef20d1bc6a347d0e94490870583d26.blueness@gentoo> Subject: [gentoo-commits] proj/elfix:master commit in: scripts/ X-VCS-Repository: proj/elfix X-VCS-Files: scripts/revdep-pax X-VCS-Directories: scripts/ X-VCS-Committer: blueness X-VCS-Committer-Name: Anthony G. Basile X-VCS-Revision: 9d645eec26ef20d1bc6a347d0e94490870583d26 X-VCS-Branch: master Date: Mon, 23 Jul 2012 15:46:04 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: cba866b6-690e-42fb-b47e-e2cdbc6c581f X-Archives-Hash: 9ac08f137e94363b4657ccb437d2e0b6 commit: 9d645eec26ef20d1bc6a347d0e94490870583d26 Author: Anthony G. Basile gentoo org> AuthorDate: Mon Jul 23 15:45:52 2012 +0000 Commit: Anthony G. Basile gentoo org> CommitDate: Mon Jul 23 15:45:52 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/elfix.git;a=commit;h=9d645eec scripts/revdep-pax: add python2/3 compat raw_input() --- scripts/revdep-pax | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/revdep-pax b/scripts/revdep-pax index 7504877..d34acdc 100755 --- a/scripts/revdep-pax +++ b/scripts/revdep-pax @@ -7,6 +7,15 @@ import subprocess import re import pax + +#python2/3 compat input +def get_input(prompt): + if sys.hexversion > 0x03000000: + return input(prompt) + else: + return raw_input(prompt) + + def get_ldd_linkings(binary): ldd_output = subprocess.Popen(['/usr/bin/ldd', binary], stdout=subprocess.PIPE, stderr=subprocess.PIPE) ldd_lines = ldd_output.stdout.read().decode().split('\n') @@ -274,7 +283,7 @@ def run_binary(binary, verbose, mark, allyes): if allyes: ans = 'y' else: - ans = input('\tSet flags for %s (y/n): ' % library) + ans = get_input('\tSet flags for %s (y/n): ' % library) if ans == 'y': do_marking = True break @@ -367,7 +376,7 @@ def run_soname(name, verbose, use_soname, mark, allyes, executable_only): if allyes: ans = 'y' else: - ans = input('\tSet flags for %s (y/n): ' % binary) + ans = get_input('\tSet flags for %s (y/n): ' % binary) if ans == 'y': do_marking = True break