summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-10-20 09:19:19 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-01 21:30:52 +0000
commitac38d245878b618ddf56f9a68834d344500e45a6 (patch)
treea597e24cf648f16bca8d62a3cb31d57cb12afdb2 /scripts
parent04bab58809c63c9114feb0aadc9b6115be10fcc4 (diff)
downloadopenembedded-core-ac38d245878b618ddf56f9a68834d344500e45a6.tar.gz
openembedded-core-ac38d245878b618ddf56f9a68834d344500e45a6.tar.bz2
openembedded-core-ac38d245878b618ddf56f9a68834d344500e45a6.zip
scripts/gen-lockedsig-cache: improve output
* Print some status when running * When incorrect number of arguments specified, print usage text Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/gen-lockedsig-cache13
1 files changed, 10 insertions, 3 deletions
diff --git a/scripts/gen-lockedsig-cache b/scripts/gen-lockedsig-cache
index 806c1e4caa..9c16506cd6 100755
--- a/scripts/gen-lockedsig-cache
+++ b/scripts/gen-lockedsig-cache
@@ -1,7 +1,4 @@
#!/usr/bin/env python
-#
-# gen-lockedsig-cache <locked-sigs.inc> <input-cachedir> <output-cachedir>
-#
import os
import sys
@@ -18,14 +15,17 @@ def mkdir(d):
if len(sys.argv) < 3:
print("Incorrect number of arguments specified")
+ print("syntax: gen-lockedsig-cache <locked-sigs.inc> <input-cachedir> <output-cachedir>")
sys.exit(1)
+print('Reading %s' % sys.argv[1])
sigs = []
with open(sys.argv[1]) as f:
for l in f.readlines():
if ":" in l:
sigs.append(l.split(":")[2].split()[0])
+print('Gathering file list')
files = set()
for s in sigs:
p = sys.argv[2] + "/" + s[:2] + "/*" + s + "*"
@@ -33,10 +33,13 @@ for s in sigs:
p = sys.argv[2] + "/*/" + s[:2] + "/*" + s + "*"
files |= set(glob.glob(p))
+print('Processing files')
for f in files:
+ sys.stdout.write('Processing %s... ' % f)
_, ext = os.path.splitext(f)
if not ext in ['.tgz', '.siginfo', '.sig']:
# Most likely a temp file, skip it
+ print('skipping')
continue
dst = f.replace(sys.argv[2], sys.argv[3])
destdir = os.path.dirname(dst)
@@ -45,6 +48,10 @@ for f in files:
if os.path.exists(dst):
os.remove(dst)
if (os.stat(f).st_dev == os.stat(destdir).st_dev):
+ print('linking')
os.link(f, dst)
else:
+ print('copying')
shutil.copyfile(f, dst)
+
+print('Done!')