diff options
author | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2006-10-05 22:49:30 +0000 |
---|---|---|
committer | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2006-10-05 22:49:30 +0000 |
commit | ed6876df44176c95296a2c6943e6808cd9f5eff8 (patch) | |
tree | 827fc89b50589dba592ccd825ed0ad5546a5a2d1 /src | |
parent | 17c7b9bf562426e5137e43c62548ad116406448c (diff) | |
download | simplepkg-ed6876df44176c95296a2c6943e6808cd9f5eff8.tar.gz simplepkg-ed6876df44176c95296a2c6943e6808cd9f5eff8.tar.bz2 |
simplepkg 0.4.9pre4
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@13 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'src')
-rw-r--r-- | src/createpkg | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/src/createpkg b/src/createpkg index a360153..faa7e0e 100644 --- a/src/createpkg +++ b/src/createpkg @@ -60,6 +60,7 @@ function build_repo { function usage { echo "usage: createpkg [--install] package-name" + echo " createpkg --no-deps package-name" echo " createpkg --search package-name" echo " createpkg --sync" @@ -107,7 +108,7 @@ function solve_dep { found="0" fi - # TODO: check if the package is installed + # TODO: check if the package was built and installed } @@ -137,17 +138,26 @@ check_repo if [ -z "$1" ]; then safe_exit 4 -elif [ "$1" == "--sync" ]; then - sync_repo - exit -elif [ "$1" == "--search" ]; then - find_script $2 - exit -elif [ "$1" == "--install" ]; then - PACKAGE="$2" - INSTALL="1" -else +elif [ "$#" == "2" ]; then + if [ "$1" == "--sync" ]; then + sync_repo + exit + elif [ "$1" == "--search" ]; then + find_script $2 + exit + elif [ "$1" == "--install" ]; then + PACKAGE="$2" + INSTALL="1" + elif [ "$1" == "--no-deps" ]; then + NO_DEPS="1" + PACKAGE="$2" + else + safe_exit 4 + fi +elif [ "${1:0:1}" != "-" ]; then PACKAGE="$1" +else + safe_exit 4 fi if [ "$SYNC" == "yes" ]; then @@ -168,13 +178,15 @@ elif [ -f "$SCRIPT_BASE/slack-required" ]; then SLACK_REQ="$SCRIPT_BASE/slack-required" fi -if [ ! -z "$SLACK_REQ" ]; then +if [ ! -z "$SLACK_REQ" ] && [ "$NO_DEPS" != "1" ]; then cat $SLACK_REQ | while read dep; do - 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 + if [ ! -z "$dep" ]; then + 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 + fi done fi @@ -192,8 +204,8 @@ if [ "$_ARCH" == "noarch" ]; then ARCH="noarch" fi -# TODO: change to upgradepkg? if [ "$INSTALL" == "1" ]; then - installpkg $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz + # installpkg $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz + upgradepkg --install-new $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz fi |