4.3. Updating the database

Updating the database of printers consists of 2 steps. First, PPD files that were removed and files that were changed from the database, and then add files that aren't present in the database into it.

To detect if a PPD file was changed, first, the date of the last change is compared to the date the database file was written the last time. If the file itself (or a directory above it) was changed, the second check is performed. Otherwise, the file is treated as unchanged.

The way second check is done depends on the situation. If the check is performed during installation of the system, just size of the file is compared with the information in the database. Otherwise, the MD5 checksum is compared. If they are equal, the PPD file is treated as unchanged, otherwise it is removed from the database and added again.