Permalink
Browse files

make safe.

rotates the last 10 copies of self/compile to help crawl back from
  mistakes that leave us unable to build.
  • Loading branch information...
samrushing committed Mar 16, 2017
1 parent af9c349 commit 08e6b8325e5596eb09cdf6aaa8eca93a09794397
Showing with 29 additions and 0 deletions.
  1. +3 −0 Makefile
  2. +26 −0 util/safe.py
@@ -17,3 +17,6 @@ dist:
tags:
find ./self ./lib -name "*.scm" | etags -
safe:
python util/safe.py
@@ -0,0 +1,26 @@
# -*- Mode: Python -*-
# keep the last 5 compilers in case of nasty bugs that are
# difficult to back out of.
import os
import re
files = []
for path in os.listdir ('./self'):
m = re.match ('^compile([0-9])?$', path)
if m is not None:
if m.group(1) is None:
num = 0
else:
num = int (m.group(1))
files.append ((num, path))
files.sort()
files.reverse()
for num, path in files:
#print 'self/%s' %path, 'self/compile%d' % (num+1)
os.rename ('self/%s' %path, 'self/compile%d' % (num+1))
os.system ('self/compile1 self/compile.scm')

0 comments on commit 08e6b83

Please sign in to comment.