[go: up one dir, main page]

Menu

[r5]: / trunk / apk_meta  Maximize  Restore  History

Download this file

50 lines (38 with data), 697 Bytes

#!/bin/sh

VERSION=0.0.9

. ${APKLIBS:="/lib/apk"}/apkfuncs.sh

usage() {
	echo "apk_meta $VERSION"
	
}

available_meta() {
	local pkgv
	pkgv=$1
	tar -ztf $APKDB/${pkgv}-meta.tar.gz
}

edit_control() {
	local meta pkgv
	meta=$1
	pkgv=$2
	if [ -z $EDITOR ] ; then
		EDITOR=vi
	fi
	decompress_meta
	$EDITOR $APKDB/${pkgv}.$meta
	compress_meta
}

add_meta() {
	local metafile pkgv
	metafile=$1
	pkgv=$2
	if basename $metafile | grep "^$pkgv" > /dev/null ; then
		decompress_meta
		cp $metafile $APKDB
		compress_meta
	else
		echo "$metafile filname does not correspond to $pkgv" >&2
		echo "Please use a filname like: $pkgv.<meta>" >&2
		exit 1
	fi
}


echo "To be continued..."
edit_control $1 $2