Did you know ... Search Documentation:
hotfix.pl -- Load hotfixes into executables
PublicShow source

This library was developed to deal with hotfixing products that are distributed as a Prolog saved state. It assumes the vendor is willing to distribute hotfixes as Prolog source files. These files are placed into a directory. The predicate load_hotfixes/1 replaces files that are loaded into the saved state.

Resolution of the file to load is based on the module if the hotfix file provides a module. If the hotfix file is not a module file and there are multiple loaded source files with the same name from different directories, the hotfix directory must create the minimal directory structure to make the paths unique. If omitted, this library will prompt the user for the file that must be replaced.

author
- Jan Wielemaker
To be done
- This could be extended in several ways:
  • Load hotfixes from a (encrypted) zip file
  • Use digital signatures and load over HTTP
  • Replace individual predicates
Source load_hotfixes(+Dir) is det
Load all hotfixes that have not yet been applied into the current state.
Source prolog_source_files(+Dirs)// is det[private]
Find all Prolog source files in the given directory.
Source apply_hotfix(+HotfixDir, +File) is det[private]
Locate the hotfix and load it if it is newer. First step to find the file we must replace is using the module name, as these are guaranteed to be unique in the Prolog process. If that fails, we use the filename, but now we can get multiple files with the same name loaded from different directories as candidates. Finally, if no file matches, we load the file into the user module.
Source ensure_dirsep(+Dir, -DirSlash) is det[private]
Source load_hotfix(+HotfixFile, +Loaded) is det[private]
Reload the HotfixFile, pretending we are reloading Loaded.
See also
- make:reload_file/1
Source select_file_to_reload(+Pairs, +Local, -Pair) is det[private]
Source file_module(+File, -Module) is semidet[private]
True if Module is the module defined in File.