patchinstall

Package: WA2L/edrc 1.5.57
Section: Maintenance Commands (1m)
Updated: 10 April 2025
Index Return to Main Contents

 

NAME

patchinstall - patch a WA2L/edrc installation

 

SYNOPSIS

edrc/lib/patchinstall [ -h ]

patchinstall [ -n | -m ] -f patch_file

patchinstall -i | -I [ number ]

 

AVAILABILITY

WA2L/edrc

 

DESCRIPTION

patch a WA2L/edrc installation with a patch_file generated by pack(1m).

patchinstall also cleans up corpses of previous application installations. Corpses are files and/or directories that were part of the application, but are no longer used, are out of date (as: the .PDF manual pages of older versions in the edrc/doc/ directory or older versions of installed binaries) or are no longer needed due to design changes in the application.

In the default configuration the files to be patched and the identified corpses are backuped prior to the installation/removal of the files.

The backup behaviour, the logfile detail depth and other settings are configurable in the configuration file patchinstall.cfg that is read prior to the installation of the files that are part of the patch_file.

When patchinstall is invoked, the following steps are performed:

1.)
print system information. This includes information as the patch_file to be installed, if patchinstall is invoked with the -n option, and other information about the system where the patch will be applied.

2.)
print the patch meta data. This information is also available in the directory edrc/var/pack/sadm/ for each installed patch.

3.)
backup the files residing in the application directory to be patched. In the active configuration file patchinstall.cfg can be configured if the files to be patched should be backuped or not.

4.)
purge backuped patched files. The number of kept backup file versions (generations) and if the purging of the backup files should take place at all can be configured in the patchinstall.cfg configuration file.

5.)
install the patch files.

6.)
update timestamps of symlinks that are part of the patch. This feature is not available on all operating systems. On systems where changing of symlink timestamps is not possible, the symlink will have the timestamp of the patch installation.

7.)
evaluate corpses in the current installation. The corpses are evaluated on each system. There is no master file list used in a patch or the application to identify corpses. This makes it possible, that own added files are not rated as a corpse. If there are doupts if a certain file would be rated as a corpse by a patch to be installed, it is possible to run patchinstall in the NOEXECUTE mode (patchinstall -n -f patch_file), where no actions are performed, but all messages are printed to stdout.

8.)
backup files that where identified as corpses. In the active configuration file patchinstall.cfg can be configured if the files identified as corpses should be backuped or not previous to the removal.

9.)
purge backuped corpses. The number of kept backup file versions (generations) and if the purging of the backup files should take place at all can be configured in the patchinstall.cfg configuration file.

10.)
remove the corpses from the application installation.

11.)
re-run step 5.) and 6.) if step 5.) terminated with errors.

The backups are written to the backup directory in the *.cpio.gz format, that can be viewed using the lscomp(1), llcomp(1) and catcomp(1) commands.

 

OPTIONS

-h
usage message.

-n
NOEXECUTE. This option causes that no actions are performed, but all messages are printed. This can be used to check the consequences of a patch installation.

-m
only print meta-data of the patch. This option can also be used to verify if the file is really an WA2L/edrc patch-file.

-l
only list the files contained in the patch.

-f patch_file
patch file to be installed. The patch_file has to be specified with an absolute path.

-i
list installed patches based on the patchinstall log file.

-I
print last installed patch in record format.

number
number of most recent patches to list; default is 1,

 

ENVIRONMENT

-

 

EXIT STATUS

0
no error.

1
patch_file does not exist.

2
error evaluating the files that are part of the WA2L/edrc installation.

3
error evaluating the static files of the WA2L/edrc installation.

4
usage listed.

5
sadm file not found in patch_file, this indicates, that the patch_file is not a WA2L/edrc patch.

6
configuration file patchinstall.cfg does not exist.

7
command aborted, as pressing Ctrl+C.

 

FILES

edrc/etc/patchinstall.cfg
configuration file for patchinstall.

 

EXAMPLES

1) remove corpses of an installation

If you want to clean up corpses on an existing installation without installing a WA2L/edrc patch of a newer version, create a patch to the current version you have installed and then install this patch you just created on the same system:

[ /root ]
[ root@acme001 ][*edrc*/bash]: pack -p `~edrc/sbin/edrc -V`

pack - create application package, by Chr. Walther

create package of application in '/opt/edrc' ...
    application information ...
        APPLICATION .......... : default
        APPLICATION_PREFIX ... : edrc_WA2L
        APPLICATION_NAME ..... : WA2L/edrc
        APPLICATION_RELEASE .. : 1.5.10
        DESCRIPTION .......... : WA2L/edrc complete
    done.
    package information ...
        format ............... : shar
        type ................. : PATCH (to version 1.5.10)
        file ................. : /tmp/edrc_WA2L-1.5.10-200809071349-PATCH-1.5.10.cpio.gz
    done.
    write sadm file ...(/opt/edrc/var/pack/sadm/edrc_WA2L-1.5.10-200809071349-PATCH-1.5.10.gz)... done.
    evaluate files to be packed ...(9 files)... done.
    evaluate properties of files to be packed ... done.
    pack files to package file ...(6.98535 kBytes)... done.
done.

[ /root ]
[ root@acme001 ][*edrc*/bash]: patchinstall \
                                  -f /tmp/edrc_WA2L-1.5.10-200809071349-PATCH-1.5.10.cpio.gz

patchinstall - patch a WAL2/edrc installation, by Chr. Walther

install patch to application in '/opt/edrc' ...
    system information ...
       :
       :
    done.
    patch meta data ...
       :
       :
    done.
    backup files to be patched ...
       :
       :
    done.
    purge backuped patched files ...
       :
       :
    done.
    install patch files ...
       :
       :
    done.
    update symlink timestamps ...
       :
       :
    done.
    backup corpses to be removed ...
       :
       :
    done.
    purge backuped corpses ...
       :
       :
    done.
    remove corpses ...
       :
       :
    done.
done.

 

SEE ALSO

edrcintro(1), edrcsetup(1m), catcomp(1), lscomp(1), llcomp(1), pack(1m), patchinstall.cfg(4), stat(3)

 

NOTES

Due to the fact, that an installation of a patch_file using patchinstall does not cause additional command invocations (as: pre- or post-exec scripts), a patch can be applied multiple times to an application installation without side effects.

 

BUGS

-

 

AUTHOR

patchinstall was developed by Christian Walther. Send suggestions and bug reports to wa2l@users.sourceforge.net . 

 

COPYRIGHT

Copyright © 2013 Christian Walther

This is free software; see edrc/doc/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


 

Index

NAME
SYNOPSIS
AVAILABILITY
DESCRIPTION
OPTIONS
ENVIRONMENT
EXIT STATUS
FILES
EXAMPLES
SEE ALSO
NOTES
BUGS
AUTHOR
COPYRIGHT

This document was created by man2html using the manual pages.
Time: 19:41:07 GMT, April 10, 2025