From: "Arfrever Frehtes Taifersar Arahesis" <Arfrever@Apache.Org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: bin/, pym/_emerge/
Date: Fri, 27 Dec 2013 18:06:53 +0000 (UTC) [thread overview]
Message-ID: <1388167570.0331526698e485508a1040d24acca5f5eff1c3f3.arfrever@gentoo> (raw)
commit: 0331526698e485508a1040d24acca5f5eff1c3f3
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Fri Dec 27 18:06:10 2013 +0000
Commit: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
CommitDate: Fri Dec 27 18:06:10 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=03315266
Bug #496134: Preserve extended attributes in binary packages.
---
bin/misc-functions.sh | 1 +
pym/_emerge/Binpkg.py | 1 +
| 15 ++++++++++++---
3 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 2c4d248..5ccf7c2 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -1166,6 +1166,7 @@ __dyn_package() {
local tar_options=""
[[ $PORTAGE_VERBOSE = 1 ]] && tar_options+=" -v"
+ has xattr ${FEATURES} && [[ $(tar --help 2> /dev/null) == *--xattrs* ]] && tar_options+=" --xattrs"
# Sandbox is disabled in case the user wants to use a symlink
# for $PKGDIR and/or $PKGDIR/All.
export SANDBOX_ON="0"
diff --git a/pym/_emerge/Binpkg.py b/pym/_emerge/Binpkg.py
index 36f8516..a740efd 100644
--- a/pym/_emerge/Binpkg.py
+++ b/pym/_emerge/Binpkg.py
@@ -298,6 +298,7 @@ class Binpkg(CompositeTask):
extractor = BinpkgExtractorAsync(background=self.background,
env=self.settings.environ(),
+ features=self.settings.features,
image_dir=self._image_dir,
pkg=self.pkg, pkg_path=self._pkg_path,
logfile=self.settings.get("PORTAGE_LOG_FILE"),
--git a/pym/_emerge/BinpkgExtractorAsync.py b/pym/_emerge/BinpkgExtractorAsync.py
index f25cbf9..be74c2f 100644
--- a/pym/_emerge/BinpkgExtractorAsync.py
+++ b/pym/_emerge/BinpkgExtractorAsync.py
@@ -1,23 +1,31 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from _emerge.SpawnProcess import SpawnProcess
import portage
import signal
+import subprocess
class BinpkgExtractorAsync(SpawnProcess):
- __slots__ = ("image_dir", "pkg", "pkg_path")
+ __slots__ = ("features", "image_dir", "pkg", "pkg_path")
_shell_binary = portage.const.BASH_BINARY
def _start(self):
+ tar_options = ""
+ if "xattr" in self.features:
+ process = subprocess.Popen(["tar", "--help"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ output = process.communicate()[0]
+ if b"--xattrs" in output:
+ tar_options = "--xattrs"
+
# Add -q to bzip2 opts, in order to avoid "trailing garbage after
# EOF ignored" warning messages due to xpak trailer.
# SIGPIPE handling (128 + SIGPIPE) should be compatible with
# assert_sigpipe_ok() that's used by the ebuild unpack() helper.
self.args = [self._shell_binary, "-c",
- ("${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d} -cq -- %s | tar -xp -C %s -f - ; " + \
+ ("${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d} -cq -- %s | tar -xp %s -C %s -f - ; " + \
"p=(${PIPESTATUS[@]}) ; " + \
"if [[ ${p[0]} != 0 && ${p[0]} != %d ]] ; then " % (128 + signal.SIGPIPE) + \
"echo bzip2 failed with status ${p[0]} ; exit ${p[0]} ; fi ; " + \
@@ -25,6 +33,7 @@ class BinpkgExtractorAsync(SpawnProcess):
"echo tar failed with status ${p[1]} ; exit ${p[1]} ; fi ; " + \
"exit 0 ;") % \
(portage._shell_quote(self.pkg_path),
+ tar_options,
portage._shell_quote(self.image_dir))]
SpawnProcess._start(self)
next reply other threads:[~2013-12-27 18:06 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-27 18:06 Arfrever Frehtes Taifersar Arahesis [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-04-30 19:28 [gentoo-commits] proj/portage:master commit in: bin/, pym/_emerge/ Zac Medico
2018-03-28 6:52 Zac Medico
2015-09-28 16:08 Zac Medico
2013-08-03 0:38 Zac Medico
2012-12-29 7:45 Zac Medico
2012-10-14 21:59 Zac Medico
2012-10-06 18:11 Zac Medico
2012-10-06 18:05 Zac Medico
2012-09-15 16:53 Zac Medico
2012-07-18 21:38 Zac Medico
2012-03-25 23:20 Zac Medico
2011-12-10 3:23 Zac Medico
2011-10-29 3:20 Zac Medico
2011-10-28 20:13 Zac Medico
2011-02-22 2:51 Zac Medico
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1388167570.0331526698e485508a1040d24acca5f5eff1c3f3.arfrever@gentoo \
--to=arfrever@apache.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox