libarchive 3.4.0 is required for Ubuntu 20.04 LTS.
Include ifdefs for when the library is not included.
[libarchive=$enableval], [libarchive=auto])
if test "x${libarchive}" != "xno"; then
[libarchive=$enableval], [libarchive=auto])
if test "x${libarchive}" != "xno"; then
- PKG_CHECK_MODULES(ARCHIVE, libarchive >= 3.4.3,
+ PKG_CHECK_MODULES(ARCHIVE, libarchive >= 3.4.0,
[
HAVE_ARCHIVE=yes
AC_DEFINE(HAVE_ARCHIVE, 1, [define to enable archive support])
[
HAVE_ARCHIVE=yes
AC_DEFINE(HAVE_ARCHIVE, 1, [define to enable archive support])
if (fd->format_class == FORMAT_CLASS_ARCHIVE)
{
dest_dir = open_archive(layout_image_get_fd(lw));
if (fd->format_class == FORMAT_CLASS_ARCHIVE)
{
dest_dir = open_archive(layout_image_get_fd(lw));
- lw_new = layout_new_from_default();
- layout_set_path(lw_new, dest_dir);
- g_free(dest_dir);
+ if (dest_dir)
+ {
+ lw_new = layout_new_from_default();
+ layout_set_path(lw_new, dest_dir);
+ g_free(dest_dir);
+ }
+ else
+ {
+ warning_dialog(_("Cannot open archive file"), _("See the Log Window"), GTK_STOCK_DIALOG_WARNING, NULL);
+ }
#include "misc.h"
#include "ui_fileops.h"
#include "misc.h"
#include "ui_fileops.h"
-#include <archive.h>
-#include <archive_entry.h>
#include <langinfo.h>
#include <locale.h>
#include <langinfo.h>
#include <locale.h>
/* Copied from the libarchive .repo. examples */
/* Copied from the libarchive .repo. examples */
+#ifndef HAVE_ARCHIVE
+gchar *open_archive(FileData *fd)
+{
+ return NULL;
+}
+
+#else
+
+#include <archive.h>
+#include <archive_entry.h>
+
static void errmsg(const char *);
static gboolean extract(const char *filename, int do_extract, int flags);
static int copy_data(struct archive *, struct archive *);
static void errmsg(const char *);
static gboolean extract(const char *filename, int do_extract, int flags);
static int copy_data(struct archive *, struct archive *);
-static int
-copy_data(struct archive *ar, struct archive *aw)
+static int copy_data(struct archive *ar, struct archive *aw)
{
int r;
const void *buff;
{
int r;
const void *buff;
}
log_printf("%s \n", m);
}
}
log_printf("%s \n", m);
}
/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */