diff options
author | Richard Purdie <richard@openedhand.com> | 2008-03-14 11:28:39 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2008-03-14 11:28:39 +0000 |
commit | 097076da2349e638342e69e465c85683adb6ccc7 (patch) | |
tree | 564c58ded8044866dd370a11a50f60e6b6201108 | |
parent | 5f391a1647151923f25fa07b28349ee44ae21168 (diff) | |
download | poky-097076da2349e638342e69e465c85683adb6ccc7.tar.gz |
stage-manager: Sync with OE for various fixes
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4005 311d38ba-8fff-0310-9ca6-ca027cbcb966
-rwxr-xr-x | meta/packages/stage-manager/files/stage-manager | 23 | ||||
-rw-r--r-- | meta/packages/stage-manager/stagemanager-native_0.0.1.bb | 3 |
2 files changed, 20 insertions, 6 deletions
diff --git a/meta/packages/stage-manager/files/stage-manager b/meta/packages/stage-manager/files/stage-manager index 35453992f4..536d1afda0 100755 --- a/meta/packages/stage-manager/files/stage-manager +++ b/meta/packages/stage-manager/files/stage-manager | |||
@@ -33,6 +33,7 @@ def read_cache(cachefile): | |||
33 | cache[data[0]] = {} | 33 | cache[data[0]] = {} |
34 | cache[data[0]]['ts'] = int(data[1]) | 34 | cache[data[0]]['ts'] = int(data[1]) |
35 | cache[data[0]]['size'] = int(data[2]) | 35 | cache[data[0]]['size'] = int(data[2]) |
36 | cache[data[0]]['seen'] = False | ||
36 | return cache | 37 | return cache |
37 | 38 | ||
38 | def mkdirhier(dir): | 39 | def mkdirhier(dir): |
@@ -77,13 +78,14 @@ if __name__ == "__main__": | |||
77 | if os.access(options.cachefile, os.F_OK): | 78 | if os.access(options.cachefile, os.F_OK): |
78 | cache = read_cache(options.cachefile) | 79 | cache = read_cache(options.cachefile) |
79 | 80 | ||
80 | found = False | 81 | found_difference = False |
81 | 82 | ||
82 | def updateCache(path, fstamp): | 83 | def updateCache(path, fstamp): |
83 | cache[path] = {} | 84 | cache[path] = {} |
84 | cache[path]['ts'] = fstamp[stat.ST_MTIME] | 85 | cache[path]['ts'] = fstamp[stat.ST_MTIME] |
85 | cache[path]['size'] = fstamp[stat.ST_SIZE] | 86 | cache[path]['size'] = fstamp[stat.ST_SIZE] |
86 | found = True | 87 | cache[path]['seen'] = True |
88 | found_difference = True | ||
87 | 89 | ||
88 | def copyfile(path): | 90 | def copyfile(path): |
89 | if options.copydir: | 91 | if options.copydir: |
@@ -94,11 +96,13 @@ if __name__ == "__main__": | |||
94 | def copydir(path, fstamp): | 96 | def copydir(path, fstamp): |
95 | if options.copydir: | 97 | if options.copydir: |
96 | copypath = os.path.join(options.copydir, path.replace(options.parentdir, '', 1)) | 98 | copypath = os.path.join(options.copydir, path.replace(options.parentdir, '', 1)) |
99 | if os.path.exists(copypath): | ||
100 | os.system("rm -rf " + copypath) | ||
97 | if os.path.islink(path): | 101 | if os.path.islink(path): |
98 | os.symlink(os.readlink(path), copypath) | 102 | os.symlink(os.readlink(path), copypath) |
99 | else: | 103 | else: |
100 | mkdirhier(copypath) | 104 | mkdirhier(copypath) |
101 | os.utime(copypath, (fstamp[stat.ST_ATIME], fstamp[stat.ST_MTIME])) | 105 | os.utime(copypath, (fstamp[stat.ST_ATIME], fstamp[stat.ST_MTIME])) |
102 | 106 | ||
103 | for root, dirs, files in os.walk(options.parentdir): | 107 | for root, dirs, files in os.walk(options.parentdir): |
104 | for f in files: | 108 | for f in files: |
@@ -115,6 +119,7 @@ if __name__ == "__main__": | |||
115 | print "file %s changed" % path | 119 | print "file %s changed" % path |
116 | updateCache(path, fstamp) | 120 | updateCache(path, fstamp) |
117 | copyfile(path) | 121 | copyfile(path) |
122 | cache[path]['seen'] = True | ||
118 | for d in dirs: | 123 | for d in dirs: |
119 | path = os.path.join(root, d) | 124 | path = os.path.join(root, d) |
120 | fstamp = os.lstat(path) | 125 | fstamp = os.lstat(path) |
@@ -127,13 +132,23 @@ if __name__ == "__main__": | |||
127 | print "dir %s changed" % path | 132 | print "dir %s changed" % path |
128 | updateCache(path, fstamp) | 133 | updateCache(path, fstamp) |
129 | copydir(path, fstamp) | 134 | copydir(path, fstamp) |
135 | cache[path]['seen'] = True | ||
136 | |||
137 | todel = [] | ||
138 | for path in cache: | ||
139 | if not cache[path]['seen']: | ||
140 | print "%s removed" % path | ||
141 | found_difference = True | ||
142 | todel.append(path) | ||
130 | 143 | ||
131 | if options.update: | 144 | if options.update: |
132 | print "Updating" | 145 | print "Updating" |
146 | for path in todel: | ||
147 | del cache[path] | ||
133 | mkdirhier(os.path.split(options.cachefile)[0]) | 148 | mkdirhier(os.path.split(options.cachefile)[0]) |
134 | write_cache(options.cachefile, cache) | 149 | write_cache(options.cachefile, cache) |
135 | 150 | ||
136 | if found: | 151 | if found_difference: |
137 | sys.exit(5) | 152 | sys.exit(5) |
138 | sys.exit(0) | 153 | sys.exit(0) |
139 | 154 | ||
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 828af1fbb5..39c8d7f3de 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 @@ | |||
1 | DESCRIPTION = "Helper script for packaged-staging.bbclass" | 1 | DESCRIPTION = "Helper script for packaged-staging.bbclass" |
2 | PR = "r7" | 2 | PR = "r8" |
3 | 3 | ||
4 | SRC_URI = "file://stage-manager" | 4 | SRC_URI = "file://stage-manager" |
5 | LICENSE = "GPLv2" | 5 | LICENSE = "GPLv2" |
@@ -10,7 +10,6 @@ inherit native | |||
10 | 10 | ||
11 | DEPENDS = " " | 11 | DEPENDS = " " |
12 | PACKAGE_DEPENDS = " " | 12 | PACKAGE_DEPENDS = " " |
13 | PATCHTOOL = "" | ||
14 | INHIBIT_DEFAULT_DEPS = "1" | 13 | INHIBIT_DEFAULT_DEPS = "1" |
15 | 14 | ||
16 | do_install() { | 15 | do_install() { |