Identifying the version of your copy of Expat / was Re: CDATA parsing

Sebastian Pipping <[email protected]> Wed, 10 Sep 2008 22:17:22 +0200
Newsgroups gmane.text.xml.expat.general
Message-ID <[email protected]>
David van Geest wrote:
> A zip of our code is available at dvg.homelinux.net/expat.zip.
> Upgrading is not an option at this point, it's too high-risk.

I've been working on a script comparing your copy Expat
to the available CVS tags.

All of these tags are equally likely with 14 of 18 tested
files matching:
- V20000512
- sourceforge_init
- libexpat-alpha-1
- jclark-orig

My bash script and the result details are attached.



Sebastian

_______________________________________________
Expat-discuss mailing list
[email protected]
http://mail.libexpat.org/mailman/listinfo/expat-discuss
guess_version.sh.txt (text/plain, 1.3 KB)
#!/usr/bin/env bash
## Written by Sebastian Pipping <[email protected]>
## Licensed as Public Domain

## Config
GUESS_FOLDER=guess
TAGS="V20000512 V1_1 V1_0_2 V1_0_1 V1_0 V19991013 V19990728 \
	V19990709 V19990626 V19990425 V19990109 V19981231 \
	V19981122 V1990307 sourceforge_init REC1_0 R_2_0_1 \
	R_2_0_0 R_1_95_8 R_1_95_7 R_1_95_6 R_1_95_5 R_1_95_4 \
	R_1_95_3 R_1_95_2 R_1_95_1 R_1_95_0 libexpat-alpha-1 \
	jclark-orig HEAD beta4 beta3 beta2"
FILES_TO_COMPARE=`find "${GUESS_FOLDER}" -name '*.c' -o -name '*.h'`

## Check out
for curTag in $TAGS ; do
	echo "Downloading tag ${curTag}..."
	folder="tag_$curTag"
	mkdir "${folder}" 2>/dev/null || continue
	cd "${folder}"
	cvs -z3 -d:pserver:[email protected]:/cvsroot/expat \
		co -r "$curTag" -P expat
	cd -
done

## Evaluate tags
printf "\nEvaluating tags...\n"
fileCount=`wc -w <<<"${FILES_TO_COMPARE}"`
for curTag in $TAGS ; do
	matches=0
	
	for fileOne in ${FILES_TO_COMPARE} ; do
		## Find
		fileName=`basename "${fileOne}"`
		fileTwo=`find "tag_${curTag}" -name "${fileName}"`
		if [[ "${fileTwo}" == "" ]]; then
			continue
		fi

		## Compare
		if diff ${fileTwo} ${fileOne} --ignore-all-space --brief \
				&>/dev/null ; then
			matches=$((matches + 1))
		fi
	done

	printf "%2d/${fileCount} matches for tag ${curTag}\n" "${matches}"
done
result.txt (text/plain, 1022 B)
14/18 matches for tag V20000512
 1/18 matches for tag V1_1
 0/18 matches for tag V1_0_2
 0/18 matches for tag V1_0_1
 0/18 matches for tag V1_0
 2/18 matches for tag V19991013
 1/18 matches for tag V19990728
 1/18 matches for tag V19990709
 1/18 matches for tag V19990626
 1/18 matches for tag V19990425
 1/18 matches for tag V19990109
 1/18 matches for tag V19981231
 0/18 matches for tag V19981122
 1/18 matches for tag V1990307
14/18 matches for tag sourceforge_init
 0/18 matches for tag REC1_0
 2/18 matches for tag R_2_0_1
 2/18 matches for tag R_2_0_0
 2/18 matches for tag R_1_95_8
 2/18 matches for tag R_1_95_7
 2/18 matches for tag R_1_95_6
 2/18 matches for tag R_1_95_5
 2/18 matches for tag R_1_95_4
 2/18 matches for tag R_1_95_3
 2/18 matches for tag R_1_95_2
 2/18 matches for tag R_1_95_1
 2/18 matches for tag R_1_95_0
14/18 matches for tag libexpat-alpha-1
14/18 matches for tag jclark-orig
 2/18 matches for tag HEAD
 0/18 matches for tag beta4
 0/18 matches for tag beta3
 0/18 matches for tag beta2