crc check

Hello,

We're currently developing a automatic compile- and deploysystem. To avoid the compilation of files of which the crc won't change anyway, we would like to build in some kind of crc-check without compiling.
So my question : does there exist a routine to compare the crc-value of an existant r-file against the crc-value of a database? (or a table, but how do I know which table is beeing used?)
The alternative is to compile the file to a temp-dir, and compare the value of the 'fresh'-compiled file against the crc of the 'old' file.
 

Casper

ProgressTalk.com Moderator
Staff member
If you try to get the crc form the rcode then you must mean something like this:

define variable crc as integer.
rcode-info:file-name = file-name.
crc = rcode-info:crc-value.

But this value of the crc has got nothing to do with the crc values which are stored in the database.

The progress help says:
The CRC-VALUE attribute returns the r-code CRC value stored in the r-code. The calculation for this value is based on the filename and contents of the procedure file during compilation. This value is different from any database CRCs that are stored in the r-code. For more information on CRCs, see the Progress Programming Handbook.

A question form me though: The crc of the database changes only if you make changes to the schema. I think the logical thing to do if you make a new version is to compile all the sources. It cannot be you make new versions all the time, I suppose. So what is the gain of only compiling those sources who got tables in them which are changed? If you have many sources then you can compile overnight.

Casper.
 
Casper,

Thanks for the response. We develop allthough all the time, and 'release' new versions every moment of the day. (We only do in-house development)
All our client-code is stored in a bunch of pl-files (about 70 :) ) These pl-file are being copied to the client-side when they start a program which needs this file. To avoid the fact that every time, after a db-change (about once a month), we need to compile everything, we're looking to find some way to detect if a file needs to be compiled, or not.
The ideal way would be that we can call the progress-algoritm which triggers the crc-error-message.
An alternative is to compile the file, and compare its crc-value with the crc-value of the 'old' r-file. But this method is time-consuming.. :(
 

Casper

ProgressTalk.com Moderator
Staff member
Hi Dries,

I understand your problem, if you have that many database changes.

We have lots of includes we use, to keep track of them we have created a table which stores cross-reference information. It's filled with the output from XREF. From this table we can tell which include is used where. But we also can tell which tables are referenced in each procedure. Maybe it's an idea to make such a table yourself and compile only those programms which reference tables which are changed or added. You have to XREF each programm every time you release it for production to fill these tables and probably have to change your compile procedure but I think it can be fully automated this way.

Casper.
 

wibeag

New Member
[FONT=Arial,Italic]
From: OpenEdge Deployment: Managing 4GL Applications​

Example — Determining which files are affected by a database change:​
The following procedure demonstrates how you can use the​
RCODE-INFO system handle with the TABLE-LIST and TABLE-CRC-LIST attributes to help determine which files you need to recompile based upon a database change. TABLE-LIST generates a list of all the database tables that are
referenced in the procedure file.
TABLE-CRC-LIST generates a list of the corresponding table CRC values stored in the compiled procedure file. This example procedure then compares the CRC values in the procedure file with those stored in the database. If any of the values differ,
you get a message stating that the procedure needs to be recompiled, as shown:


DEFINE VARIABLE tbllst AS CHARACTER.
DEFINE VARIABLE crclst AS CHARACTER.
DEFINE VARAIBLE hBuff AS HANDLE.
DEFINE VARIABLE i AS INT.

RCODE-INFO:FILE-NAME = "main.r".
tbllst = RCODE-INFO:TABLE-LIST.
crclst = RCODE-INFO:TABLE-CRC-LIST.

REPEAT i = 1 TO NUM-ENTRIES(tbllst):
CREATE BUFFER hBuff FOR TABLE ENTRY(i, tbllst).
IF hBuff:CRC-VALUE = INTEGER(ENTRY(i, crclst))
THEN MESSAGE “main.r does not need to be recompiled”.
ELSE MESSAGE “main.r needs to be recompiled”.
DELETE OBJECT hBuff.
END.

Peter B.
Wibeag AG​
[/FONT]
 

PDECODE

Active Member
Some time ago i develop small utility which can check if source (+ includes) was changed against rcode or if you have database CRC dump then it can also check rcode against database CRC. There are also other interesting checks.

It's small, no installation, Win32 and freeware :)

Check http://progress-tools.x10.mx/rchecker.html
 
Top