Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (6) </ 1 2 3 4 5 [6] >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: .dsl file editing utilities, a little automation never hurts< Next Oldest | Next Newest >
WoofyDugfock Offline





Group: Members
Posts: 146
Joined: Sep. 2004
Posted: Mar. 11 2005,07:44 QUOTE

Pls ignore - posted in error

--------------
"We don't need no stinkin' Windows"

http://news.zdnet.co.uk/software/linuxunix/0,39020390,39149796,00.htm
Back to top
Profile PM 
clacker Offline





Group: Members
Posts: 570
Joined: June 2004
Posted: Mar. 16 2005,15:55 QUOTE

Heres what I came up with for finding duplicates between files like a new dsl and gtk2.dsl or tcltk.dsl:

Code Sample
#!/bin/bash
#
# find duplicates between two dsl files
#
tar -tzf $1 > files1
tar -tzf $2 > files2
cat files1 | while read i
do
   grep $i files2
done


I think the problems I was having before was due to an additional ./ placed in front of the lines of my files by the old deb2dsl script.  This worked for me.  It could stand some error checking like are there two command line arguments and do they end in dsl or tar.gz, but I couldn't make that work.  My bash chops ain't up to snuff.

I also wrote one to find duplicates between the dsl file and the system.  What's nice here is if you unpack the dsl to a temporary directory and run this script, you not only see the file names, but a list of details for the existing file and the file in the dsl.  The differences pop out (different sizes, same name but linked to a different file)

Code Sample
#!/bin/bash
#
# find duplicates between two dsl files
#
rm -f sysdups
tar -tzf $1 > files
cat files | while read i
do
   if [ -e /$i ]
   then
       echo $i >> sysdups
   fi
done

cat sysdups | while read i
do
   echo
   ls -l /$i
   if [ -e $i ]; then ls -l $i; fi
done
Back to top
Profile PM 
WoofyDugfock Offline





Group: Members
Posts: 146
Joined: Sep. 2004
Posted: Mar. 22 2005,08:57 QUOTE

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
Back to top
Profile PM 
27 replies since Oct. 04 2004,00:17 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (6) </ 1 2 3 4 5 [6] >/
reply to topic new topic new poll
Quick Reply: .dsl file editing utilities

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code