aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-11-07 16:53:04 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-11-07 19:44:38 +0000
commit4ac7b20c2006414b1ad708f61c2e31fc494bb4ee (patch)
treea8d70fc65651a4fdbf04a38c8705773cd28778d2
parent78fae8c23f0aa4070ed495ced4c4f20434f91c62 (diff)
downloadpaludis-4ac7b20c2006414b1ad708f61c2e31fc494bb4ee.tar.gz
paludis-4ac7b20c2006414b1ad708f61c2e31fc494bb4ee.tar.xz
Write pax archives if gnutar isn't available
-rw-r--r--configure.ac12
-rw-r--r--paludis/repositories/e/e_repository.cc11
-rw-r--r--paludis/repositories/e/ebuild.cc1
-rw-r--r--paludis/repositories/e/ebuild.hh2
-rwxr-xr-xpaludis/repositories/e/ebuild/write_binary_ebuild.bash2
-rw-r--r--paludis/tar_extras.cc6
6 files changed, 28 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index 698f473..08bd126 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1564,6 +1564,7 @@ fi
dnl }}}
dnl {{{ libarchive
+libarchive_does_gnutar=no
if test "x$need_libarchive_check" = "xyes" ; then
AC_MSG_CHECKING([for libarchive])
AC_PREPROC_IFELSE([AC_LANG_SOURCE([
@@ -1572,7 +1573,7 @@ if test "x$need_libarchive_check" = "xyes" ; then
[AC_MSG_RESULT([yes])],
[AC_MSG_ERROR([libarchive is required for pbins])])
- AC_MSG_CHECKING([whether your libarchive is new enough])
+ AC_MSG_CHECKING([whether your libarchive does gnutar])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#include <archive.h>
@@ -1582,9 +1583,14 @@ int main(int, char **)
archive_write_set_format_gnutar(archive);
}
])],
- [AC_MSG_RESULT([yes])],
- [AC_MSG_ERROR([a more recent libarchive than the one you have is required for pbins])])
+ [
+ AC_MSG_RESULT([yes])
+ libarchive_does_gnutar=yes
+ AC_DEFINE([LIBARCHIVE_DOES_GNUTAR], [1], [libarchive does gnutar])
+ ],
+ [AC_MSG_RESULT([no])])
fi
+AM_CONDITIONAL([LIBARCHIVE_DOES_GNUTAR], test "x$libarchive_does_gnutar" = "xyes")
dnl }}}
dnl {{{ sqlite3 check
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index bfea6ce..be5bd0e 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -139,6 +139,12 @@ typedef std::map<FSPath, std::string, FSPathComparator> EAPIForFileMap;
namespace
{
+#ifdef LIBARCHIVE_DOES_GNUTAR
+ const std::string pbin_tar_extension = ".tar";
+#else
+ const std::string pbin_tar_extension = ".pax";
+#endif
+
std::shared_ptr<FSPathSequence> get_master_locations(
const std::shared_ptr<const ERepositorySequence> & r)
{
@@ -2783,7 +2789,7 @@ ERepository::merge(const MergeParams & m)
n::output_manager() = m.output_manager(),
n::package_id() = m.package_id(),
n::root() = FSPath("/"),
- n::tar_file() = _imp->params.binary_distdir() / (bin_dist_base + ".tar")
+ n::tar_file() = _imp->params.binary_distdir() / (bin_dist_base + pbin_tar_extension)
));
if (! merger.check())
@@ -2791,7 +2797,7 @@ ERepository::merge(const MergeParams & m)
merger.merge();
- Process compress_process(ProcessCommand({"bzip2", stringify(_imp->params.binary_distdir() / (bin_dist_base + ".tar")) }));
+ Process compress_process(ProcessCommand({"bzip2", stringify(_imp->params.binary_distdir() / (bin_dist_base + pbin_tar_extension)) }));
if (0 != compress_process.run().wait())
throw ActionFailedError("Compressing tarball failed");
@@ -2821,6 +2827,7 @@ ERepository::merge(const MergeParams & m)
n::binary_distdir() = _imp->params.binary_distdir(),
n::binary_ebuild_location() = binary_ebuild_location,
n::binary_keywords() = binary_keywords,
+ n::binary_uri_extension() = pbin_tar_extension + ".bz2",
n::builddir() = _imp->params.builddir(),
n::destination_repository() = this,
n::environment() = _imp->params.environment(),
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 0611a55..7b3f525 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -1232,6 +1232,7 @@ WriteBinaryEbuildCommand::operator() ()
+ params.package_id()->eapi()->exported_name())->supported()->ebuild_metadata_variables()->keywords()->name())
.setenv("PALUDIS_BINARY_DISTDIR_VARIABLE", EAPIData::get_instance()->eapi_from_string("pbin-1+"
+ params.package_id()->eapi()->exported_name())->supported()->ebuild_environment_variables()->env_distdir())
+ .setenv("PALUDIS_BINARY_URI_EXTENSION", params.binary_uri_extension())
.setenv("PALUDIS_EBUILD_MODULE_SUFFIXES",
params.package_id()->eapi()->supported()->ebuild_options()->ebuild_module_suffixes())
.setenv("PALUDIS_EBUILD_PHASE_VAR",
diff --git a/paludis/repositories/e/ebuild.hh b/paludis/repositories/e/ebuild.hh
index c3f7137..3a98f11 100644
--- a/paludis/repositories/e/ebuild.hh
+++ b/paludis/repositories/e/ebuild.hh
@@ -48,6 +48,7 @@ namespace paludis
typedef Name<struct binary_distdir_name> binary_distdir;
typedef Name<struct binary_ebuild_location_name> binary_ebuild_location;
typedef Name<struct binary_keywords_name> binary_keywords;
+ typedef Name<struct binary_uri_extension_name> binary_uri_extension;
typedef Name<struct builddir_name> builddir;
typedef Name<struct clearenv_name> clearenv;
typedef Name<struct commands_name> commands;
@@ -300,6 +301,7 @@ namespace paludis
NamedValue<n::binary_distdir, FSPath> binary_distdir;
NamedValue<n::binary_ebuild_location, FSPath> binary_ebuild_location;
NamedValue<n::binary_keywords, std::string> binary_keywords;
+ NamedValue<n::binary_uri_extension, std::string> binary_uri_extension;
NamedValue<n::builddir, FSPath> builddir;
NamedValue<n::destination_repository, const ERepository *> destination_repository;
NamedValue<n::environment, const Environment *> environment;
diff --git a/paludis/repositories/e/ebuild/write_binary_ebuild.bash b/paludis/repositories/e/ebuild/write_binary_ebuild.bash
index 9cc91d4..3188ee7 100755
--- a/paludis/repositories/e/ebuild/write_binary_ebuild.bash
+++ b/paludis/repositories/e/ebuild/write_binary_ebuild.bash
@@ -124,7 +124,7 @@ main()
make_binary_ebuild \
"${ebuildfile}" \
- "${PALUDIS_BINARY_URI_PREFIX}""$(basename ${bindistfile} ).tar.bz2" \
+ "${PALUDIS_BINARY_URI_PREFIX}""$(basename ${bindistfile} )${PALUDIS_BINARY_URI_EXTENSION:-.tar.bz2}" \
"${PALUDIS_BINARY_KEYWORDS}"
ebuild_section "Finished writing binary"
diff --git a/paludis/tar_extras.cc b/paludis/tar_extras.cc
index 82403cb..8ec734f 100644
--- a/paludis/tar_extras.cc
+++ b/paludis/tar_extras.cc
@@ -25,6 +25,8 @@
#include <archive.h>
#include <archive_entry.h>
+#include "config.h"
+
using namespace paludis;
struct PaludisTarExtras
@@ -47,7 +49,11 @@ paludis_tar_extras_init(const std::string & f, const std::string & compress)
else
archive_write_set_compression_none(extras->archive);
+#ifdef LIBARCHIVE_DOES_GNUTAR
archive_write_set_format_gnutar(extras->archive);
+#else
+ archive_write_set_format_pax(extras->archive);
+#endif
if (ARCHIVE_OK != archive_write_open_filename(extras->archive, f.c_str()))
throw MergerError("archive_write_open_filename failed");