diff options
author | Marko Grönroos <magi@iki.fi> | 2009-10-05 14:27:20 +0000 |
---|---|---|
committer | Marko Grönroos <magi@iki.fi> | 2009-10-05 14:27:20 +0000 |
commit | 96db0552cf49a7adff59f8f0cd0a178f6cce4883 (patch) | |
tree | 0f6c714fbec646631c6a294e54f0d6daed6155b9 | |
parent | 4fcad48762c84b13b73124165840bed374e0b911 (diff) | |
download | vaadin-framework-96db0552cf49a7adff59f8f0cd0a178f6cce4883.tar.gz vaadin-framework-96db0552cf49a7adff59f8f0cd0a178f6cce4883.zip |
List also differences between packaged Vaadin JARs.
svn changeset:9084/svn branch:6.1
-rwxr-xr-x | build/bin/package-diff.py | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/build/bin/package-diff.py b/build/bin/package-diff.py index 74ca550aa0..7b4e903b28 100755 --- a/build/bin/package-diff.py +++ b/build/bin/package-diff.py @@ -57,6 +57,36 @@ def diffFiles(a, b): return difffiles ################################################################################ +# Lists files inside a Zip file (a JAR) +################################################################################ +def listZipFiles(zipfile): + # Read the zip content listing + pin = os.popen("unzip -ql %s" % zipfile, "r") + lines = map(lambda x: x[:-1], pin.readlines()) + pin.close() + + # Determine the position of file names + namepos = lines[0].find("Name") + files = [] + for i in xrange(2, len(lines)-2): + filename = lines[i][namepos:] + files.append(filename) + + return files + +################################################################################ +# Lists files inside a Vaadin Jar inside a Tar +################################################################################ +def listTarVaadinJarFiles(tarfile, vaadinversion): + jarfile = "vaadin-linux-%s/WebContent/vaadin-%s.jar" % (vaadinversion, vaadinversion) + extractedjar = "/tmp/vaadinjar-tmp-%d.jar" % (os.getpid()) + tarcmd = "tar zOxf %s %s > %s " % (tarfile, jarfile, extractedjar) + command (tarcmd) + files = listZipFiles(extractedjar) + command ("rm %s" % (extractedjar)) + return files + +################################################################################ # ################################################################################ @@ -110,5 +140,20 @@ print "\n%d removed files:" % (len(removed)) for item in removed: print item +latestJarFiles = listTarVaadinJarFiles(locallinuxpackage, latestversion) +builtJarFiles = listTarVaadinJarFiles(builtpackage, builtversion) + +# New files +newfiles = diffFiles(builtJarFiles, latestJarFiles) +print "\n%d new files:" % (len(newfiles)) +for item in newfiles: + print item + +# Removed files +removed = diffFiles(latestJarFiles, builtJarFiles) +print "\n%d removed files:" % (len(removed)) +for item in removed: + print item + # Purge downloaded package command("rm %s" % (locallinuxpackage)) |