ASPL Manual v 1.00
© 2024 by SetSphere.COM


12-11

   Script jarcomparelong.aspl

Use the script jarcomparelong.aspl to show an extended visual view when comparing two Jar files. Turn the Jar files into two groups represented by set variables and use ASPL set operators to visualize the similarity between both Jar files. Inspect the inside of the Jar files and compare their Java classes and properties.


       [Top Text]

 -L- Listing. 12.11.1   [LISTING jarcomparelong.aspl][ASPL Script jarcomparelong.aspl]
(raw text)
1.     #!/usr/bin/env /opt/ASPLv1.00/bin/aspl
2.     #ENVARG= -groupingclass POSIX -wsname TRANSIENT -dm 3 -singlepass
3.     
4.     ;;***********************************************************************
5.     ;;   jarcompare.aspl
6.     ;;   Compare two JAR archives
7.     ;;   Copyright © 2024 Bassem W. Jamaleddine
8.     ;;
9.     ;;***********************************************************************
10.    
11.    endScriptIfShellArgsLessThan 2
12.    
13.    DEF FN cmp2sets := {gU {g\, %%1 %%2}{g\, %%2 %%1}{g&, %%1 %%2}}
14.    
15.    timeout 60
16.    displayoff
17.    d1 = ggjar(jarfile,$1,calchksum,1,calentropy,1)
18.    d2 = ggjar(jarfile,$2,calchksum,1,calentropy,1)
19.    
20.    displayon
21.    ;;ks chksum size mtime ffl
22.    ks chksum size ffl
23.    print ############################################
24.    print # GETTING THE DIFFERENCE BETWEEN $1 and $2
25.    print ############################################
26.    f\ d1 d2
27.    print ############################################
28.    print # GETTING THE DIFFERENCE BETWEEN $2 and $1
29.    print ############################################
30.    f\ d2 d1
31.    print ############################################
32.    print # GETTING THE INTERSECTION BETWEEN $1 and $2 HAVING SAME CHECKSUMS
33.    print ############################################
34.    f&`c= d1 d2
35.    print ############################################
36.    print # GETTING THE INTERSECTION BETWEEN $1 and $2 HAVING DIFFERENT 
      CHECKSUMS 
37.    print ############################################
38.    f&`c~ d1 d2
39.    print ############################################
40.    print # SHOWING DIRECTORIES AND FILES SEQUENCE ALIGNMENT (LCS) BETWEEN $1 
      and $2 
41.    print ############################################
42.    sequencing lcs
43.    g%U d1 d2
44.    print ############################################
45.    print # SHOWING FILES SEQUENCE ALIGNMENT (LCS) BETWEEN $1 and $2 
46.    print ############################################
47.    f%U d1 d2
48.    print ############################################
49.    print # SHOWING DIRECTORIES SEQUENCE ALIGNMENT (LCS) BETWEEN $1 and $2 
50.    print ############################################
51.    d%U d1 d2
52.    print ############################################
53.    print # COMPARE $1 and $2 
54.    print ############################################
55.    FN cmp2sets(d1,d2)
56.    print ############################################
57.    print # SHOWING THE SET DENSITIES OF $1 and $2 
58.    print ############################################
59.    density d1 d2
60.    print ############################################
61.    print # SHOWING SET SIMILARITY BETWEEN $1 and $2 
62.    print ############################################
63.    sim d1 d2
64.    print ############################################
65.    print # SHOWING SET SIMILARITY w. FILES CHECKSUM BETWEEN $1 and $2 
66.    print ############################################
67.    sim`fflc d1 d2
68.    print ############################################
69.    print # DISPLAY SYMBOL TABLE
70.    print ############################################
71.    v
72.    
73.    endscript
74.    
75.    __END__
76.    
77.      $00 compares two JAR archives
78.    
79.      $00 must be followed by two Jar archives 
80.    
81.      Example: 
82.      To compare the two JAR archives /tmp/TX/27238-tx.jar and 
      /tmp/TX/38141-tx.jar 
83.        $00 /tmp/TX/27238-tx.jar /tmp/TX/38141-tx.jar
84.        
85.        $00 /tmp/JMX/2281258-wasjmx.jar /tmp/JMX/2376115-wasjmx.jar
86.    

ASPL(C) 2024 Bassem Jamaleddine




This example is shown in the following terminal.

       display or terminal for Example: Script jarcomparelong.aspl
viewme

 -E- Display. 12.11.1   [Script jarcomparelong.aspl with LCS][Script jarcomparelong.aspl with LCS]
run for jarcomparelong-aspl-lcs-links




       display or terminal for Example: Script jarcomparelong.aspl
viewme

 -E- Display. 12.11.2   [Script jarcomparelong.aspl with SSA][Script jarcomparelong.aspl with SSA]
run for jarcomparelong-aspl-ssa-links