When we reach the end of the dump in findinode(), ask for another
volume if we missed some earlier tapes (the user can still enter 'none' later if the tapes are unavailable). Previously with 'x' restores, we might not ask for all tapes if the tapes are supplied in reverse order. Clarify the message that describes what volume should be mounted first; reverse order is only efficient when extracting a few files.
This commit is contained in:
parent
5578933d56
commit
dea08b6818
@ -284,6 +284,9 @@ setup()
|
|||||||
*/
|
*/
|
||||||
if (oldinofmt == 0)
|
if (oldinofmt == 0)
|
||||||
SETINO(WINO, dumpmap);
|
SETINO(WINO, dumpmap);
|
||||||
|
/* 'r' restores don't call getvol() for tape 1, so mark it as read. */
|
||||||
|
if (command == 'r')
|
||||||
|
tapesread = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -329,18 +332,20 @@ getvol(nextvol)
|
|||||||
newvol = 0;
|
newvol = 0;
|
||||||
while (newvol <= 0) {
|
while (newvol <= 0) {
|
||||||
if (tapesread == 0) {
|
if (tapesread == 0) {
|
||||||
fprintf(stderr, "%s%s%s%s%s",
|
fprintf(stderr, "%s%s%s%s%s%s%s",
|
||||||
"You have not read any tapes yet.\n",
|
"You have not read any tapes yet.\n",
|
||||||
"Unless you know which volume your",
|
"If you are extracting just a few files,",
|
||||||
" file(s) are on you should start\n",
|
" start with the last volume\n",
|
||||||
"with the last volume and work",
|
"and work towards the first; restore",
|
||||||
" towards the first.\n");
|
" can quickly skip tapes that\n",
|
||||||
|
"have no further files to extract.",
|
||||||
|
" Otherwise, begin with volume 1.\n");
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "You have read volumes");
|
fprintf(stderr, "You have read volumes");
|
||||||
strcpy(buf, ": ");
|
strcpy(buf, ": ");
|
||||||
for (i = 1; i < 32; i++)
|
for (i = 0; i < 32; i++)
|
||||||
if (tapesread & (1 << i)) {
|
if (tapesread & (1 << i)) {
|
||||||
fprintf(stderr, "%s%ld", buf, i);
|
fprintf(stderr, "%s%ld", buf, i + 1);
|
||||||
strcpy(buf, ", ");
|
strcpy(buf, ", ");
|
||||||
}
|
}
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
@ -358,7 +363,7 @@ getvol(nextvol)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (newvol == volno) {
|
if (newvol == volno) {
|
||||||
tapesread |= 1 << volno;
|
tapesread |= 1 << (volno - 1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
closemt();
|
closemt();
|
||||||
@ -411,7 +416,7 @@ getvol(nextvol)
|
|||||||
volno = 0;
|
volno = 0;
|
||||||
goto again;
|
goto again;
|
||||||
}
|
}
|
||||||
tapesread |= 1 << volno;
|
tapesread |= 1 << (volno - 1);
|
||||||
blksread = savecnt;
|
blksread = savecnt;
|
||||||
/*
|
/*
|
||||||
* If continuing from the previous volume, skip over any
|
* If continuing from the previous volume, skip over any
|
||||||
@ -1255,6 +1260,11 @@ findinode(header)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case TS_END:
|
case TS_END:
|
||||||
|
/* If we missed some tapes, get another volume. */
|
||||||
|
if (tapesread & (tapesread + 1)) {
|
||||||
|
getvol(0);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
curfile.ino = maxino;
|
curfile.ino = maxino;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user