https://github.com/openlink/vadpacker
OpenLink's VAD Packer is a standalone tool to speed up building .vad archives for OpenLink Virtuoso
https://github.com/openlink/vadpacker
Last synced: 4 months ago
JSON representation
OpenLink's VAD Packer is a standalone tool to speed up building .vad archives for OpenLink Virtuoso
- Host: GitHub
- URL: https://github.com/openlink/vadpacker
- Owner: openlink
- License: gpl-2.0
- Created: 2015-10-27T11:43:47.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-12-31T11:43:36.000Z (over 1 year ago)
- Last Synced: 2025-12-23T00:25:23.196Z (6 months ago)
- Language: Python
- Size: 104 KB
- Stars: 5
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- Changelog: ChangeLog
- License: COPYING
- Authors: AUTHORS
Awesome Lists containing this project
README
OpenLink Virtuoso VADPacker
===========================
OpenLink's vadpacker is a small python tool which allows to create Virtuoso VAD packages from a sticker
file template. This template can contain variables and resource tags which use file globbing.
Variables
---------
The sticker file can contain any variable at any point in the file. Variables are marked with enclosing
$ characters.
Example:
Values for these variables are specified on the command line as follows:
vadpacker.py --var="VERSION=1.0" ...
The following variables are replaced with default values if nothing is specified on the commandline:
- `PACKDATE`: Will be replaced with the current date and time formatted according to `%Y-%m-%d %H:%M`
- `HOME`: Will be replaced with the current home directory (env variable `HOME` on *NIX systems)
Resource Globbing
-----------------
Vadpacker supports powerful resource globbing to simplify the resource list in a sticker template.
The most simple resource globbing looks as follows:
This will list all PNG images from the current folder and create resource entries for them. The trailing
slash in the `target_uri` attribute will make vadpacker append the relative path. Thus, if the current folder
would contain files `one.png` and `two.png` the resulting resource lines would look as follows (other attributes
have been removed for readability:
The same can be achieved by using the `$p$` variable which will be replaced with the relative path of the source
file:
In contrast to the `$p$` variable `$f$` will be expended to the filename only. This is useful when creating entries
in which the target folder differs from the source folder. A typical example could look as follows:
Finally vadpacker supports *recursive globbing* which is enabled through the usage of the special pattern `**/`:
This will recursively find all PNG files and put them into the images folder using the relative path. It includes
files in the `images` folder, meaning `**/` expands to any sub-folder and the empty string.
_Tip:_ If the source files reside in a subfolder which should not be included in the target urls, then the *--prefix*
option is the solution. Using it is comparable to changing into the directory and then executing vadpacker.
Resource selection via Inline Scripts
-------------------------------------
A powerful but also potentially dangerous feature of the vadpacker is the selection of resources via arbitrary shell
script execution. This is achieved by replacing the source_uri pattern with a shell command like in the following
example:
This will find all .png files in the current folder excluding any file named *notme.png*.
Default Resource Values
-----------------------
To make sticker templates even simpler to read and maintain vadpacker uses the following default for resource
attributes:
- `overwrite` = `yes`
- `type` = `dav`
- `source` = `data`
- `dav_owner` = `dav`
- `dav_grp` = `administrators`
- `dav_perm` = if the file extension is one of `.vsp`, `.vspx`, or `.php` the default is `111101101NN`, otherwise `110100100NN`