///
/// This is currently used judiciously throughout the build system rather than
/// using a `Result` with `try!`, but this may change one day...
+#[macro_export]
macro_rules! t {
($e:expr) => {
match $e {
}
};
}
-pub(crate) use t;
+pub use t;
/// Given an executable called `name`, return the filename for the
/// executable for a particular target.
}
}
+/// Used for download caching
+pub(crate) fn program_out_of_date(stamp: &Path, key: &str) -> bool {
+ if !stamp.exists() {
+ return true;
+ }
+ t!(fs::read_to_string(stamp)) != key
+}
+
/// Symlinks two directories, using junctions on Windows and normal symlinks on
/// Unix.
pub fn symlink_dir(config: &Config, src: &Path, dest: &Path) -> io::Result<()> {