if self.rustfmt() and self.rustfmt().startswith(self.bin_root()) and (
not os.path.exists(self.rustfmt())
- or self.program_out_of_date(self.rustfmt_stamp())
+ or self.program_out_of_date(self.rustfmt_stamp(), self.rustfmt_channel)
):
if rustfmt_channel:
tarball_suffix = '.tar.xz' if support_xz() else '.tar.gz'
self.fix_executable("{}/bin/rustfmt".format(self.bin_root()))
self.fix_executable("{}/bin/cargo-fmt".format(self.bin_root()))
with output(self.rustfmt_stamp()) as rustfmt_stamp:
- rustfmt_stamp.write(self.date)
+ rustfmt_stamp.write(self.date + self.rustfmt_channel)
def _download_stage0_helper(self, filename, pattern, tarball_suffix, date=None):
if date is None:
"""
return os.path.join(self.bin_root(), '.rustfmt-stamp')
- def program_out_of_date(self, stamp_path):
+ def program_out_of_date(self, stamp_path, extra=""):
"""Check if the given program stamp is out of date"""
if not os.path.exists(stamp_path) or self.clean:
return True
with open(stamp_path, 'r') as stamp:
- return self.date != stamp.read()
+ return (self.date + extra) != stamp.read()
def bin_root(self):
"""Return the binary root directory