[plug] diff scripting question

Anthony J. Breeds-Taurima tony at cantech.net.au
Mon Jun 25 08:53:30 WST 2001


On Sun, 24 Jun 2001 psteege at tpg.com.au wrote:

> I have two directory structures.  A working one and an archive.
> I wanted to see which files had changed between builds.
> I tried doing "diff -r -s directory1 directory2 > diffs_file.txt
> This worked but it also did a diff on executable and data files which
> made the diffs_file.txt gigantic.


create a file called "dontdiff"
which contains lines like
*~
*.a
*.o
*.orig
*.rej
*.ver
*.bin

And any other shell patterns you DONT want included in your patch.

Then
diff -urN -X dontdiff archive-copy new-code > /tmp/patch

That create your patch but it will exclude the files that match dontdiff

You may find it is usefull to do a a make clean before running the diff also.
Or create a special make target that just takes out the executables.

> I am trying to create a script that will search down a directory,
> from where I am currently located and find all non-executable files
> (type text or command script..etc) and diff them against their same
> name in another directory.
> The part I am having trouble with is how I can determine which ones
> are not data files.
> I know I can use the "file" command to determine type, but is there
> another linux command that identifies them?

Cant really help with this second option BUT using the nice features of diff
you should be able to get what you need.

I mean it works for the kernel so I'm sure you can get it going for your code.

Yours Tony.

/*
 * "The significant problems we face cannot be solved at the
 * same level of thinking we were at when we created them."
 * --Albert Einstein
 */




More information about the plug mailing list