Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/sysinst When retrying sets during extraction, reset...



details:   https://anonhg.NetBSD.org/src/rev/59753d55b608
branches:  trunk
changeset: 744178:59753d55b608
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Jan 26 14:37:29 2020 +0000

description:
When retrying sets during extraction, reset the relevant statistics
to avoid counting retried sets multiple times.

Reported by kim.

diffstat:

 usr.sbin/sysinst/util.c |  16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diffs (45 lines):

diff -r d87fcc3bbbc6 -r 59753d55b608 usr.sbin/sysinst/util.c
--- a/usr.sbin/sysinst/util.c   Sun Jan 26 14:36:35 2020 +0000
+++ b/usr.sbin/sysinst/util.c   Sun Jan 26 14:37:29 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: util.c,v 1.41 2020/01/20 21:26:35 martin Exp $ */
+/*     $NetBSD: util.c,v 1.42 2020/01/26 14:37:29 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1085,7 +1085,7 @@
 {
        distinfo *dist;
        int status;
-       int set;
+       int set, olderror, oldfound;
 
        /* Ensure mountpoint for distribution files exists in current root. */
        (void)mkdir("/mnt2", S_IRWXU| S_IRGRP|S_IXGRP | S_IROTH|S_IXOTH);
@@ -1115,6 +1115,10 @@
                if (set_status[set] != (SET_VALID | SET_SELECTED))
                        continue;
 
+               /* save stats, in case we will retry */
+               oldfound = tarstats.nfound;
+               olderror = tarstats.nerror;
+
                if (status != SET_OK) {
                        /* This might force a redraw.... */
                        clearok(curscr, 1);
@@ -1151,8 +1155,14 @@
 
                /* Try to extract this set */
                status = extract_file(dist, update);
-               if (status == SET_RETRY)
+               if (status == SET_RETRY) {
+                       /* do this set again */
                        dist--;
+                       /* and reset statistics to what we had before this
+                        * set */
+                       tarstats.nfound = oldfound;
+                       tarstats.nerror = olderror;
+               }
        }
 
 #ifdef MD_SET_EXTRACT_FINALIZE



Home | Main Index | Thread Index | Old Index