ASPL Manual v 1.00
© 2024 by SetSphere.COM


12-9

   Script jarcompare.aspl

Compare two Jar files that have the same name but they are delivered with different distributions. Inspect the inside of the Jar files, and compare the Java classes and properties between both Jar files.


       [Top Text]

 -L- Listing. 12.9.1   [LISTING jarcompare.aspl][ASPL Script jarcompare.aspl]
(raw text)
1.     #!/usr/bin/env aspl
2.     #ENVARG= -groupingclass POSIX -wsname TRANSIENT -singlepass
3.     
4.     ;;***********************************************************************
5.     ;;   jarcompare.aspl
6.     ;;   Compare two Java JAR Files
7.     ;;   Copyright © 2024 Bassem W. Jamaleddine
8.     ;;***********************************************************************
9.     
10.    endScriptIfShellArgsLessThan 2
11.    
12.    DEF FN cmp2sets := {gU {g\, %%1 %%2}{g\, %%2 %%1}{g&, %%1 %%2}}
13.    
14.    timeout 60
15.    displayoff
16.    jar1 = ggjar(jarfile,$1,calchksum,1,calentropy,1)
17.    jar2 = ggjar(jarfile,$2,calchksum,1,calentropy,1)
18.    
19.    displayon
20.    ks chksum size ffl
21.    print # SHOWING SET COMPARISONS BETWEEN JAR FILES
22.    FN cmp2sets(jar1,jar2)
23.    print # SHOWING SUBDIRECTORIES UNION BETWEEN JAR FILES
24.    dU jar1 jar2
25.    print # SHOWING SUBDIRECTORIES IN ONE NOT IN THE OTHER
26.    dD jar1 jar2
27.    print # SHOWING FILES IN ONE NOT IN THE OTHER
28.    fD jar1 jar2
29.    print # SHOWING FILES UNION BETWEEN JAR FILES
30.    fU jar1 jar2
31.    print # SHOWING FILES INTERSECTION WITH DIFFERENT CHECKSUMS
32.    f&`c~ jar1 jar2
33.    print # SHOWING FILES INTERSECTION WITH SAME CHECKSUMS
34.    f&`c= jar1 jar2
35.    print # SHOWING SET SIMILARITY BETWEEN BOTH JAR FILES
36.    sim jar1 jar2
37.    print # SHOWING SET SIMILARITY CONSIDER FILES CHECKSUMS
38.    sim`fflc jar1 jar2
39.    println
40.    
41.    endscript
42.    
43.    __END__
44.    
45.      $00 compares two JAR archives
46.    
47.      $00 must be followed by the names of two JAR archives 
48.    
49.      Example: 
50.        To compare JAR archives /tmp/TX/27238-tx.jar and /tmp/TX/38141-tx.jar
51.        $00 /tmp/TX/27238-tx.jar /tmp/TX/38141-tx.jar
52.    
53.        $00 /tmp/TX/38478-tx.jar /tmp/TX/45240-tx.jar
54.        $00 /tmp/JMX/2281258-wasjmx.jar /tmp/JMX/2376115-wasjmx.jar
55.    

ASPL(C) 2024 Bassem Jamaleddine




This example is shown in the following terminal.

       display or terminal for Example: Script jarcompare.aspl
viewme

 -E- Display. 12.9.1   [Script jarcompare.aspl][Script jarcompare.aspl]
run for jarcompare-aspl-links