diff options
| author | Jack Jamison <jackqjamison@gmail.com> | 2026-07-20 15:16:13 -0400 |
|---|---|---|
| committer | Jack Jamison <jackqjamison@gmail.com> | 2026-07-20 15:16:13 -0400 |
| commit | 0ad03c0647b94683c26045bbc143b0d6450d914f (patch) | |
| tree | 8aae29f86cebd7d567bca274e8fa43c388c89cea /snag/snagpkginfo.sh | |
| parent | 3ae746e5ac3f8feb80a8619127956fb93ba47ca0 (diff) | |
read package info into snag
Diffstat (limited to 'snag/snagpkginfo.sh')
| -rwxr-xr-x | snag/snagpkginfo.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/snag/snagpkginfo.sh b/snag/snagpkginfo.sh new file mode 100755 index 0000000..bb80418 --- /dev/null +++ b/snag/snagpkginfo.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +# reads a package description script and outputs the attributes in a format easy +# for the snag program to read. it does not do any other validation, and should +# not be used by other programs + +if [ -z "$1" ]; then + echo "Usage: $0 <description script>" >&2 + exit 1 +fi + +# load the description script +. $1 + +# output package attributes (type char, value, null delimiter) +echoatt() { [ -n "$2" ] && printf "$1$2\0"; } +echoatt i "$pkg_id" +echoatt n "$pkg_name" +echoatt d "$pkg_desc" |
