add getsestuff related stuff
This commit is contained in:
23
getsestuff
23
getsestuff
@ -12,8 +12,8 @@ from socket import gethostname
|
||||
|
||||
instruments = ['amor', 'camea', 'dmc', 'eiger', 'focus', 'hrpt', 'morpheus', 'sans', 'tasp', 'zebra'] # boa
|
||||
|
||||
stuffsrc = realpath(join(sys.modules['__main__'].__file__, '..', '..', 'lib', 'servicemanager'))
|
||||
# this should be equivalent to /afs/psi.ch/project/sinq/common/lib/servicemanager/
|
||||
stuffsrc = '/afs/psi.ch/project/sinq/common/lib/servicemanager/'
|
||||
|
||||
doit = True # False: check only
|
||||
sim = False # True: show what to do
|
||||
action = ''
|
||||
@ -23,6 +23,21 @@ home = expanduser('~')
|
||||
hostname = gethostname().split('.')[0]
|
||||
remote = hostname not in instruments
|
||||
|
||||
if home.endswith('zolliker'):
|
||||
chdir(expanduser('~/servicemanager/'))
|
||||
cfg_fil = '/afs/psi.ch/project/sinq/common/stow/markus/lib/servicemanager/', glob('cfg/*.cfg')
|
||||
bin_dst = '/afs/psi.ch/project/sinq/common/stow/markus/bin/', ['getsestuff']
|
||||
diff = False
|
||||
for dstdir, files in cfg_fil, bin_dst:
|
||||
for src in files:
|
||||
diff = os.system(f'diff {src} {dstdir}')
|
||||
if diff and os.system(f'cp {src} {dstdir}'):
|
||||
print('can not copy', src, 'to', dstdir)
|
||||
if diff:
|
||||
print('updated getsestuff, please do again')
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
if remote:
|
||||
instrument = ''
|
||||
nicosroot = ''
|
||||
@ -125,9 +140,9 @@ def check_repo(root, repo, url=None, branch=None):
|
||||
pull = False
|
||||
if (doit or sim) and not created:
|
||||
todo.add(action)
|
||||
short = reponame.rpartition('/')[2]
|
||||
short = repo.rpartition('/')[2]
|
||||
if exists(repo):
|
||||
chdir(join(root, repo))
|
||||
chdir(repo)
|
||||
gitconfig = {}
|
||||
for line in doget('git config --list'):
|
||||
key, _, value = line.partition('=')
|
||||
|
Reference in New Issue
Block a user