From 86af4e8487f27dd69863b1380fe17e841605214f Mon Sep 17 00:00:00 2001 From: Jack Jamison Date: Mon, 20 Jul 2026 15:56:56 -0400 Subject: improvements and fixes --- snag/get_pkg_attrs.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 snag/get_pkg_attrs.sh (limited to 'snag/get_pkg_attrs.sh') diff --git a/snag/get_pkg_attrs.sh b/snag/get_pkg_attrs.sh new file mode 100755 index 0000000..bb80418 --- /dev/null +++ b/snag/get_pkg_attrs.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 " >&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" -- cgit v1.2.3