#!/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"; return 0; } echoatt i "$pkg_id" echoatt n "$pkg_name" echoatt d "$pkg_desc" echoatt w "$pkg_webpage" echoatt l "$pkg_license" echoatt v "$pkg_version" echoatt s "$pkg_source_name" echoatt u "$pkg_source_url" echoatt c "$pkg_source_checksum"