PDA

View Full Version : Zip within a Zip


Mr_T
06-Oct-2011, 01:34 PM
Hey folks, I can't figure this one out.....

I want to script a comparison.
My build creates Jars within Jars (zip within zip) that are identical, but not BINARY identical.

So if I compare the outer JARs with each other they show up as different.
If I compare-contents of all the inner jars (with a few rules around ignoring META-INF) it ends up identical.

How do I script a compare all contents?
HELP!

thanks!

Aaron
07-Oct-2011, 03:47 PM
Hello,

You'll need to use a trick/tip that all BCScripting commands are sequential and can load saved sessions. Your script will first compare the zips as binary files, and then compare them again as folders. You'll first need to launch the BC3 graphical interface and open a new, blank Folder Compare session. Then go to the Session Settings -> Handling tab, and set to "Treat Zips as folders always." Then save this session (still blank) as "expandZipsSession".

load "c:\a" "c:\b"
expand all
folder-report layout:side-by-side output-to:"c:\report1.txt"
load expandZipsSession
load "c:\a" "c:\b"
expand all
folder-report layout:side-by-side output-to:"c:\report2.txt"

This script will load the comparison using the current defaults and not expand your zips, then load the session with the setting saved to treat them as folders, and then expand them and compare the contents inside.