Behave more gracefully when patch files do not exist.

It is possible to use versioned mode without patch files, though there's no way
to specifically tell Getdown whether or not you are using patch files, so it
always tries to download them. If they don't exist, it should now log one
reasonable warning and then proceed to update based on resource hashes.
This commit is contained in:
Michael Bayne
2019-06-05 16:09:51 -07:00
parent 157b12dbfa
commit e7818030a7
3 changed files with 37 additions and 11 deletions
@@ -601,6 +601,8 @@ public abstract class Getdown
int ii = 0; for (Resource prsrc : list) {
ProgressObserver pobs = pragg.startElement(ii++);
try {
// if this patch file failed to download, skip it
if (!prsrc.getLocalNew().exists()) continue;
// install the patch file (renaming them from _new)
prsrc.install(false);
// now apply the patch
@@ -663,6 +665,10 @@ public abstract class Getdown
log.warning("Download failed", "rsrc", rsrc, e);
}
@Override protected void resourceMissing (Resource rsrc) {
log.warning("Resource missing (got 404)", "rsrc", rsrc);
}
/** The last percentage at which we checked for another getdown running, or -1 for not
* having checked at all. */
protected int _lastCheck = -1;