WoofyDugfock
Group: Members
Posts: 146
Joined: Sep. 2004 |
|
Posted: Mar. 22 2005,08:57 |
|
1. For finding duplicates I've just been trying out the very good duplifinder.sh (http://mwynwood.com/blog/?page_id=12).
This compares md5 hashes of all files in the argument paths so for example I just found two pairs of identical library files with different names (and one pair were not symlinks) inside the .dsl I'm trying to make (BTW my first .dsl!).
This seems useful given that there are (as I just discovered) libs sharing the same basename in different locations but having very different contents eg stdio.h
To find files that are identical & common to ~/expanded_tarball and eg /usr/local/lib, just ./duplifinder.sh -d ~/expanded_tarball /usr/local/lib
BTW duplifinder.sh appears to need gnu-utils.dsl to be installed.
2. To quickly scan for possible duplicates on the system against an unpacked .dsl's dirlist.txt, I'm trying the following with dirlist.txt as the argument:
#!/bin/bash # possduplicate.sh { echo "The following files have the same basename as those listed in $1:" while read LN; do find / -name `basename $LN` -print 2>/dev/null done <$1 } >possible_duplicates.txt
3. To find libs etc that are not mentioned in the source code (and hence are only ? for configure/make/install or other ancillary use), I've moved the src out of the unpacked tarball (not a .deb obviously) into another directory and deleted the files that look like Makefile.c, deleted all libs & imports themselves from the remaining unpacked tarball directory, removed the path to the binary itself from the WIP .dsl's dirlist.txt, and then ran:
#!/bin/bash # Identify libs that are only used for configure/make/install. # Search configure/make/install argument directories $2 for # instances of basenames of files listed in argument $1 that are not # mentioned in src $3.
{ while read LN; do ENDNM=`basename $LN` if grep -r -q $ENDNM $2; then if ! grep -r -q $ENDNM $3; then echo "$ENDNM was found in $2 but not $3." fi fi done <$1 } >poss_buildonly_libs.txt
Can then consider deleting the unneeded libs etc from dirlist.txt before packing the .dsl (after all the files are installed where they should be). This last one is probably a bit iffy/naive/risky for all I know.
Dunno if the above is of interest but there it is. Probably old news.
-------------- "We don't need no stinkin' Windows"
http://news.zdnet.co.uk/software/linuxunix/0,39020390,39149796,00.htm
|