diff options
author | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2006-09-28 21:58:51 +0000 |
---|---|---|
committer | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2006-09-28 21:58:51 +0000 |
commit | 6dff2a081642bde6615ac568c54a2dfd5126ff6d (patch) | |
tree | 0b4075afbd4a46bf1f72d550c95f76531d9e59b7 /src | |
parent | b3d1ec7af90de9d07688415db0eabe81dd3aeea2 (diff) | |
download | simplepkg-6dff2a081642bde6615ac568c54a2dfd5126ff6d.tar.gz simplepkg-6dff2a081642bde6615ac568c54a2dfd5126ff6d.tar.bz2 |
some TODOs on createpkg
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@11 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'src')
-rw-r--r-- | src/createpkg | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/createpkg b/src/createpkg index 45fb329..5936887 100644 --- a/src/createpkg +++ b/src/createpkg @@ -62,7 +62,7 @@ function usage { echo "usage: createpkg [--install] package-name" echo " createpkg --search package-name" echo " createpkg --sync" - + } function check_config { @@ -85,6 +85,14 @@ function solve_dep { # TODO: solve dep with version checking pack="$1" + cond="$2" + ver="$3" + + if [ "$cond" != "equal" ] && [ "$cond" != "less" ] && [ "$cond" != "equalorgreater" ] && [ "$cond" != "lessequal" ] && [ ! -z "$cond" ]; then + # TODO: error + false + fi + for candidate in `ls /var/log/packages/$pack* 2> /dev/null`; do candidate="`package_name $candidate`" if [ "$pack" == "$candidate" ]; then @@ -99,6 +107,8 @@ function solve_dep { found="0" fi + # TODO: check if the package is installed + } function check_repo { @@ -161,8 +171,10 @@ fi if [ ! -z "$SLACK_REQ" ]; then cat $SLACK_REQ | while read dep; do - dep="`echo $dep | sed -e 's/>=/equalorgreater/' -e 's/=</equalorless/' -e 's/</less/' -e 's/>/greater/' -e 's/=/equal/'`" - solve_dep $dep + program="`echo $dep | awk '{ print $1 }'`" + condition="`echo $dep | awk '{ print $2 }' | sed -e 's/>=/equalorgreater/' -e 's/=</equalorless/' -e 's/</less/' -e 's/>/greater/' -e 's/=/equal/'`" + version="`echo $dep | awk '{ print $3 }' | tr -dc '[:digit:]'`" + solve_dep $program $condition $version done fi @@ -170,6 +182,8 @@ fi cd $SCRIPT_BASE INTERACT=no ./`basename $BUILD_SCRIPT` +# TODO: check slackbuild exit status code + VERSION="`grep -e '^VERSION=' $BUILD_SCRIPT | head -n 1 | sed -e "s/VERSION//g" -e 's/=//g' -e 's/-//g' | cut -d ":" -f 2 | cut -d "}" -f 1`" BUILD="`grep -e '^BUILD=' $BUILD_SCRIPT | head -n 1 | sed -e "s/BUILD//g" -e 's/=//g' | cut -d ":" -f 2 | cut -d "}" -f 1`" _ARCH="`grep -e '^ARCH' $BUILD_SCRIPT | head -n 1 | cut -d "=" -f 2 | sed -e 's/"//g'`" @@ -178,6 +192,7 @@ if [ "$_ARCH" == "noarch" ]; then ARCH="noarch" fi +# TODO: change to upgradepkg? if [ "$INSTALL" == "1" ]; then installpkg $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz fi |