On Thu, Sep 05, 2024 at 05:47:14AM +0200, Johannes Schauer Marin Rodrigues 
wrote:
> it does not. Helmut discovered that my last patch breaks --without-libarchive.
> If e2fsprogs builds fine even without archive.h present, then its existence 
> can
> no longer be used to also carry the meaning of whether to disable libarchive
> support or not. Hence, my updated patch introduces a new config definition
> called CONFIG_DISABLE_LIBARCHIVE which is set if --without-libarchive is
> passed. In the other cases, the presence of archive.h will be used to 
> determine
> whether to include the real header or use the hard-coded forward declarations.

Your patch didn't quite work correctly; if archive.h is not present,
the build will not fail; but it won't atually try to use dlopen() to
access the libarchive.so dynamic library if it happens to be present.

That does't really matter in the bootstraping case, but it *does* mean
that if the goal is to get a fully-functional e2fsprogs package, you
will need to rebuild it after libarchive-dev has been created.  And if
this was considered sufficient, you wouldn't need this patch at all;
it would be sufficient to just have a <!nocheck> added to the
libarchive-dev depedency.

Speaking of which, this patch doesn't doesn't have the change to
debian/control to add <!nocheck>.

I believe this if your patch is supplemented with these two changes,
it should do the right thing.  Do you agree?

                                      - Ted


diff --git a/misc/create_inode_libarchive.c b/misc/create_inode_libarchive.c
index cd1839e6..a8d3fc2d 100644
--- a/misc/create_inode_libarchive.c
+++ b/misc/create_inode_libarchive.c
@@ -559,7 +559,7 @@ errcode_t __populate_fs_from_tar(ext2_filsys fs, ext2_ino_t 
root_ino,
                                 struct file_info *target,
                                 struct fs_ops_callbacks *fs_callbacks)
 {
-#ifndef HAVE_ARCHIVE_H
+#ifdef CONFIG_DISABLE_LIBARCHIVE
        com_err(__func__, 0,
                _("you need to compile e2fsprogs with libarchive to "
                  "be able to process tarballs"));


diff --git a/debian/control b/debian/control
index bc582cd8..2d1cfd88 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: e2fsprogs
 Section: admin
 Priority: required
 Maintainer: Theodore Y. Ts'o <ty...@mit.edu>
-Build-Depends: dpkg-dev (>= 1.22.5), gettext, texinfo, pkgconf, 
libarchive-dev, libfuse3-dev [linux-any kfreebsd-any] 
<!pkg.e2fsprogs.no-fuse2fs>, debhelper-compat (= 12), dh-exec, libblkid-dev, 
uuid-dev, m4, udev [linux-any], systemd [linux-any], systemd-dev [linux-any], 
cron [linux-any], dh-sequence-movetousr
+Build-Depends: dpkg-dev (>= 1.22.5), gettext, texinfo, pkgconf, libarchive-dev 
<!nocheck>, libfuse3-dev [linux-any kfreebsd-any] <!pkg.e2fsprogs.no-fuse2fs>, 
debhelper-compat (= 12), dh-exec, libblkid-dev, uuid-dev, m4, udev [linux-any], 
systemd [linux-any], systemd-dev [linux-any], cron [linux-any], 
dh-sequence-movetousr
 Rules-Requires-Root: no
 Standards-Version: 4.7.0
 Homepage: http://e2fsprogs.sourceforge.net

Reply via email to