summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2007-11-30 08:17:19 +0000
committerRichard Purdie <richard@openedhand.com>2007-11-30 08:17:19 +0000
commitf7d937fd8e1aab283c99baec5741fce2c2db3a21 (patch)
treeb16b720e120d108d82969f82990e709246cd70e5 /meta
parentc9b23048a8742e0e2686f0e455c276643188bb5d (diff)
downloadopenembedded-core-f7d937fd8e1aab283c99baec5741fce2c2db3a21.tar.gz
openembedded-core-f7d937fd8e1aab283c99baec5741fce2c2db3a21.tar.bz2
openembedded-core-f7d937fd8e1aab283c99baec5741fce2c2db3a21.zip
stage-manager: Various fixes/ehacements
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3271 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta')
-rwxr-xr-xmeta/packages/stage-manager/files/stage-manager55
-rw-r--r--meta/packages/stage-manager/stagemanager-native_0.0.1.bb2
2 files changed, 39 insertions, 18 deletions
diff --git a/meta/packages/stage-manager/files/stage-manager b/meta/packages/stage-manager/files/stage-manager
index 06495dbb02..35453992f4 100755
--- a/meta/packages/stage-manager/files/stage-manager
+++ b/meta/packages/stage-manager/files/stage-manager
@@ -79,33 +79,54 @@ if __name__ == "__main__":
found = False
+ def updateCache(path, fstamp):
+ cache[path] = {}
+ cache[path]['ts'] = fstamp[stat.ST_MTIME]
+ cache[path]['size'] = fstamp[stat.ST_SIZE]
+ found = True
+
+ def copyfile(path):
+ if options.copydir:
+ copypath = os.path.join(options.copydir, path.replace(options.parentdir, '', 1))
+ mkdirhier(os.path.split(copypath)[0])
+ os.system("cp -dp " + path + " " + copypath)
+
+ def copydir(path, fstamp):
+ if options.copydir:
+ copypath = os.path.join(options.copydir, path.replace(options.parentdir, '', 1))
+ if os.path.islink(path):
+ os.symlink(os.readlink(path), copypath)
+ else:
+ mkdirhier(copypath)
+ os.utime(copypath, (fstamp[stat.ST_ATIME], fstamp[stat.ST_MTIME]))
+
for root, dirs, files in os.walk(options.parentdir):
for f in files:
path = os.path.join(root, f)
if not os.access(path, os.R_OK):
continue
- fstamp = os.stat(path)
+ fstamp = os.lstat(path)
if path not in cache:
print "new file %s" % path
- cache[path] = {}
- cache[path]['ts'] = fstamp[stat.ST_MTIME]
- cache[path]['size'] = fstamp[stat.ST_SIZE]
- if options.copydir:
- copypath = os.path.join(options.copydir, path.replace(options.parentdir, '', 1))
- mkdirhier(os.path.split(copypath)[0])
- os.system("cp " + path + " " + copypath)
- found = True
+ updateCache(path, fstamp)
+ copyfile(path)
else:
if cache[path]['ts'] != fstamp[stat.ST_MTIME] or cache[path]['size'] != fstamp[stat.ST_SIZE]:
print "file %s changed" % path
- cache[path] = {}
- cache[path]['ts'] = fstamp[stat.ST_MTIME]
- cache[path]['size'] = fstamp[stat.ST_SIZE]
- if options.copydir:
- copypath = os.path.join(options.copydir, path.replace(options.parentdir, '', 1))
- mkdirhier(os.path.split(copypath)[0])
- os.system("cp " + path + " " + copypath)
- found = True
+ updateCache(path, fstamp)
+ copyfile(path)
+ for d in dirs:
+ path = os.path.join(root, d)
+ fstamp = os.lstat(path)
+ if path not in cache:
+ print "new dir %s" % path
+ updateCache(path, fstamp)
+ copydir(path, fstamp)
+ else:
+ if cache[path]['ts'] != fstamp[stat.ST_MTIME]:
+ print "dir %s changed" % path
+ updateCache(path, fstamp)
+ copydir(path, fstamp)
if options.update:
print "Updating"
diff --git a/meta/packages/stage-manager/stagemanager-native_0.0.1.bb b/meta/packages/stage-manager/stagemanager-native_0.0.1.bb
index b1f3367209..828af1fbb5 100644
--- a/meta/packages/stage-manager/stagemanager-native_0.0.1.bb
+++ b/meta/packages/stage-manager/stagemanager-native_0.0.1.bb
@@ -1,5 +1,5 @@
DESCRIPTION = "Helper script for packaged-staging.bbclass"
-PR = "r2"
+PR = "r7"
SRC_URI = "file://stage-manager"
LICENSE = "GPLv2"