FR [2782956] - Script to check precedence of jar files

https://sourceforge.net/tracker/?func=detail&aid=2782956&group_id=176962&atid=879335
Contributing a shell script that check conflict between the different precedence of customization, packages and patches
Tested in ubuntu - to be run AFTER RUN_setup or RUN_silentsetup
This commit is contained in:
Carlos Ruiz 2009-04-28 15:32:20 +00:00
parent 9e865b8947
commit e8e3f341e5
1 changed files with 123 additions and 0 deletions

123
lib/CheckConflicts.sh Executable file
View File

@ -0,0 +1,123 @@
#!/bin/sh
#
# CheckConflicts.sh
# Carlos Ruiz - globalqss
# Check for conflicts between files patches, packages and customization (same for zk)
PROCESS=$$
TMPDIR=/tmp
TMPLISPATCHES=$TMPDIR/lispatches$PROCESS.txt
TMPLISCUST=$TMPDIR/liscustomization$PROCESS.txt
TMPLISPACK=$TMPDIR/lispackages$PROCESS.txt
TMPLISALLPACK=$TMPDIR/lisallpackages$PROCESS.txt
TMPLISUNQPACK=$TMPDIR/lisunqpackages$PROCESS.txt
TMPLISZKPATCHES=$TMPDIR/liszkpatches$PROCESS.txt
TMPLISZKCUST=$TMPDIR/liszkcustomization$PROCESS.txt
TMPLISZKPACK=$TMPDIR/liszkpackages$PROCESS.txt
TMPLISZKALLPACK=$TMPDIR/liszkallpackages$PROCESS.txt
TMPLISZKUNQPACK=$TMPDIR/liszkunqpackages$PROCESS.txt
jar tf patches.jar |
fgrep -v META-INF |
fgrep .class |
sort > $TMPLISPATCHES
jar tf customization.jar |
fgrep -v META-INF |
fgrep .class |
sort > $TMPLISCUST
jar tf packages.jar |
fgrep -v META-INF |
fgrep .class |
sort > $TMPLISPACK
> $TMPLISALLPACK
for JARFILE in `ls ../packages/*/lib/*.jar 2> /dev/null`
do
jar tf $JARFILE |
fgrep -v META-INF |
fgrep .class >> $TMPLISALLPACK
done
sort -o $TMPLISALLPACK $TMPLISALLPACK
sort -u -o $TMPLISUNQPACK $TMPLISALLPACK
jar tf zkpatches.jar |
fgrep -v META-INF |
fgrep ".class
.css.dsp" |
sort > $TMPLISZKPATCHES
jar tf zkcustomization.jar |
fgrep -v META-INF |
fgrep ".class
.css.dsp" |
sort > $TMPLISZKCUST
jar tf zkpackages.jar |
fgrep -v META-INF |
fgrep ".class
.css.dsp" |
sort > $TMPLISZKPACK
> $TMPLISZKALLPACK
for JARFILE in `ls ../zkpackages/*/lib/*.jar 2> /dev/null`
do
jar tf $JARFILE |
fgrep -v META-INF |
fgrep ".class
.css.dsp" >> $TMPLISZKALLPACK
done
sort -o $TMPLISZKALLPACK $TMPLISZKALLPACK
sort -u -o $TMPLISZKUNQPACK $TMPLISZKALLPACK
if [ `comm -12 $TMPLISPATCHES $TMPLISCUST | wc -l` -ne 0 ]
then
echo "** WARNING: Dup files in customization and patches. Customization will take precedence"
comm -12 $TMPLISPATCHES $TMPLISCUST
fi
if [ `comm -12 $TMPLISPACK $TMPLISCUST | wc -l` -ne 0 ]
then
echo "** WARNING: Dup files in customization and packages. Customization will take precedence"
comm -12 $TMPLISPACK $TMPLISCUST
fi
if [ `comm -12 $TMPLISPATCHES $TMPLISPACK | wc -l` -ne 0 ]
then
echo "** WARNING: Dup files in packages and patches. Packages will take precedence"
comm -12 $TMPLISPATCHES $TMPLISPACK
fi
if [ `comm -23 $TMPLISALLPACK $TMPLISUNQPACK | wc -l` -ne 0 ]
then
echo "** WARNING: Dup files in several files on packages directory. One of them will take precedence (uncertain)"
comm -23 $TMPLISALLPACK $TMPLISUNQPACK
fi
if [ `comm -12 $TMPLISZKPATCHES $TMPLISZKCUST | wc -l` -ne 0 ]
then
echo "** WARNING: Dup files in zkcustomization and zkpatches. ZK Customization will take precedence"
comm -12 $TMPLISZKPATCHES $TMPLISZKCUST
fi
if [ `comm -12 $TMPLISZKPACK $TMPLISZKCUST | wc -l` -ne 0 ]
then
echo "** WARNING: Dup files in zkcustomization and zkpackages. ZK Customization will take precedence"
comm -12 $TMPLISZKPACK $TMPLISZKCUST
fi
if [ `comm -12 $TMPLISZKPATCHES $TMPLISZKPACK | wc -l` -ne 0 ]
then
echo "** WARNING: Dup files in zkpackages and zkpatches. ZK Packages will take precedence"
comm -12 $TMPLISZKPATCHES $TMPLISZKPACK
fi
if [ `comm -23 $TMPLISZKALLPACK $TMPLISZKUNQPACK | wc -l` -ne 0 ]
then
echo "** WARNING: Dup files in several files on zkpackages directory. One of them will take precedence (uncertain)"
comm -23 $TMPLISZKALLPACK $TMPLISZKUNQPACK
fi
rm -f $TMPLISPATCHES $TMPLISCUST $TMPLISPACK $TMPLISALLPACK $TMPLISUNQPACK $TMPLISZKPATCHES $TMPLISZKCUST $TMPLISZKPACK $TMPLISZKALLPACK $TMPLISZKUNQPACK