Patching problem

Hi there!!

Think of this situation...
I've developed a package say 3yrs back.....now i modified that package and want to give it as patch format....now is there any way to find out what all have been changed since last package....because I want to give only those things which r modified or added in the old package as a patch....

Arun.
LVL 1
arunks080299Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ygal02Commented:
The answer is: Usually Yes !
Is you want to know how would have to post more detailed description of your package (what language, what is it's structure, what OS, sample code maybe, etc.) This way maybe we can help.
ygal02Commented:
Correction:
The answer is: Usually Yes !
If you want to know how, you would have to post more detailed description of your package (what language, what is
it's structure, what OS, sample code maybe, etc.). This way maybe we can help.
arunks080299Author Commented:
ok...

Language : C
OS : Linux/Solris/HPUnix
Structure : ????

Get Blueprints for Increased Customer Retention

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

ygal02Commented:
>>Structure: ????
What does your package contains ?
Is it a tar/gzip file that contains executables & data, is it a directory containing source code that you want to be updated (with it's makefile> or (my best guess)
You want the new archive to be opened at the users site and overwrite the old files.
How do you pack it ? (or do you need a suggestions for that ?)
In that case - my advice is to use tar/gzip + an installation script (that will also check for old versions).
Did I understand you properly ?
arunks080299Author Commented:
>>Structure: ????
>What does your package contains ?

>Is it a tar/gzip file that contains executables & data,

Ans :Yes, it contains binaries and data files in a directory structure...

>is it a directory containing source code that you want to be updated (with it's makefile> or (my best guess)

Ans :No, I don't want to give my source code to anyone.

>You want the new archive to be opened at the users site and overwrite the old files.

Ans :Yes..

How do you pack it ? (or do you need a suggestions for that ?)

Ans :depends on package manager..but thats not included in my question.

>In that case - my advice is to use tar/gzip + an installation script (that will also check for old versions).
Ans :this is exactly what i'm doing..but in some other way..                  

>Did I understand you properly ?
Ans :I think u should read the question again.

Actually is not in installing the package..but it lies before that..

See i have a package say myPkg.1.2.3 ..ok?

Now there were some bugs in it...and i fixed them..but it didn't change the whole package..only a few files got modified..(Ya I used Makefile for all this)..but now Instead of giving the whole package myPkg.1.2.3 I want to give them myPkg.1.2.4 which is nothing but the collection of files which r modified..in the form of a patch and not the whole package.

Now the problem is to findout. which all files have been changed..(i mean not the source code files...but the binaries and data files).. so that i can put them together in a patch format..

Now i guess u did..:)
ygal02Commented:
My advice:
1. If you know the date of the last version check for the binaries change date and take only the new files.
2. If you have the old version it is easier. Just activate the "diff" function on every file of the package and send it's output to /dev/null, check the status system variable after each diff action to know if any difference where find (so the file was changed).
I hope this helps, (let me know if not enough...)
arunks080299Author Commented:
What if there are more than 1000 files at different structure...let it be of any size..

"diff" just do the ascii comparison..don't know if it work for binaries
arunks080299Author Commented:
What if there are more than 1000 files at different structure...let it be of any size..

"diff" just do the ascii comparison..don't know if it work for binaries

There are so many files...Keep the VOLUME also in mind.
ygal02Commented:
>>"diff" just do the ascii comparison. don't know if it work for binaries.
It is ! Diff can compare binaries. In this case it doesn't print the differences but just if they are differ or not. All you have to do is check the $status after the diff action:
$status == 1 -> Files are different
$status == 0 -> Files are identical.
For comparing 1000 files you can use the find command it will give you every file in a specific directory.
Let's say you have dir new and dir old for your packages:

#!/bin/csh
set NEW = directory of new package
set OLD = directory of old package
cd $NEW
forech file (`find .`)
diff $file $OLD/$file
if ($status == 1) then
    echo "File $file was changed..."
endif
end

Good Luck !

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
arunks080299Author Commented:
Thanks ygal02.

I didn't know about the "status"..thanks a lot
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.