]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Change compiling conditions for support for HFS+ Compression
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Thu, 1 Nov 2012 20:29:20 +0000 (05:29 +0900)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Thu, 1 Nov 2012 20:29:20 +0000 (05:29 +0900)
since it is only for MacOS X.

libarchive/archive_write_disk_posix.c

index 8cb27f5e70dae7332e04324189d589dd96428d7b..c29df5e4ffcff31d88152b0013253ca8b7a7af7c 100644 (file)
@@ -548,7 +548,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry)
                else
                        a->todo |= TODO_MAC_METADATA;
        }
-#if defined(HAVE_ZLIB_H) && defined(UF_COMPRESSED)
+#if defined(__APPLE__) && defined(UF_COMPRESSED)
        if ((a->flags & ARCHIVE_EXTRACT_NO_HFS_COMPRESSION) == 0) {
                unsigned long set, clear;
                archive_entry_fflags(a->entry, &set, &clear);
@@ -562,11 +562,9 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry)
                a->todo |= TODO_HFS_COMPRESSION;
                a->decmpfs_block_count = (unsigned)-1;
        }
-#ifdef __APPLE__
        /* Do not compress "._XXX" files. */
        if (a->name[0] == '.' && a->name[1] == '_')
                a->todo &= ~TODO_HFS_COMPRESSION;
-#endif
 #endif
 
        if (a->flags & ARCHIVE_EXTRACT_XATTR)
@@ -585,7 +583,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry)
 
        ret = restore_entry(a);
 
-#if defined(HAVE_ZLIB_H) && defined(UF_COMPRESSED)
+#if defined(__APPLE__) && defined(UF_COMPRESSED)
        /*
         * Check if the filesystem the file is restoring on supports
         * HFS+ Compression. If not, cancel HFS+ Compression.
@@ -821,7 +819,7 @@ write_data_block(struct archive_write_disk *a, const char *buff, size_t size)
        return (start_size - size);
 }
 
-#if defined(HAVE_ZLIB_H) && defined(UF_COMPRESSED)
+#if defined(__APPLE__) && defined(UF_COMPRESSED)
 
 /*
  * Set UF_COMPRESSED file flag.
@@ -1427,7 +1425,7 @@ _archive_write_disk_finish_entry(struct archive *_a)
        } else if (a->fd_offset == a->filesize) {
                /* Last write ended at exactly the filesize; we're done. */
                /* Hopefully, this is the common case. */
-#if defined(HAVE_ZLIB_H) && defined(UF_COMPRESSED)
+#if defined(__APPLE__) && defined(UF_COMPRESSED)
        } else if (a->todo & TODO_HFS_COMPRESSION) {
                char null_d[1024];
                ssize_t r;