[gentoo-commits] repo/gentoo:master commit in: app-arch/tar/, app-arch/tar/files/
commit: fa9750b4c24e402475d4edaa1b2ef34f17d945c3 Author: Fabian Groffen gentoo org> AuthorDate: Wed Dec 23 08:11:21 2020 + Commit: Fabian Groffen gentoo org> CommitDate: Wed Dec 23 08:12:14 2020 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fa9750b4 app-arch/tar: add patch for macOS Big Sur 11.1 Bug: https://bugs.gentoo.org/761322 Package-Manager: Portage-3.0.9, Repoman-3.0.2 Signed-off-by: Fabian Groffen gentoo.org> ...tar-1.32-check-sys-ioctl-header-configure.patch | 53 ++ app-arch/tar/tar-1.32.90.ebuild| 4 ++ app-arch/tar/tar-1.32.ebuild | 3 ++ 3 files changed, 60 insertions(+) diff --git a/app-arch/tar/files/tar-1.32-check-sys-ioctl-header-configure.patch b/app-arch/tar/files/tar-1.32-check-sys-ioctl-header-configure.patch new file mode 100644 index 000..c8aee2fcce8 --- /dev/null +++ b/app-arch/tar/files/tar-1.32-check-sys-ioctl-header-configure.patch @@ -0,0 +1,53 @@ +[buildsys] macOS Big Sur 11.1 doesn't have sys/ioctl.h + +Author: Alexei Colin +Bug: https://bugs.gentoo.org/761322 +Bug: https://savannah.gnu.org/bugs/index.php?59755 + +--- a/configure2020-12-23 00:49:19.0 -0500 b/configure2020-12-23 00:49:52.0 -0500 +@@ -3422,6 +3422,7 @@ + as_fn_append ac_header_list " sys/device.h" + as_fn_append ac_header_list " sys/gentape.h" + as_fn_append ac_header_list " sys/inet.h" ++as_fn_append ac_header_list " sys/ioctl.h" + as_fn_append ac_header_list " sys/io/trioctl.h" + as_fn_append ac_header_list " sys/mtio.h" + as_fn_append ac_header_list " sys/time.h" +--- a/config.h.in 2019-02-23 07:56:20.0 -0500 b/config.h.in 2020-12-23 01:04:49.0 -0500 +@@ -1480,6 +1480,9 @@ + /* Define to 1 if you have the header file. */ + #undef HAVE_SYS_INTTYPES_H + ++/* Define to 1 if you have the header file. */ ++#undef HAVE_SYS_IOCTL_H ++ + /* Define to 1 if you have the header file. */ + #undef HAVE_SYS_IO_TRIOCTL_H + +--- a/lib/system-ioctl.h 2020-12-22 20:57:00.0 -0500 b/lib/system-ioctl.h 2020-12-22 20:57:35.0 -0500 +@@ -41,8 +41,10 @@ + # endif + # include + # else +-# if HAVE_SYS_MTIO_H ++# if HAVE_SYS_IOCTL_H + # include ++# endif ++# if HAVE_SYS_MTIO_H + # if HAVE_SGTTY_H + #include + # endif +--- a/src/checkpoint.c 2020-12-22 20:56:48.0 -0500 b/src/checkpoint.c 2020-12-22 20:58:29.0 -0500 +@@ -20,7 +20,7 @@ + #include + #include "common.h" + #include "wordsplit.h" +-#include ++#include + #include + #include "fprintftime.h" + #include diff --git a/app-arch/tar/tar-1.32.90.ebuild b/app-arch/tar/tar-1.32.90.ebuild index 87f3d927f1c..43686c3c26d 100644 --- a/app-arch/tar/tar-1.32.90.ebuild +++ b/app-arch/tar/tar-1.32.90.ebuild @@ -25,6 +25,10 @@ DEPEND="${RDEPEND} xattr? ( elibc_glibc? ( sys-apps/attr ) )" BDEPEND="nls? ( sys-devel/gettext )" +PATCHES=( + "${FILESDIR}"/${PN}-1.32-check-sys-ioctl-header-configure.patch +) + src_prepare() { default diff --git a/app-arch/tar/tar-1.32.ebuild b/app-arch/tar/tar-1.32.ebuild index 81267f7aa85..d1fd7864919 100644 --- a/app-arch/tar/tar-1.32.ebuild +++ b/app-arch/tar/tar-1.32.ebuild @@ -33,6 +33,9 @@ src_prepare() { scripts/{backup,dump-remind,restore}.in \ || die "sed non-GNU" fi + + [[ ${CHOST} == *darwin20* ]] && \ + eapply "${FILESDIR}"/${PN}-1.32-check-sys-ioctl-header-configure.patch } src_configure() {
[gentoo-commits] repo/gentoo:master commit in: app-arch/tar/, app-arch/tar/files/
commit: b361e7a6af7e5b907d2a7699c6c2a6592aa451c0 Author: Lars Wendler gentoo org> AuthorDate: Sat Feb 23 19:11:49 2019 + Commit: Lars Wendler gentoo org> CommitDate: Sat Feb 23 19:15:14 2019 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b361e7a6 app-arch/tar: Removed old. Package-Manager: Portage-2.3.62, Repoman-2.3.12 Signed-off-by: Lars Wendler gentoo.org> app-arch/tar/files/tar-1.30-CVE-2018-20482.patch | 146 --- app-arch/tar/tar-1.30-r1.ebuild | 82 - 2 files changed, 228 deletions(-) diff --git a/app-arch/tar/files/tar-1.30-CVE-2018-20482.patch b/app-arch/tar/files/tar-1.30-CVE-2018-20482.patch deleted file mode 100644 index 8abab5df6c0..000 --- a/app-arch/tar/files/tar-1.30-CVE-2018-20482.patch +++ /dev/null @@ -1,146 +0,0 @@ -From c15c42ccd1e2377945fd0414eca1a49294bff454 Mon Sep 17 00:00:00 2001 -From: Sergey Poznyakoff -Date: Thu, 27 Dec 2018 17:48:57 +0200 -Subject: Fix CVE-2018-20482 - -* src/sparse.c (sparse_dump_region): Handle short read condition. -(sparse_extract_region,check_data_region): Fix dumped_size calculation. -Handle short read condition. -(pax_decode_header): Fix dumped_size calculation. - -diff --git a/src/sparse.c b/src/sparse.c -index d41c0ea..f611200 100644 a/src/sparse.c -+++ b/src/sparse.c -@@ -1,6 +1,6 @@ - /* Functions for dealing with sparse files - -- Copyright 2003-2007, 2010, 2013-2017 Free Software Foundation, Inc. -+ Copyright 2003-2007, 2010, 2013-2018 Free Software Foundation, Inc. - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -@@ -427,6 +427,30 @@ sparse_dump_region (struct tar_sparse_file *file, size_t i) -bufsize); - return false; - } -+ else if (bytes_read == 0) -+ { -+char buf[UINTMAX_STRSIZE_BOUND]; -+struct stat st; -+size_t n; -+if (fstat (file->fd, ) == 0) -+ n = file->stat_info->stat.st_size - st.st_size; -+else -+ n = file->stat_info->stat.st_size -+- (file->stat_info->sparse_map[i].offset -+ + file->stat_info->sparse_map[i].numbytes -+ - bytes_left); -+ -+WARNOPT (WARN_FILE_SHRANK, -+ (0, 0, -+ ngettext ("%s: File shrank by %s byte; padding with zeros", -+"%s: File shrank by %s bytes; padding with zeros", -+n), -+ quotearg_colon (file->stat_info->orig_file_name), -+ STRINGIFY_BIGINT (n, buf))); -+if (! ignore_failed_read_option) -+ set_exit_status (TAREXIT_DIFFERS); -+return false; -+ } - - memset (blk->buffer + bytes_read, 0, BLOCKSIZE - bytes_read); - bytes_left -= bytes_read; -@@ -464,9 +488,9 @@ sparse_extract_region (struct tar_sparse_file *file, size_t i) - return false; - } - set_next_block_after (blk); -+ file->dumped_size += BLOCKSIZE; - count = blocking_write (file->fd, blk->buffer, wrbytes); - write_size -= count; -- file->dumped_size += count; - mv_size_left (file->stat_info->archive_file_size - file->dumped_size); - file->offset += count; - if (count != wrbytes) -@@ -598,6 +622,12 @@ check_sparse_region (struct tar_sparse_file *file, off_t beg, off_t end) -rdsize); - return false; - } -+ else if (bytes_read == 0) -+ { -+report_difference (file->stat_info, _("Size differs")); -+return false; -+ } -+ - if (!zero_block_p (diff_buffer, bytes_read)) - { - char begbuf[INT_BUFSIZE_BOUND (off_t)]; -@@ -609,6 +639,7 @@ check_sparse_region (struct tar_sparse_file *file, off_t beg, off_t end) - - beg += bytes_read; - } -+ - return true; - } - -@@ -635,6 +666,7 @@ check_data_region (struct tar_sparse_file *file, size_t i) - return false; - } - set_next_block_after (blk); -+ file->dumped_size += BLOCKSIZE; - bytes_read = safe_read (file->fd, diff_buffer, rdsize); - if (bytes_read == SAFE_READ_ERROR) - { -@@ -645,7 +677,11 @@ check_data_region (struct tar_sparse_file *file, size_t i) -rdsize); - return false; - } -- file->dumped_size += bytes_read; -+ else if (bytes_read == 0) -+ { -+report_difference (_stat_info, _("Size differs")); -+return false; -+ } - size_left -= bytes_read; - mv_size_left (file->stat_info->archive_file_size - file->dumped_size); - if (memcmp (blk->buffer, diff_buffer, rdsize)) -@@ -1213,7 +1249,8 @@ pax_decode_header (struct tar_sparse_file *file) - union block *blk; - char *p; - size_t i; -- -+ off_t start; -+ - #define
[gentoo-commits] repo/gentoo:master commit in: app-arch/tar/, app-arch/tar/files/
commit: ef8f8b69456c968e4d7a467fa708419f55891f0b Author: Thomas Deutschmann gentoo org> AuthorDate: Fri Jan 11 01:34:21 2019 + Commit: Thomas Deutschmann gentoo org> CommitDate: Fri Jan 11 01:34:21 2019 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ef8f8b69 app-arch/tar: remove misplaced call to abort() Closes: https://bugs.gentoo.org/675140 Package-Manager: Portage-2.3.54, Repoman-2.3.12 Signed-off-by: Thomas Deutschmann gentoo.org> .../tar-1.31-remove-erroneous-abort-call.patch | 33 ++ .../tar/{tar-1.31.ebuild => tar-1.31-r1.ebuild}| 2 ++ 2 files changed, 35 insertions(+) diff --git a/app-arch/tar/files/tar-1.31-remove-erroneous-abort-call.patch b/app-arch/tar/files/tar-1.31-remove-erroneous-abort-call.patch new file mode 100644 index 000..9e255df5760 --- /dev/null +++ b/app-arch/tar/files/tar-1.31-remove-erroneous-abort-call.patch @@ -0,0 +1,33 @@ +From 85c005ee1345c342f707f3c55317daf6cb050603 Mon Sep 17 00:00:00 2001 +From: Sergey Poznyakoff +Date: Thu, 10 Jan 2019 18:18:49 +0200 +Subject: Remove erroneous abort() call + +The call was introduced by commit ccef8581. It caused tar to abort +on perfectly normal operations, like untarring archives containing +./ with the -U option, + +See http://lists.gnu.org/archive/html/bug-tar/2019-01/msg00019.html +for details. + +* src/extract.c (maybe_recoverable): Remove misplaced call to abort(). +--- + src/extract.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/extract.c b/src/extract.c +index 090b866..8276f8f 100644 +--- a/src/extract.c b/src/extract.c +@@ -787,7 +787,7 @@ maybe_recoverable (char *file_name, bool regular, bool *interdir_made) + case UNLINK_FIRST_OLD_FILES: + break; + } +- abort (); /* notreached */ ++ FALLTHROUGH; + + case ENOENT: + /* Attempt creating missing intermediate directories. */ +-- +cgit v1.0-41-gc330 + diff --git a/app-arch/tar/tar-1.31.ebuild b/app-arch/tar/tar-1.31-r1.ebuild similarity index 97% rename from app-arch/tar/tar-1.31.ebuild rename to app-arch/tar/tar-1.31-r1.ebuild index 2e7d5290465..6a36e7eb01e 100644 --- a/app-arch/tar/tar-1.31.ebuild +++ b/app-arch/tar/tar-1.31-r1.ebuild @@ -24,6 +24,8 @@ DEPEND="${RDEPEND} static? ( ${LIB_DEPEND} ) xattr? ( elibc_glibc? ( sys-apps/attr ) )" +PATCHES=( "${FILESDIR}"/${P}-remove-erroneous-abort-call.patch ) + src_prepare() { default
[gentoo-commits] repo/gentoo:master commit in: app-arch/tar/, app-arch/tar/files/
commit: a3a8c469b2bb96d3ee3a4fa99bb5b30aa38c7589 Author: Lars Wendler gentoo org> AuthorDate: Tue Jan 1 14:36:33 2019 + Commit: Lars Wendler gentoo org> CommitDate: Tue Jan 1 14:38:01 2019 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a3a8c469 app-arch/tar: Revbump to fix CVE-2018-20482 Patch added without new test suite because that would require an eautoreconf run. Bug: https://bugs.gentoo.org/674210 Package-Manager: Portage-2.3.53, Repoman-2.3.12 Signed-off-by: Lars Wendler gentoo.org> app-arch/tar/files/tar-1.30-CVE-2018-20482.patch | 146 +++ app-arch/tar/tar-1.30-r1.ebuild | 82 + 2 files changed, 228 insertions(+) diff --git a/app-arch/tar/files/tar-1.30-CVE-2018-20482.patch b/app-arch/tar/files/tar-1.30-CVE-2018-20482.patch new file mode 100644 index 000..8abab5df6c0 --- /dev/null +++ b/app-arch/tar/files/tar-1.30-CVE-2018-20482.patch @@ -0,0 +1,146 @@ +From c15c42ccd1e2377945fd0414eca1a49294bff454 Mon Sep 17 00:00:00 2001 +From: Sergey Poznyakoff +Date: Thu, 27 Dec 2018 17:48:57 +0200 +Subject: Fix CVE-2018-20482 + +* src/sparse.c (sparse_dump_region): Handle short read condition. +(sparse_extract_region,check_data_region): Fix dumped_size calculation. +Handle short read condition. +(pax_decode_header): Fix dumped_size calculation. + +diff --git a/src/sparse.c b/src/sparse.c +index d41c0ea..f611200 100644 +--- a/src/sparse.c b/src/sparse.c +@@ -1,6 +1,6 @@ + /* Functions for dealing with sparse files + +- Copyright 2003-2007, 2010, 2013-2017 Free Software Foundation, Inc. ++ Copyright 2003-2007, 2010, 2013-2018 Free Software Foundation, Inc. + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +@@ -427,6 +427,30 @@ sparse_dump_region (struct tar_sparse_file *file, size_t i) +bufsize); + return false; + } ++ else if (bytes_read == 0) ++ { ++char buf[UINTMAX_STRSIZE_BOUND]; ++struct stat st; ++size_t n; ++if (fstat (file->fd, ) == 0) ++ n = file->stat_info->stat.st_size - st.st_size; ++else ++ n = file->stat_info->stat.st_size ++- (file->stat_info->sparse_map[i].offset ++ + file->stat_info->sparse_map[i].numbytes ++ - bytes_left); ++ ++WARNOPT (WARN_FILE_SHRANK, ++ (0, 0, ++ ngettext ("%s: File shrank by %s byte; padding with zeros", ++"%s: File shrank by %s bytes; padding with zeros", ++n), ++ quotearg_colon (file->stat_info->orig_file_name), ++ STRINGIFY_BIGINT (n, buf))); ++if (! ignore_failed_read_option) ++ set_exit_status (TAREXIT_DIFFERS); ++return false; ++ } + + memset (blk->buffer + bytes_read, 0, BLOCKSIZE - bytes_read); + bytes_left -= bytes_read; +@@ -464,9 +488,9 @@ sparse_extract_region (struct tar_sparse_file *file, size_t i) + return false; + } + set_next_block_after (blk); ++ file->dumped_size += BLOCKSIZE; + count = blocking_write (file->fd, blk->buffer, wrbytes); + write_size -= count; +- file->dumped_size += count; + mv_size_left (file->stat_info->archive_file_size - file->dumped_size); + file->offset += count; + if (count != wrbytes) +@@ -598,6 +622,12 @@ check_sparse_region (struct tar_sparse_file *file, off_t beg, off_t end) +rdsize); + return false; + } ++ else if (bytes_read == 0) ++ { ++report_difference (file->stat_info, _("Size differs")); ++return false; ++ } ++ + if (!zero_block_p (diff_buffer, bytes_read)) + { + char begbuf[INT_BUFSIZE_BOUND (off_t)]; +@@ -609,6 +639,7 @@ check_sparse_region (struct tar_sparse_file *file, off_t beg, off_t end) + + beg += bytes_read; + } ++ + return true; + } + +@@ -635,6 +666,7 @@ check_data_region (struct tar_sparse_file *file, size_t i) + return false; + } + set_next_block_after (blk); ++ file->dumped_size += BLOCKSIZE; + bytes_read = safe_read (file->fd, diff_buffer, rdsize); + if (bytes_read == SAFE_READ_ERROR) + { +@@ -645,7 +677,11 @@ check_data_region (struct tar_sparse_file *file, size_t i) +rdsize); + return false; + } +- file->dumped_size += bytes_read; ++ else if (bytes_read == 0) ++ { ++report_difference (_stat_info, _("Size differs")); ++return false; ++ } + size_left -= bytes_read; + mv_size_left (file->stat_info->archive_file_size - file->dumped_size); + if (memcmp (blk->buffer, diff_buffer, rdsize)) +@@ -1213,7 +1249,8 @@ pax_decode_header (struct
[gentoo-commits] repo/gentoo:master commit in: app-arch/tar/, app-arch/tar/files/
commit: e13b5d814ae6368708c659ae6ff578a51e479ca4 Author: Thomas Deutschmann gentoo org> AuthorDate: Tue Jun 19 12:27:22 2018 + Commit: Thomas Deutschmann gentoo org> CommitDate: Tue Jun 19 12:27:37 2018 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e13b5d81 app-arch/tar: fix race in dirrem01 and dirrem02 test Package-Manager: Portage-2.3.40, Repoman-2.3.9 .../tar/files/tar-1.30-fix-test-117-and-118.patch | 89 ++ app-arch/tar/tar-1.30.ebuild | 5 +- 2 files changed, 93 insertions(+), 1 deletion(-) diff --git a/app-arch/tar/files/tar-1.30-fix-test-117-and-118.patch b/app-arch/tar/files/tar-1.30-fix-test-117-and-118.patch new file mode 100644 index 000..2f75da6cd24 --- /dev/null +++ b/app-arch/tar/files/tar-1.30-fix-test-117-and-118.patch @@ -0,0 +1,89 @@ +tests: fix race in dirrem01 and dirrem02 + +Previously the '--checkpoint-action=echo' was triggered after +'--checkpoint-action=sleep=1' - so the order of events *usually* +was (for --format='gnu'): + + ... + 1. checkpoint handler before write of 'dir/sub' member + 2. one-second delay + 3. stderr write: 'tar: Write checkpoint 3' + 4. write the member 'dir/sub' into the archive + 5. check that the member's ctime has not been changed + 6. genfile's detecting 'Write checkpoint', doing unlink + ... + +But sometimes, the genfile was fast enough to win the race and +unlinked the directory before the member was written into the +archive (IOW, the order was 1-2-3-6-4-5). This led to the +occasional warning 'tar: dir/sub: file changed as we read it'. + +Swap the order of 'sleep=1' and 'echo' actions so the genfile +utility has (hopefully) enough time to do the unlink before +writing the file into the archive (enforce 1-2-3-6-4-5 order). + +* tests/dirrem01.at: Swap 'sleep=1' and 'echo' actions. +* tests/dirrem02.at: Likewise. + +Origin: https://lists.gnu.org/archive/html/bug-tar/2018-01/msg0.html +--- + tests/dirrem01.at | 5 +++-- + tests/dirrem02.at | 7 --- + 2 files changed, 7 insertions(+), 5 deletions(-) + +diff --git a/tests/dirrem01.at b/tests/dirrem01.at +index 40344dc..dabc206 100644 +--- a/tests/dirrem01.at b/tests/dirrem01.at +@@ -47,14 +47,15 @@ gnu) CPT=3;; + esac + + genfile --run --checkpoint=$CPT --unlink dir/sub/file2 --unlink dir/sub -- \ +- tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='sleep=1' \ +- --checkpoint-action='echo' -c -f archive.tar \ ++ tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='echo' \ ++ --checkpoint-action='sleep=1' -c -f archive.tar \ +--listed-incremental db -v dir >/dev/null + ], + [1], + [ignore], + [tar: dir: Directory is new + tar: dir/sub: Directory is new ++tar: dir/sub: file changed as we read it + tar: dir/sub: File removed before we read it + ],[],[],[gnu,posix]) + +diff --git a/tests/dirrem02.at b/tests/dirrem02.at +index e1cf9ef..924454f 100644 +--- a/tests/dirrem02.at b/tests/dirrem02.at +@@ -20,7 +20,7 @@ + + # Description: + # +-# When an explicitley named directory disappears during creation ++# When an explicitly named directory disappears during creation + # of incremental dump, tar should still exit with TAREXIT_FAILURE (2). + # + # For further details see dirrem01.at +@@ -44,14 +44,15 @@ gnu) CPT=3;; + esac + + genfile --run --checkpoint=$CPT --unlink dir/sub/file2 --unlink dir/sub -- \ +- tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='sleep=1' \ +- --checkpoint-action='echo' -c -f archive.tar \ ++ tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='echo' \ ++ --checkpoint-action='sleep=1' -c -f archive.tar \ +--listed-incremental db -v dir dir/sub >/dev/null + ], + [2], + [ignore], + [tar: dir: Directory is new + tar: dir/sub: Directory is new ++tar: dir/sub: file changed as we read it + tar: dir/sub: Cannot open: No such file or directory + tar: Exiting with failure status due to previous errors + ],[],[],[gnu,posix]) +-- +cgit v1.0-41-gc330 + diff --git a/app-arch/tar/tar-1.30.ebuild b/app-arch/tar/tar-1.30.ebuild index bf37c56a075..d777e30c76c 100644 --- a/app-arch/tar/tar-1.30.ebuild +++ b/app-arch/tar/tar-1.30.ebuild @@ -21,7 +21,10 @@ DEPEND="${RDEPEND} nls? ( >=sys-devel/gettext-0.10.35 ) xattr? ( elibc_glibc? ( sys-apps/attr ) )" -PATCHES=( "${FILESDIR}"/${P}-fix-test-92.patch ) +PATCHES=( + "${FILESDIR}"/${P}-fix-test-92.patch + "${FILESDIR}"/${P}-fix-test-117-and-118.patch +) src_prepare() { default
[gentoo-commits] repo/gentoo:master commit in: app-arch/tar/, app-arch/tar/files/
commit: 0be4e2ac7ec0906aff61da2a1a749ebd17db746c Author: Mike Frysinger gentoo org> AuthorDate: Tue Jan 17 20:42:44 2017 + Commit: Mike Frysinger gentoo org> CommitDate: Tue Jan 17 20:42:44 2017 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0be4e2ac app-arch/tar: pull in upstream fix for --add-file behvaior app-arch/tar/files/tar-1.29-add-files.patch | 194 app-arch/tar/tar-1.29-r3.ebuild | 81 2 files changed, 275 insertions(+) diff --git a/app-arch/tar/files/tar-1.29-add-files.patch b/app-arch/tar/files/tar-1.29-add-files.patch new file mode 100644 index ..8ab15ac --- /dev/null +++ b/app-arch/tar/files/tar-1.29-add-files.patch @@ -0,0 +1,194 @@ +From 3a283cfe9f8f1f127e8dc5597a5ea1d249985a54 Mon Sep 17 00:00:00 2001 +From: Sergey Poznyakoff+Date: Sat, 12 Nov 2016 11:20:47 +0200 +Subject: [PATCH] Fix the --add-file option. + +* src/common.h (name_more_files): New proto. +(files_from_option): Remove. +* src/names.c (name_more_files): New file. +(names_options): Fix declaration of the +add-file option. +(names_parse_opt): Handle --add-file. +* src/tar.c (struct tar_args): Remove the input_files member. +Change all uses: use name_more_files() instead. +* tests/Makefile.am: Add new test. +* tests/add-file.at: New testcase. +* tests/testsuite.at: Add new test. +--- + src/common.h | 4 +--- + src/names.c| 24 --- + src/tar.c | 16 - + tests/Makefile.am | 3 ++- + tests/add-file.at | 67 ++ + tests/testsuite.at | 1 + + 6 files changed, 92 insertions(+), 23 deletions(-) + create mode 100644 tests/add-file.at + +diff --git a/src/common.h b/src/common.h +index 50c34cc7c09b..6fdb6225f18b 100644 +--- a/src/common.h b/src/common.h +@@ -414,9 +414,6 @@ GLOBAL bool show_transformed_names_option; +timestamps from archives with an unusual member order. It is automatically +set for incremental archives. */ + GLOBAL bool delay_directory_restore_option; +- +-/* When set, tar will not refuse to create empty archives */ +-GLOBAL bool files_from_option; + + /* Declarations for each module. */ + +@@ -738,6 +735,7 @@ void uid_to_uname (uid_t uid, char **uname); + int uname_to_uid (char const *uname, uid_t *puid); + + void name_init (void); ++bool name_more_files (void); + void name_add_name (const char *name); + void name_term (void); + const char *name_next (int change_dirs); +diff --git a/src/names.c b/src/names.c +index 219aa77a4356..1a9465667cd3 100644 +--- a/src/names.c b/src/names.c +@@ -32,7 +32,8 @@ static void name_add_file (const char *name); + + enum + { +-EXCLUDE_BACKUPS_OPTION = 256, ++ADD_FILE_OPTION = 256, ++EXCLUDE_BACKUPS_OPTION, + EXCLUDE_CACHES_OPTION, + EXCLUDE_CACHES_UNDER_OPTION, + EXCLUDE_CACHES_ALL_OPTION, +@@ -67,7 +68,7 @@ static struct argp_option names_options[] = { + {NULL, 0, NULL, 0, +N_("Local file name selection:"), GRID }, + +- {"add-file", ARGP_KEY_ARG, N_("FILE"), 0, ++ {"add-file", ADD_FILE_OPTION, N_("FILE"), 0, +N_("add given FILE to the archive (useful if its name starts with a dash)"), GRID+1 }, + {"directory", 'C', N_("DIR"), 0, +N_("change to directory DIR"), GRID+1 }, +@@ -190,10 +191,10 @@ names_parse_opt (int key, char *arg, struct argp_state *state) + + case 'T': + name_add_file (arg); +- /* Indicate we've been given -T option. This is for backward +- compatibility only, so that `tar cfT archive /dev/null will +- succeed */ +- files_from_option = true; ++ break; ++ ++case ADD_FILE_OPTION: ++ name_add_name (arg); + break; + + default: +@@ -651,8 +652,8 @@ struct name_elt/* A name_array element. */ + } v; + }; + +-static struct name_elt *name_head; /* store a list of names */ +-size_t name_count;/* how many of the entries are names? */ ++static struct name_elt *name_head;/* store a list of names */ ++size_t name_count; /* how many of the entries are file names? */ + + static struct name_elt * + name_elt_alloc (void) +@@ -784,6 +785,12 @@ name_list_advance (void) + } + } + ++/* Return true if there are names or options in the list */ ++bool ++name_more_files (void) ++{ ++ return name_count > 0; ++} + + /* Add to name_array the file NAME with fnmatch options MATFLAGS */ + void +@@ -823,6 +830,7 @@ name_add_file (const char *name) + ep->v.file.name = name; + ep->v.file.line = 0; + ep->v.file.fp = NULL; ++ name_count++; + } + + /* Names from external name file. */ +diff --git a/src/tar.c b/src/tar.c +index 35bac38c2793..a361fc2c607f 100644 +--- a/src/tar.c b/src/tar.c +@@ -813,7 +813,6 @@ struct tar_args/* Variables used during option parsing */ + bool pax_option; /* True if --pax-option was given */ + char const *backup_suffix_string; /*
[gentoo-commits] repo/gentoo:master commit in: app-arch/tar/, app-arch/tar/files/
commit: 204a2aaac4657909edb11d2ebd3837707e9b9485 Author: Lars Wendler gentoo org> AuthorDate: Thu Dec 22 22:56:53 2016 + Commit: Lars Wendler gentoo org> CommitDate: Thu Dec 22 22:57:07 2016 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=204a2aaa app-arch/tar: Removed old. Package-Manager: Portage-2.3.3, Repoman-2.3.1 app-arch/tar/Manifest | 2 - .../files/tar-1.27.1-recursion_norecursion.patch | 25 -- .../tar/files/tar-1.27.1-xattr_build_fix.patch | 196 --- app-arch/tar/files/tar-1.28-concat-listed.patch| 117 --- app-arch/tar/files/tar-1.28-xattr.patch| 36 -- app-arch/tar/files/tar.1-1.27 | 388 - app-arch/tar/tar-1.27.1-r2.ebuild | 79 - app-arch/tar/tar-1.28-r1.ebuild| 76 app-arch/tar/tar-1.29.ebuild | 74 9 files changed, 993 deletions(-) diff --git a/app-arch/tar/Manifest b/app-arch/tar/Manifest index b9d5d4d..e16fce7 100644 --- a/app-arch/tar/Manifest +++ b/app-arch/tar/Manifest @@ -1,3 +1 @@ -DIST tar-1.27.1.tar.bz2 2573070 SHA256 9b0fb3ce8512059337add0da5f8f0f7d7647f2201f5ece24581d620ea60337c6 SHA512 f14a0a58e574db3aeec0914621aff2f0518b8d8acce81106b8219b36b3fed47349d6cb802c51a836a5e6889529337434d83b3c50cd7fc1801b9b3944eecc695b WHIRLPOOL fd44ee747f44febc9dd4b0e1a532c38a835fcb55967143a1ab29b29dfc27316de76dfa1d23438f1843bb0a7962eb0b59c3ec75041cc0fbe879b02af292ebc6e9 -DIST tar-1.28.tar.bz2 2693989 SHA256 60e4bfe0602fef34cd908d91cf638e17eeb09394d7b98c2487217dc4d3147562 SHA512 4f66a236a2d9185114e2b358a09f3d38c3c38e984e5fca4bedc4d7eb461bdaace6a7a9fc62aafb70428b1f3dc617fb0d0553558fb29cad33f0cb53ba081521c4 WHIRLPOOL 54ad7b73e973d436cff853fda267d21ab22139f53d18f6870c7a53cf74e53ec8735022b6d3c503504ee416f1b9f9d43ca1af60d2fedb5d852766cb8dd2ac72d0 DIST tar-1.29.tar.bz2 2715993 SHA256 236b11190c0a3a6885bdb8d61424f2b36a5872869aa3f7f695dea4b4843ae2f2 SHA512 d2cea9892892dfa0c8efd390303b75dccc085c4895e07ced684074592d69729916d6ea12475aa6aff873d076a729bb7dc2499c233edcfb9c7e8e8995481eef3b WHIRLPOOL fa5f66a7bb7698c35ad842bc4900a62997da5eb2f3cd6154391b88505a581078a64a8399bb5976d4723d90951d34c084e00d17908d90792bb5139184e8b92a94 diff --git a/app-arch/tar/files/tar-1.27.1-recursion_norecursion.patch b/app-arch/tar/files/tar-1.27.1-recursion_norecursion.patch deleted file mode 100644 index 47973c3.. --- a/app-arch/tar/files/tar-1.27.1-recursion_norecursion.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 2bd9c15391b0bd6ef0bff76aebf09cfb53003199 Mon Sep 17 00:00:00 2001 -From: Sergey Poznyakoff-Date: Thu, 09 Jan 2014 22:13:15 + -Subject: Fix the use of --no-recursion and --recursion options. - -Each option remains in effect until cancelled by the next ocurrence -of its counterpart, as stated in the documentation. - -* src/names.c (name_next_elt): Restore recursion_option from the -value of matching_flags. -diff --git a/src/names.c b/src/names.c -index fc9841e..dc1 100644 a/src/names.c -+++ b/src/names.c -@@ -570,6 +570,7 @@ name_next_elt (int change_dirs) - - case NELT_FMASK: - matching_flags = ep->v.matching_flags; -+recursion_option = matching_flags & FNM_LEADING_DIR; - name_list_advance (); - continue; - --- -cgit v0.9.0.2 diff --git a/app-arch/tar/files/tar-1.27.1-xattr_build_fix.patch b/app-arch/tar/files/tar-1.27.1-xattr_build_fix.patch deleted file mode 100644 index 14cf90a.. --- a/app-arch/tar/files/tar-1.27.1-xattr_build_fix.patch +++ /dev/null @@ -1,196 +0,0 @@ -http://lists.gnu.org/archive/html/bug-tar/2013-12/msg00023.html -https://bugs.gentoo.org/489170 - tar-1.27.1/configure 2013-11-17 17:18:39.0 +0100 -+++ tar-1.27.1/configure 2013-11-17 17:18:39.0 +0100 -@@ -33619,19 +33619,20 @@ - fi - - -- for ac_header in attr/xattr.h -+ for ac_header in sys/xattr.h attr/xattr.h - do : -- ac_fn_c_check_header_mongrel "$LINENO" "attr/xattr.h" "ac_cv_header_attr_xattr_h" "$ac_includes_default" --if test "x$ac_cv_header_attr_xattr_h" = xyes; then : -+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF --#define HAVE_ATTR_XATTR_H 1 -+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 - _ACEOF - - fi - - done - -- if test "$ac_cv_header_attr_xattr_h" = yes; then -+ if test "$ac_cv_header_sys_xattr_h" = yes -o "$ac_cv_header_attr_xattr_h" = yes; then - TAR_COND_XATTR_H_TRUE= - TAR_COND_XATTR_H_FALSE='#' - else -@@ -33639,30 +33640,130 @@ - TAR_COND_XATTR_H_FALSE= - fi - -- if test "$ac_cv_header_attr_xattr_h" = yes; then --for ac_func in getxattr fgetxattr lgetxattr \ -- setxattr fsetxattr lsetxattr \ --