diff options
author | Marko Grönroos <magi@iki.fi> | 2010-04-16 01:10:01 +0000 |
---|---|---|
committer | Marko Grönroos <magi@iki.fi> | 2010-04-16 01:10:01 +0000 |
commit | 1e59ab1a22b651811b4474531cfb1b27d26b97d8 (patch) | |
tree | b88e5fa063e65cfea712e88cdcb9c8c4f8417de1 /build/bin/package-diff.py | |
parent | d0218aa4d44a20a3af7e13fd6680763a1baae21a (diff) | |
download | vaadin-framework-1e59ab1a22b651811b4474531cfb1b27d26b97d8.tar.gz vaadin-framework-1e59ab1a22b651811b4474531cfb1b27d26b97d8.zip |
Merged from 6.3 to 6.4 branch: [12573] Updated differences script to assume that Vaadin distribution package is a Zip. Fixes #4534.
svn changeset:12574/svn branch:6.4
Diffstat (limited to 'build/bin/package-diff.py')
-rwxr-xr-x | build/bin/package-diff.py | 63 |
1 files changed, 15 insertions, 48 deletions
diff --git a/build/bin/package-diff.py b/build/bin/package-diff.py index 1f898e62bc..eec305b243 100755 --- a/build/bin/package-diff.py +++ b/build/bin/package-diff.py @@ -23,29 +23,6 @@ def command(cmd, dryrun=0): ################################################################################ # List files in an archive. ################################################################################ -def listfiles(archive): - pin = os.popen("tar ztf %s | sort" % (archive), "r") - files = map(lambda x: x.strip(), pin.readlines()) - pin.close() - - cleanedfiles = [] - for file in files: - # Remove archive file name from the file names - slashpos = file.find("/") - if slashpos != -1: - cleanedname = file[slashpos+1:] - else: - cleanedname = file - - # Purge GWT compilation files. - if cleanedname.find(".cache.html") != -1: - continue - - cleanedfiles.append(cleanedname) - - return cleanedfiles - -# For Zip archives in Vaadin 6.3.0 def listZipFiles(archive): pin = os.popen("unzip -l -qq %s | cut -c 29- | sort" % (archive), "r") files = map(lambda x: x.strip(), pin.readlines()) @@ -98,24 +75,15 @@ def listJarFiles(jarfile): return files ################################################################################ -# Lists files inside a Vaadin Jar inside a Tar +# Lists files inside a Vaadin Jar inside a ZIP ################################################################################ -# For Vaadin 6.2 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 = listJarFiles(extractedjar) - command ("rm %s" % (extractedjar)) - return files # For Vaadin 6.3 Zip def listZipVaadinJarFiles(zipfile, vaadinversion): jarfile = "vaadin-%s/WebContent/vaadin-%s.jar" % (vaadinversion, vaadinversion) extractedjar = "/tmp/vaadinjar-tmp-%d.jar" % (os.getpid()) - tarcmd = "unzip -p %s %s > %s " % (zipfile, jarfile, extractedjar) - command (tarcmd) + zipcmd = "unzip -p %s %s > %s " % (zipfile, jarfile, extractedjar) + command (zipcmd) files = listJarFiles(extractedjar) command ("rm %s" % (extractedjar)) return files @@ -134,10 +102,9 @@ latestversion = latestdata[0].strip() latestpath = latestdata[1].strip() latestURL = downloadsite + "/" + latestpath + "/" -# TODO: Remove "linux" after 6.3.0 is released. -linuxfilename = "vaadin-linux-%s.tar.gz" % (latestversion) -linuxpackage = latestURL + linuxfilename -locallinuxpackage = "/tmp/%s" % (linuxfilename) +latestfilename = "vaadin-%s.zip" % (latestversion) +latestpackage = latestURL + latestfilename +locallatestpackage = "/tmp/%s" % (latestfilename) print "Latest version: %s" % (latestversion) print "Latest version path: %s" % (latestpath) @@ -145,17 +112,17 @@ print "Latest version URL: %s" % (latestURL) # Check if it already exists try: - os.stat(locallinuxpackage) - print "Latest package already exists in %s" % (locallinuxpackage) + os.stat(locallatestpackage) + print "Latest package already exists in %s" % (locallatestpackage) # File exists except OSError: # File does not exist, get it. - print "Downloading Linux package %s to %s" % (linuxpackage, locallinuxpackage) - wgetcmd = "wget -q -O %s %s" % (locallinuxpackage, linuxpackage) + print "Downloading latest release package %s to %s" % (latestpackage, locallatestpackage) + wgetcmd = "wget -q -O %s %s" % (locallatestpackage, latestpackage) command (wgetcmd) # List files in latest version. -latestfiles = listfiles(locallinuxpackage) +latestfiles = listZipFiles(locallatestpackage) # List files in built version. builtversion = sys.argv[1] @@ -164,7 +131,7 @@ builtfiles = listZipFiles(builtpackage) # Report differences -print "\n--------------------------------------------------------------------------------\nVaadin TAR differences" +print "\n--------------------------------------------------------------------------------\nVaadin ZIP differences" # New files newfiles = diffFiles(builtfiles, latestfiles) @@ -180,8 +147,8 @@ for item in removed: print "\n--------------------------------------------------------------------------------\nVaadin JAR differences" -latestJarFiles = listTarVaadinJarFiles(locallinuxpackage, latestversion) -builtJarFiles = listZipVaadinJarFiles(builtpackage, builtversion) +latestJarFiles = listZipVaadinJarFiles(locallatestpackage, latestversion) +builtJarFiles = listZipVaadinJarFiles(builtpackage, builtversion) # New files newfiles = diffFiles(builtJarFiles, latestJarFiles) @@ -196,4 +163,4 @@ for item in removed: print item # Purge downloaded package -command("rm %s" % (locallinuxpackage)) +command("rm %s" % (locallatestpackage)) |