Make Checksums

mkchecksums.pkt is a simple Pikt script to generate a PIKT checksums specification file (see, for example, checksums_redhat_linux_objects.cfg).

As with other scripts, we source this script from the programs.cfg PIKT configuration file (or perhaps a mkchecksums_programs.cfg #include file; not shown).  The end-use, target script follows.

#!/pikt/bin/pikt

# mkchecksums.pkt - make a checksums objects file
#
#   $ARGV[1] refers to a list of directories enclosed in quotes, e.g.,
#
#   mkchecksums.pkt "/bin /usr/bin /sbin /usr/sbin /usr/local/bin"

if #popen(FIND, "find $ARGV[1] -type f -print", "r") != #err()
        while #read(FIND) > 0
                output $checksum(5, $rdlin)
        endwhile
        do #pclose(FIND)
else
        output "can't open process for reading!"
        quit
endif

We suggest that you make separate bin & lib checksum files, as in

# /pikt/lib/programs/mkchecksums.pkt "/bin /usr/bin /sbin /usr/sbin /usr/local/bin" >
  /pikt/lib/configs/objects/adm/checksums_bin_suse_linux_objects.cfg
# /pikt/lib/programs/mkchecksums.pkt "/lib /usr/lib /usr/local/lib" >
  /pikt/lib/configs/objects/adm/checksums_lib_suse_linux_objects.cfg

then reference these in a higher-level checksums_suse_linux_objects.cfg file.

Note that some additional cleanup may be required.

For more examples, see Samples.

Home | FAQ | News | Intro | Samples | Tutorial | Reference | Software
Developer's Notes | Licensing | Authors | Pikt-Users | Pikt-Workers | Related Projects | Site Index | Privacy Policy | Contact Us
Page best viewed at 1024x768 or greater.   Page last updated 2019-01-12.   This site is PIKT® powered.
Copyright © 1998-2019 Robert Osterlund. All rights reserved.
Home FAQ News Intro Samples Tutorial Reference Software
PIKT Logo
PIKT Page Title
View sample
mtime
changes
Pikt script