aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-31 13:42:20 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-31 13:42:20 +0000
commit565a93fad0cee550c2fb44286e64f02685cbed88 (patch)
treeb22c68e54da0f27106c6309c6d62bcc314eef053
parent30a3e686b380a908a184c4c2fc7820e63f32e6e8 (diff)
downloadpaludis-565a93fad0cee550c2fb44286e64f02685cbed88.tar.gz
paludis-565a93fad0cee550c2fb44286e64f02685cbed88.tar.xz
Don't try to preserve permissions for env
-rw-r--r--paludis/repositories/e/ebuild/utils/unpaxinate.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/paludis/repositories/e/ebuild/utils/unpaxinate.cc b/paludis/repositories/e/ebuild/utils/unpaxinate.cc
index 6da1a95..a246aeb 100644
--- a/paludis/repositories/e/ebuild/utils/unpaxinate.cc
+++ b/paludis/repositories/e/ebuild/utils/unpaxinate.cc
@@ -46,10 +46,19 @@ int main(int argc, char *argv[])
{
std::string archive_filename(archive_entry_pathname(entry));
std::string out_filename;
+ int flags = 0;
+
if (archive_filename == "PBIN/environment" && want_env)
+ {
out_filename = "environment";
+ flags = ARCHIVE_EXTRACT_TIME;
+ }
else if ((! want_env) && (0 != archive_filename.compare(0, 5, "PBIN/", 0, 5)))
+ {
out_filename = archive_filename;
+ flags = ARCHIVE_EXTRACT_OWNER | ARCHIVE_EXTRACT_PERM | ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_ACL |
+ ARCHIVE_EXTRACT_FFLAGS | ARCHIVE_EXTRACT_XATTR | ARCHIVE_EXTRACT_SECURE_NODOTDOT;
+ }
else
{
archive_read_data_skip(archive);
@@ -59,9 +68,7 @@ int main(int argc, char *argv[])
std::cout << out_filename << std::endl;
archive_entry_set_pathname(entry, out_filename.c_str());
- if (ARCHIVE_OK != ((x = archive_read_extract(archive, entry, ARCHIVE_EXTRACT_OWNER |
- ARCHIVE_EXTRACT_PERM | ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_ACL |
- ARCHIVE_EXTRACT_FFLAGS | ARCHIVE_EXTRACT_XATTR | ARCHIVE_EXTRACT_SECURE_NODOTDOT))))
+ if (ARCHIVE_OK != ((x = archive_read_extract(archive, entry, flags))))
{
std::cerr << "Could not extract '" << out_filename << "' from '" << archive_file << "': libarchive returned " <<
x << ", archive_errno " << archive_errno(archive) << ": " << archive_error_string(archive) << std::endl;