Delete: bin/oeinstall
[vuplus_bitbake] / bin / oemaked
1 #!/usr/bin/env python
2 # ex:ts=4:sw=4:sts=4:et
3 # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
4
5 import os, sys, stat, daemon, time
6
7 if not "OEFILES" in os.environ:
8     sys.exit(1)
9
10 olddir=os.getcwd()
11 delay=30
12
13 files = []
14 for file in os.environ["OEFILES"].split():
15     file = os.path.abspath(file)
16     if os.access(file, os.R_OK):
17         print "%s" % file
18         files.append([file, None])
19
20 daemon.daemonize("/home/kergoth/out", "/home/kergoth/err", "/dev/null")
21
22 os.chdir(olddir)
23
24 def runOEMake():
25     os.system("oemake")
26
27 while 1:
28     __dirty = 0
29     for file in files:
30         time = os.stat(file[0])[stat.ST_MTIME]
31         if file[1] is None or time != file[1]:
32             __dirty = 1
33             file[1] = time
34     if __dirty == 1:
35         runOEMake()
36
37     time.sleep(delay)