]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
some TODOs on createpkg
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Thu, 28 Sep 2006 21:58:51 +0000 (21:58 +0000)
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Thu, 28 Sep 2006 21:58:51 +0000 (21:58 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@11 04377dda-e619-0410-9926-eae83683ac58

src/createpkg

index 45fb3293f1a55b953235cccfd6012d6d1d4d4512..59368871e93a35f9c35b8ec112e5a6e3e4f6ea7e 100644 (file)
@@ -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