From: Martin Matuska Date: Wed, 23 Oct 2024 16:45:23 +0000 (+0200) Subject: Revert "add `--mac-metadata` test for `--format zip` - see #2041 (#2045)" X-Git-Tag: v3.8.0~129 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=206df6192cba53772e96a2d75df2920ff58f5ef9;p=thirdparty%2Flibarchive.git Revert "add `--mac-metadata` test for `--format zip` - see #2041 (#2045)" This reverts commit ea56096020e2c6c764052adfab63e11fd745f9de. --- diff --git a/Makefile.am b/Makefile.am index e310b02be..c4537beab 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1126,7 +1126,6 @@ bsdtar_test_SOURCES= \ tar/test/test_format_newc.c \ tar/test/test_help.c \ tar/test/test_leading_slash.c \ - tar/test/test_mac_metadata_zip.c \ tar/test/test_missing_file.c \ tar/test/test_option_C_mtree.c \ tar/test/test_option_C_upper.c \ diff --git a/tar/test/CMakeLists.txt b/tar/test/CMakeLists.txt index cd0515303..8d0ba4ad3 100644 --- a/tar/test/CMakeLists.txt +++ b/tar/test/CMakeLists.txt @@ -29,7 +29,6 @@ IF(ENABLE_TAR AND ENABLE_TEST) test_format_newc.c test_help.c test_leading_slash.c - test_mac_metadata_zip.c test_missing_file.c test_option_C_upper.c test_option_C_mtree.c diff --git a/tar/test/test_mac_metadata_zip.c b/tar/test/test_mac_metadata_zip.c deleted file mode 100644 index cd972b904..000000000 --- a/tar/test/test_mac_metadata_zip.c +++ /dev/null @@ -1,79 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2024 Martin Matuska - * All rights reserved. - */ - -/* -Notes on reffile creation: - -- I chose an existing small text file on my machine that had extended attributes. -An easy way to generate one is to download a file from github in Google Chrome, -as mac will automatically set a "com.apple.metadata:kMDItemWhereFroms" xattr on the file. -It also would have worked to set an xattr manually using xattr -w [-rsx] attr_name attr_value file ... - -- to verify the names/values of xattrs, run: xattr -l filename - -- I then zipped the file using right-click > Compress in Finder -(Apple's officially recommended method for zip file creation) - -- I then uuencoded the zip file by running: uuencode version.txt.zip test_mac_metadata_zip.zip - -Zip created 12-31-2023 on a 2022 Mac Studio running macOS Ventura 13.6.3 (22G436) (Apple M1 Ultra - arm64) - -Contents: - Length Method Size Cmpr Date Time CRC-32 Name --------- ------ ------- ---- ---------- ----- -------- ---- - 15 Defl:N 17 -13% 09-21-2023 01:05 f542663d version.txt - 1038 Defl:N 668 36% 09-21-2023 01:05 85bdc448 __MACOSX/._version.txt --------- ------- --- ------- - 1053 685 35% 2 files - -For additional notes, see: https://github.com/libarchive/libarchive/issues/2041#issuecomment-1873018929 -*/ - -#include "test.h" - -DEFINE_TEST(test_mac_metadata_zip) -{ -#if !defined(__APPLE__) || !defined(UF_COMPRESSED) || !defined(HAVE_SYS_XATTR_H)\ - || !defined(HAVE_ZLIB_H) - skipping("MacOS-specific Mac Metadata test"); -#else - const char *reffile = "test_mac_metadata_zip.zip"; - - const char *testattr = "com.apple.metadata:kMDItemWhereFroms"; - void *readval_orig; - void *readval; - size_t size; - int r; - - extract_reference_file(reffile); - - /* Extract an archive to disk with mac metadata. */ - assertMakeDir("mac_metadata", 0755); - r = systemf("%s -x -C mac_metadata --mac-metadata -f %s >mac_metadata.out 2>mac_metadata.err", testprog, reffile); - assertEqualInt(r, 0); - assertFileSize("mac_metadata/version.txt", 15); - readval_orig = getXattr("mac_metadata/version.txt", testattr, &size); - assertEqualInt(size, 658); - - /* Re-Archive with --mac-metadata --format zip */ - assertMakeDir("mac_metadata/subdir", 0755); - r = systemf("%s --mac-metadata --format zip -cvf mac_metadata/subdir/archive.zip -C mac_metadata version.txt", testprog); - assertEqualInt(r, 0); - assertFileSize("mac_metadata/subdir/archive.zip", 1088); - - /* Re-Extract with --mac-metadata, assert that xattr was preserved */ - r = systemf("%s -x -C mac_metadata/subdir --mac-metadata -f mac_metadata/subdir/archive.zip >mac_metadata.out 2>mac_metadata.err", testprog); - assertEqualInt(r, 0); - assertFileSize("mac_metadata/subdir/version.txt", 15); - readval = getXattr("mac_metadata/subdir/version.txt", testattr, &size); - assertEqualInt(size, 658); - - /* Assert that it is identical to original */ - assertEqualMem(readval_orig, readval, size); - assertEqualFile("mac_metadata/version.txt", "mac_metadata/subdir/version.txt"); -#endif -} diff --git a/tar/test/test_mac_metadata_zip.zip.uu b/tar/test/test_mac_metadata_zip.zip.uu deleted file mode 100644 index f85c513c7..000000000 --- a/tar/test/test_mac_metadata_zip.zip.uu +++ /dev/null @@ -1,28 +0,0 @@ -begin 644 test_mac_metadata_zip.zip -M4$L#!!0`"``(`+@(-5<```````````\````+`"``=F5R'155`T` -M!RW/"V5/?9%E-L\+975X"P`!!/4!```$%````"M*SLG/2U4H,]0S,]$SX`(` -M4$L'"#UF0O41````#P```%!+`P04``@`"`"X"#57```````````.!```%@`@ -M`%]?34%#3U-8+RY?=F5R'155`T`!RW/"V5/?9%EA'V1975X"P`! -M!/4!```$%````(U336_3,!AVNTT,#<$0XD-HATJH@TM:QXG39%.$0K>I`PT0 -MG=C@4CG.VS8L7[/=L7'GRH&?P#_@PIE_P!_@R(DC!VY(.*1C8UQF*?;KQX^? -MO/;[&,W=N(#J"&TQWGC2;^PVIJW$T$7]$81FONI1SV=JOJ+4EW?40NG+"2QE/JK5( -M)_8>H>:I-5!,[VUMKFPK2G3$(V!!Y*C5_YJ?N;B%T_82_/V&"92K.`#E? -M%J!4_72W<:\ -MHU;0)!L$$PM[Q-3A1!HZ+664L;1TQUY+>R!@?P)23077=$']XSW;F&)J>R^G -M:^N'12Q`^A;&4Z0?CS*F)@)\DWB10R-*;4P<[H04L,U"EW8\SW-MR_*P->2T -M`Y@3'G'7=#V/>IR:MAE&Q*6G!2'J`8M`2'^B_:4I+':K_-=11`7YIP9BS4DA?7,Z5+JQ4`E@Z6*3'/JF<\,<4@B=Y!G^' -MRA"RK=BH?6"V'+N%T3Q:J-N5[^JUJ0%G_O5C/=EO8^R:JP[%(1^2:+4[U@\$ -M5M%O4$L'"$C$O86<`@``#@0``%!+`0(4`Q0`"``(`+@(-5<]9D+U$0````\` -M```+`"````````````"D@0````!V97)S:6]N+G1X=%54#0`'+<\+94]]D64V -MSPME=7@+``$$]0$```04````4$L!`A0#%``(``@`N`@U5TC$O86<`@``#@0` -M`!8`(````````````*2!:@```%]?34%#3U-8+RY?=F5R'155`T` -M!RW/"V5/?9%EA'V1975X"P`!!/4!```$%````%!+!08``````@`"`+T```!J -%`P`````` -` -end \ No newline at end of file