apenwarr-redo/redo-ifcreate.py
Seamus Connor 190b4c34ff Replaced all instances of 'python' with 'python2'
On systems where 'python' refers to python3, redo
failed to launch. All invocations of python have been
made explicitly python2 invocations. All tests pass
on an Arch Linux system as of this commit.
2018-11-14 10:52:09 -08:00

22 lines
563 B
Python
Executable file

#!/usr/bin/env python2
import sys, os
import vars, state
from log import err
try:
me = os.path.join(vars.STARTDIR,
os.path.join(vars.PWD, vars.TARGET))
f = state.File(name=me)
for t in sys.argv[1:]:
if not t:
err('cannot build the empty target ("").\n')
sys.exit(204)
if os.path.exists(t):
err('redo-ifcreate: error: %r already exists\n' % t)
sys.exit(1)
else:
f.add_dep('c', t)
state.commit()
except KeyboardInterrupt:
sys.exit(200)