Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
support BSD touch by not using GNU touch.
Browse files Browse the repository at this point in the history
closes #34
  • Loading branch information
bukzor committed Jan 29, 2015
1 parent 2006319 commit 7908c07
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion venv_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,17 @@ def wait_for_all_subprocesses():
raise


def backintime(reference, filename):
info(colorize(('touch', filename, '--reference', reference, '--date', '1 day ago')))
from os.path import getmtime
mtime = getmtime(reference)

timestamp = mtime - 24 * 60 * 60

from os import utime
utime(filename, (timestamp, timestamp))


def mark_venv_invalid(venv_path, reqs):
# LBYL, to attempt to avoid any exception during exception handling
from os.path import isdir, exists
Expand All @@ -476,7 +487,7 @@ def mark_venv_invalid(venv_path, reqs):
info("Waiting for all subprocesses to finish...")
wait_for_all_subprocesses()
info("DONE")
run(('touch', venv_path, '--reference', reqs[0], '--date', '1 day ago'))
backintime(reqs[0], venv_path)
info('')


Expand Down

0 comments on commit 7908c07

Please sign in to comment.