From e8e3f341e570aeeb7d0418c4f43a3aee71334b0b Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 28 Apr 2009 15:32:20 +0000 Subject: [PATCH] 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 --- lib/CheckConflicts.sh | 123 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100755 lib/CheckConflicts.sh diff --git a/lib/CheckConflicts.sh b/lib/CheckConflicts.sh new file mode 100755 index 0000000000..fc3682e1bb --- /dev/null +++ b/lib/CheckConflicts.sh @@ -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