Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37858695
en ru br
Репозитории ALT
S:1.35.0.20.1cdad4cc-alt1
5.1: 1.23-alt4
4.1: 1.20-alt1.M41.1
4.0: 1.15.1-alt8
3.0: 1.15.1-alt2
+updates:1.15.1-alt4.M30.2
www.altlinux.org/Changes

Группа :: Архивирование/Резервное копирование
Пакет: tar

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: tar-1.15.1-cvs-20050801-sparse-totals.patch
Скачать


2005-07-31  Sergey Poznyakoff  <gray@gnu.org.ua>
	* src/create.c (file_dumpable_p,dump_file0): Fix handling of
	sparse files to /dev/null with --totals option.
	* tests/update.at: Remove dependency on file order.
--- src/create.c	22 Jun 2005 06:24:39 -0000	1.101
+++ src/create.c	1 Aug 2005 06:22:21 -0000	1.102
@@ -350,16 +350,20 @@ string_to_chars (char const *str, char *
 }
 
 
-/* A file is not dumpable if
+/* A file is considered dumpable if it is sparse and both --sparse and --totals
+   are specified.
+   Otherwise, it is dumpable unless any of the following conditions occur:
+   
    a) it is empty *and* world-readable, or
    b) current archive is /dev/null */
 
 bool
 file_dumpable_p (struct tar_stat_info *st)
 {
-  return !(dev_null_output
-	   || (st->archive_file_size == 0
-	       && (st->stat.st_mode & MODE_R) == MODE_R));
+  if (dev_null_output)
+    return totals_option && sparse_option && sparse_file_p (st);
+  return !(st->archive_file_size == 0
+	   && (st->stat.st_mode & MODE_R) == MODE_R);
 }
 
 
@@ -1486,7 +1490,7 @@ dump_file0 (struct tar_stat_info *st, ch
 	  else
 	    fd = -1;
 
-	  if (sparse_option && sparse_file_p (st))
+	  if (fd != -1 && sparse_option && sparse_file_p (st))
 	    {
 	      status = sparse_dump_file (fd, st);
 	      if (status == dump_status_not_implemented)
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin