Skip to content

Commit

Permalink
[FIXED JENKINS-15726] Attempting to recover gracefully when upstream …
Browse files Browse the repository at this point in the history
…file exists but cannot be statted (?).
  • Loading branch information
jglick committed Nov 5, 2012
1 parent 1f5a45c commit 0e3f0df
Showing 1 changed file with 10 additions and 2 deletions.
Expand Up @@ -7,6 +7,7 @@
import hudson.model.Fingerprint;
import hudson.model.FingerprintMap;
import hudson.model.Run;
import hudson.os.PosixException;
import hudson.tasks.Fingerprinter.FingerprintAction;
import hudson.util.IOException2;
import jenkins.model.Jenkins;
Expand All @@ -17,6 +18,7 @@
import java.security.NoSuchAlgorithmException;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
Expand All @@ -29,6 +31,8 @@
*/
@Extension(ordinal=-100)
public class FingerprintingCopyMethod extends Copier {

private static final Logger LOGGER = Logger.getLogger(FingerprintingCopyMethod.class.getName());
/**
* Null if the source of the copy operation isn't {@link AbstractBuild} but some other Run type.
*/
Expand Down Expand Up @@ -76,12 +80,16 @@ public void copyOne(FilePath s, FilePath d) throws IOException, InterruptedExcep
} finally {
out.close();
}
d.chmod(s.mode());
try {
d.chmod(s.mode());
} catch (PosixException x) {
LOGGER.log(Level.WARNING, "could not check mode of " + s, x);
}
// FilePath.setLastModifiedIfPossible private; copyToWithPermission OK but would have to calc digest separately:
try {
d.touch(s.lastModified());
} catch (IOException x) {
Logger.getLogger(FingerprintingCopyMethod.class.getName()).warning(x.getMessage());
LOGGER.warning(x.getMessage());
}
String digest = Util.toHexString(md5.digest());

Expand Down

0 comments on commit 0e3f0df

Please sign in to comment.