From: Bdale Garbee Date: Wed, 25 Feb 2009 06:14:55 +0000 (-0700) Subject: Merge branch 'dfsg-orig' into dfsg-debian X-Git-Tag: debian/1.22-1~6 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=d3daaa199aca7497bb507f92b693c8457353f96a;hp=-c;p=debian%2Ftar Merge branch 'dfsg-orig' into dfsg-debian Conflicts: cleanup-script.sh tests/incremental.at --- d3daaa199aca7497bb507f92b693c8457353f96a diff --combined cleanup-script.sh index 39fd20be,684ac914..1fd7d47b --- a/cleanup-script.sh +++ b/cleanup-script.sh @@@ -4,6 -4,7 +4,7 @@@ # Copyright 2009 by Bdale Garbee. GPL v2 or any later version. # + git rm -rf doc rm -rf doc # This is a shell archive (produced by GNU sharutils 4.6.3). @@@ -217,4 -218,7 +218,10 @@@ then ${echo} 'x - removed lock director else ${echo} 'x - failed to remove lock directory `'${lock_dir}\''.' exit 1 fi ++<<<<<<< HEAD:cleanup-script.sh ++======= + + git add doc/Makefile doc/Makefile.in doc/README + ++>>>>>>> c286dbf484dc985fb63d5c677fc8cd91b5b1d0f6:cleanup-script.sh exit 0 diff --combined src/create.c index 61bf47a5,a925160e..fde7ed17 --- a/src/create.c +++ b/src/create.c @@@ -744,7 -744,7 +744,7 @@@ write_header_name (struct tar_stat_inf return write_short_name (st); } else if (NAME_FIELD_SIZE - (archive_format == OLDGNU_FORMAT) - < strlen (st->file_name)) + <= strlen (st->file_name)) return write_long_name (st); else return write_short_name (st); @@@ -1041,7 -1041,7 +1041,7 @@@ dump_regular_file (int fd, struct tar_s while (size_left > 0) { size_t bufsize, count; - + mv_size_left (size_left); blk = find_next_block (); @@@ -1398,7 -1398,7 +1398,7 @@@ dump_hard_link (struct tar_stat_info *s block_ordinal = current_block_ordinal (); assign_string (&st->link_name, link_name); if (NAME_FIELD_SIZE - (archive_format == OLDGNU_FORMAT) - < strlen (link_name)) + <= strlen (link_name)) write_long_link (st); st->stat.st_size = 0; @@@ -1495,7 -1495,7 +1495,7 @@@ dump_file0 (struct tar_stat_info *st, c assign_string (&st->file_name, safer_name_suffix (p, false, absolute_names_option)); - transform_name (&st->file_name); + transform_name (&st->file_name, XFORM_REGFILE); if (deref_stat (dereference_option, p, &st->stat) != 0) { @@@ -1705,7 -1705,7 +1705,7 @@@ } buffer[size] = '\0'; assign_string (&st->link_name, buffer); - transform_name (&st->link_name); + transform_name (&st->link_name, XFORM_SYMLINK); if (NAME_FIELD_SIZE - (archive_format == OLDGNU_FORMAT) < size) write_long_link (st); diff --combined src/list.c index 93de630d,98c1e396..c6501722 --- a/src/list.c +++ b/src/list.c @@@ -136,14 -136,6 +136,14 @@@ read_and (void (*do_something) (void) if (!ignore_zeros_option) { + + /* + * According to POSIX tar specs, this is wrong, but on the web + * there are some tar specs that can trigger this, and some tar + * implementations create tars according to that spec. For now, + * let's not be pedantic about issuing the warning. + */ +#if 0 char buf[UINTMAX_STRSIZE_BOUND]; status = read_header (false); @@@ -151,7 -143,6 +151,7 @@@ break; WARN ((0, 0, _("A lone zero block at %s"), STRINGIFY_BIGINT (current_block_ordinal (), buf))); +#endif break; } status = prev_status; @@@ -481,11 -472,11 +481,11 @@@ read_header (bool raw_extended_headers static char * decode_xform (char *file_name, void *data) { - xform_type type = *(xform_type*)data; + int type = *(int*)data; switch (type) { - case xform_symlink: + case XFORM_SYMLINK: /* FIXME: It is not quite clear how and to which extent are the symbolic links subject to filename transformation. In the absence of another solution, symbolic links are exempt from component stripping and @@@ -493,11 -484,11 +493,11 @@@ proper. */ return file_name; - case xform_link: + case XFORM_LINK: file_name = safer_name_suffix (file_name, true, absolute_names_option); break; - case xform_regfile: + case XFORM_REGFILE: file_name = safer_name_suffix (file_name, false, absolute_names_option); break; } @@@ -514,9 -505,9 +514,9 @@@ } bool - transform_member_name (char **pinput, xform_type type) + transform_member_name (char **pinput, int type) { - return transform_name_fp (pinput, decode_xform, &type); + return transform_name_fp (pinput, type, decode_xform, &type); } #define ISOCTAL(c) ((c)>='0'&&(c)<='7') @@@ -637,7 -628,16 +637,16 @@@ decode_header (union block *header, str stat_info->is_dumpdir = true; } - transform_member_name (&stat_info->file_name, xform_regfile); + transform_member_name (&stat_info->file_name, XFORM_REGFILE); + switch (header->header.typeflag) + { + case SYMTYPE: + transform_member_name (&stat_info->link_name, XFORM_SYMLINK); + break; + + case LNKTYPE: + transform_member_name (&stat_info->link_name, XFORM_LINK); + } } /* Convert buffer at WHERE0 of size DIGS from external format to diff --combined tests/incremental.at index 4b1fcf31,5873d83a..366c0330 --- a/tests/incremental.at +++ b/tests/incremental.at @@@ -39,11 -39,14 +39,14 @@@ ls -l structure/file >/dev/nul # command, behaviour of tar becomes variable, depending whether the system # clock ticked over to the next second between creating the file and # backing it up. -sleep 1 +sleep 2 tar cf archive --listed=list structure tar cfv archive --listed=list structure echo separator + # ReiserFS often offsets the timestamps of newly created files + # 1 second to the past. Try to compensate for it, until a better + # solution is found. sleep 2 echo y >structure/file tar cfv archive --listed=list structure