#!/bin/sh #---------------------------------------------------------------------------- # /var/install/bin/include/test-packagelib - shows packagelib test output # # Copyright (c) 2005 The Eisfair Team, c/o Frank Meyer, frank(at)eisfair(dot)org # # usage: ./test-packagelib package_name # # Creation: 30.11.2005 jed # Last Update: $Id$ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- . /var/install/include/eislib . ./packagelib ### main #### printvar () { eval output='$'${1} echo "${1}=\"${output}\"" } output () { printvar "${1}_PACKAGE_NAME" printvar "${1}_PACKAGE_SHORT" printvar "${1}_PACKAGE_DATE" printvar "${1}_PACKAGE_VERSION" printvar "${1}_PACKAGE_STATUS" printvar "${1}_PACKAGE_SECTION" printvar "${1}_PACKAGE_SHA1SUM" printvar "${1}_PACKAGE_AUTHOR" printvar "${1}_PACKAGE_DESCRIPTION" printvar "${1}_PACKAGE_REQUIRE_PACKAGE_N" eval tmp='$'"${1}_PACKAGE_REQUIRE_PACKAGE_N" for idx in `seq $tmp` do printvar "${1}_PACKAGE_REQUIRE_PACKAGE_${idx}_PACKAGE" printvar "${1}_PACKAGE_REQUIRE_PACKAGE_${idx}_VERSION" done printvar "${1}_PACKAGE_REQUIRE_LIB_N" eval tmp='$'"${1}_PACKAGE_REQUIRE_LIB_N" for idx in `seq $tmp` do printvar "${1}_PACKAGE_REQUIRE_LIB_${idx}_PACKAGE" printvar "${1}_PACKAGE_REQUIRE_LIB_${idx}_VERSION" done printvar "${1}_PACKAGE_SUB_PACKAGE_N" eval tmp='$'"${1}_PACKAGE_SUB_PACKAGE_N" for idx in `seq $tmp` do printvar "${1}_PACKAGE_SUB_PACKAGE_${idx}_PACKAGE" printvar "${1}_PACKAGE_SUB_PACKAGE_${idx}_PARAM" done } clrhome mecho -warn "1. test without prefix..." infofile="../packages/_test_packagelib" [ "$1" != "" ] && infofile="$1" parse_infofile $infofile output '' anykey clrhome mecho -warn "2. test with prefix 'DUMMY'..." parse_infofile $infofile DUMMY output 'DUMMY' anykey clrhome mecho -warn "3. test with old/erroneous packagefile format (TABs and Blanks)" infofile="../packages/_test_packagelib_badstyle" parse_infofile $infofile output '' anykey clrhome mecho -warn "4. test with bad packagefile format (TABs and Blanks)" infofile="../packages/_test_packagelib_space" parse_infofile $infofile output '' anykey