#!/bin/sh #------------------------------------------------------------------------------ # /var/install/bin/package_shlib - shell library for package handling # # Copyright (c) 2003 Maximilian Pasternak # # # Creation: 04.04.2004 mp # Last Update: 04.04.2004 mp # # 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. #------------------------------------------------------------------------------ ### package_shlib.parse_package() ### ### Parse eisfair package descriptor file ### ### [IN] $1 name of backup directory ### [OUT] 0 success ### 1 failure ### parse_package() { package_file=$1 if [ -f $1 ] then description_active=false package_description_n=0 while read a do case "$a" in ""*) ;; ""*) package_name=`echo "$a" | sed 's###g' | sed 's#^ *##g'` ;; ""*) package_short=`echo "$a" | sed 's###g' | sed 's#^ *##g'` ;; ""*) package_version=`echo "$a" | sed 's###g' | sed 's#^ *##g'` ;; ""*) package_date=`echo "$a" | sed 's###g' | sed 's#^ *##g'` ;; ""*) package_author=`echo "$a" | sed 's###g' | sed 's#^ *##g'` ;; ""*) package_status=`echo "$a" | sed 's###g' | sed 's#^ *##g'` ;; "
"*) package_section=`echo "$a" | sed 's###g' | sed 's#^ *##g'` ;; ""*) description_active=true ;; ""*) description_active=false ;; ""*) ;; *) if [ "$description_active" = true ] then package_description_n=`/usr/bin/expr $package_description_n + 1` eval 'package_description_'$package_description_n=\"`echo "$a"`\" fi ;; esac done <$package_file return 0 else return 1 fi }