From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id D4E131382C5 for ; Sun, 4 Mar 2018 18:22:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C8403E091A; Sun, 4 Mar 2018 18:22:41 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A3C2EE091A for ; Sun, 4 Mar 2018 18:22:41 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D7E5B335CA5 for ; Sun, 4 Mar 2018 18:22:39 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 6C9FE1F0 for ; Sun, 4 Mar 2018 18:22:38 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1520187725.56350cb6b1ee0b93a86e27bc59f7d3a0e73ad220.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/xattr-helper.py X-VCS-Directories: bin/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 56350cb6b1ee0b93a86e27bc59f7d3a0e73ad220 X-VCS-Branch: master Date: Sun, 4 Mar 2018 18:22:38 +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: bf6bdf86-5c6b-45ea-84f5-0bd81b7d0087 X-Archives-Hash: 8f2407355fb8c68709d4b8a51b21703c commit: 56350cb6b1ee0b93a86e27bc59f7d3a0e73ad220 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Sun Mar 4 05:32:20 2018 +0000 Commit: Zac Medico gentoo org> CommitDate: Sun Mar 4 18:22:05 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=56350cb6 xattr-helper.py: Make restoring of extended attributes work again. Set options.paths using standard input only in dump mode. Also fix support for paths passed as arguments. Bug: https://bugs.gentoo.org/649528 Fixes: 345c54de9e8c9daac190fbb07d33bf40e7bac5a9 bin/xattr-helper.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/bin/xattr-helper.py b/bin/xattr-helper.py index b5faed044..75844f279 100755 --- a/bin/xattr-helper.py +++ b/bin/xattr-helper.py @@ -1,5 +1,5 @@ #!/usr/bin/python -b -# Copyright 2012-2014 Gentoo Foundation +# Copyright 2012-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 doc = """Dump and restore extended attributes. @@ -147,12 +147,13 @@ def main(argv): actions.add_argument('--dump', action='store_true', help='Dump the values of all extended ' - 'attributes associated with null-separated' - ' paths read from stdin.') + 'attributes associated with paths ' + 'passed as arguments or null-separated ' + 'paths read from stdin.') actions.add_argument('--restore', action='store_true', - help='Restore extended attributes using' - ' a dump read from stdin.') + help='Restore extended attributes using ' + 'a dump read from stdin.') options = parser.parse_args(argv) @@ -160,10 +161,12 @@ def main(argv): file_in = sys.stdin.buffer.raw else: file_in = sys.stdin - if not options.paths: - options.paths += [x for x in file_in.read().split(b'\0') if x] if options.dump: + if options.paths: + options.paths = [unicode_encode(x) for x in options.paths] + else: + options.paths = [x for x in file_in.read().split(b'\0') if x] if sys.hexversion >= 0x3000000: file_out = sys.stdout.buffer else: