Compare files between on-rev and local versions
Alex Tweedly
alex at tweedly.net
Sat Jun 20 20:08:08 EDT 2009
I've seen a couple of requests for this on the on-rev forums, and had
the same need myself. So I've developed a stack + irev to do this for
me. It consists of two parts :
- a rev stack (aka the client)
- a .irev file to place somewhere within your on-rev site
When you run the client stack, it will use the .irev file to retrieve
info about the files within your site, and then compare against against
the local versions of the (hopefully same) files.
The stack can be downloaded from
http://www.alextweedly.on-rev.com/Downloads/AllFilesInfoClient.rev
The irev file is embedded within the stack - click on the "iRev" button
and it will create (in the same directory) a file called
allfilesinfo.irev - this should be uploaded to your site.
When you run the client, you give it the path to your local directory,
and the url (without the "http://") to the place where you put the
allfilesinfo.irev
You can (and should) verify the remote url has been uploaded properly,
by checking with your browser (e.g. for me, I look at
http://www.alextweedly.on-rev.com/allfilesinfo.irev ) - the client will
use this same url to get the info about the files on the server. This
irev script will walk the entire directory below where it is installed,
and store in each directory a file containing the detailed files info,
plus the md5digest of each file. Note that subsequent runs will compare
modification dates, and only re-generate the md5 hash for those files
which have changed, so it is substantially faster than the first time.
The client does the same thing - generates files containing the detailed
file info plus the md5 hash of each file. It then compares this against
the remote info; it will complain ONLY if it finds matching files in the
equivalent directories which do not have the same md5 hash.
The script should be fairly easy to follow, even if it is a bit untidy.
One of the things that I hope will settle down (and be improved) is the
best way to share code between irev files and stacks.
Any feedback welcome
-- Alex.
More information about the use-livecode
mailing list