From 1f222bed0b8bf8186ca2f4482897cb7fa7340b13ad6fccc84ac2253968aaff11 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Sat, 12 Apr 2008 18:03:36 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/cpio?expand=0&rev=11 --- cpio-2.9-eof_tape_handling.patch | 41 ++++++++++++++++++++++++++++---- cpio.changes | 6 +++++ cpio.spec | 5 +++- 3 files changed, 46 insertions(+), 6 deletions(-) diff --git a/cpio-2.9-eof_tape_handling.patch b/cpio-2.9-eof_tape_handling.patch index a05b67a..0b9f701 100644 --- a/cpio-2.9-eof_tape_handling.patch +++ b/cpio-2.9-eof_tape_handling.patch @@ -1,6 +1,6 @@ --- src/util.c +++ src/util.c -@@ -188,7 +188,8 @@ tape_fill_input_buffer (int in_des, int +@@ -188,8 +188,15 @@ tape_fill_input_buffer (int in_des, int input_size = rmtread (in_des, input_buffer, num_bytes); if (input_size == 0 && input_is_special) { @@ -8,9 +8,16 @@ + if (!tape_eof (in_des)) + get_next_reel (in_des); input_size = rmtread (in_des, input_buffer, num_bytes); ++ if (input_size == 0) ++ { ++ if (tape_eod (in_des)) ++ get_next_reel (in_des); ++ input_size = rmtread (in_des, input_buffer, num_bytes); ++ } } if (input_size < 0) -@@ -354,7 +355,8 @@ tape_buffered_peek (char *peek_buf, int + error (1, errno, _("read error")); +@@ -354,8 +361,15 @@ tape_buffered_peek (char *peek_buf, int { if (input_is_special) { @@ -18,9 +25,16 @@ + if (!tape_eof (in_des)) + get_next_reel (in_des); tmp_input_size = rmtread (in_des, append_buf, io_block_size); ++ if (tmp_input_size == 0) ++ { ++ if (tape_eod (in_des)) ++ get_next_reel (in_des); ++ tmp_input_size = rmtread (in_des, append_buf, io_block_size); ++ } } else -@@ -828,6 +830,22 @@ tape_offline (int tape_des) + break; +@@ -828,6 +842,40 @@ tape_offline (int tape_des) #endif } @@ -34,8 +48,26 @@ + return 0; + } + -+ if (GMT_EOF(status.mt_gstat)) ++ if (GMT_EOF(status.mt_gstat)) { ++ return 1; ++ } ++ ++ return 0; ++} ++ ++int ++tape_eod( int tape_des) ++{ ++ struct mtget status; ++ ++ if (rmtioctl (tape_des, MTIOCGET, (char*)&status) == -1) { ++ error (1, errno, "Cannot get tape status"); + return 1; ++ } ++ ++ if (GMT_EOD(status.mt_gstat)) { ++ return 1; ++ } + + return 0; +} @@ -43,4 +75,3 @@ /* The file on file descriptor TAPE_DES is assumed to be magnetic tape (or floppy disk or other device) and the end of the medium has been reached. Ask the user for to mount a new "tape" to continue - diff --git a/cpio.changes b/cpio.changes index d6e266a..155490e 100644 --- a/cpio.changes +++ b/cpio.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Apr 11 12:55:08 CEST 2008 - lmichnovic@suse.cz + +- adjusted eof-handling.patch to check for 'end-of-file' and + 'end-of-data' marker when detecting reel change. [bnc#371077] + ------------------------------------------------------------------- Fri Apr 4 15:35:41 CEST 2008 - lmichnovic@suse.cz diff --git a/cpio.spec b/cpio.spec index fbc584e..09e9042 100644 --- a/cpio.spec +++ b/cpio.spec @@ -17,7 +17,7 @@ License: GPL v3 only Group: Productivity/Archiving/Compression AutoReqProv: on Version: 2.9 -Release: 49 +Release: 51 Summary: A Backup and Archiving Utility Source: cpio-2.9.tar.bz2 Patch1: cpio-2.9-no_rmt.patch @@ -119,6 +119,9 @@ ln -sf ../../bin/cpio $RPM_BUILD_ROOT/usr/bin/cpio %files lang -f %{name}.lang %changelog +* Fri Apr 11 2008 lmichnovic@suse.cz +- adjusted eof-handling.patch to check for 'end-of-file' and + 'end-of-data' marker when detecting reel change. [bnc#371077] * Fri Apr 04 2008 lmichnovic@suse.cz - adjusted cpio-2.9-dir_perm.patch acording Red Hat patch to fix correct dir permissions after extraction in pass-through mode.