aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2006-11-10 22:32:38 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2006-11-10 22:32:38 +0000
commit8164018d0940b8cc542cb5995a1e7c85187bbdb7 (patch)
tree09612ad6aed56f3788936b4f42ccbac7cacabae8 /src
parent87552a5d93c064e38b74ac0468d014b4bc33f39c (diff)
downloadsimplepkg-8164018d0940b8cc542cb5995a1e7c85187bbdb7.tar.gz
simplepkg-8164018d0940b8cc542cb5995a1e7c85187bbdb7.tar.bz2
start to apply changes from the huge TODO list
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@25 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'src')
-rwxr-xr-xsrc/jail-upgrade16
-rwxr-xr-xsrc/simplaret22
2 files changed, 25 insertions, 13 deletions
diff --git a/src/jail-upgrade b/src/jail-upgrade
index c33180c..df6e013 100755
--- a/src/jail-upgrade
+++ b/src/jail-upgrade
@@ -108,14 +108,14 @@ elif [ -d "$JAIL_ROOT/$1" ]; then
else
echo error: jail $JAIL_ROOT/$1 dont looks like a slackware system
fi
-# elif [ -f "$1" ]; then
-# basename="`basename $1 tgz`"
-# if [ "`basename $1 | sed -e "s/^$basename//"`" == "tgz" ]; then
-# # TODO:
-# # - descobrir a arquitetura do pacote
-# # - atualizar nas jaulas de mesma arquitetura
-# true
-# fi
+ elif [ -f "$1" ]; then
+ basename="`basename $1 tgz`"
+ if [ "`basename $1 | sed -e "s/^$basename//"`" == "tgz" ]; then
+ arch="`package_arch $1`"
+ # TODO
+ # - atualizar nas jaulas de mesma arquitetura
+ true
+ fi
else
echo "error: jail $0 does not exist"
exit 1
diff --git a/src/simplaret b/src/simplaret
index cdcf430..797c2d6 100755
--- a/src/simplaret
+++ b/src/simplaret
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# simplaret v0.1.1: simplepkg's package grabber
+# simplaret v0.1.1: simplepkg's retrieval tool
# feedback: rhatto at riseup.net | gpl
#
# Simplaret is free software; you can redistribute it and/or modify it under the
@@ -24,9 +24,9 @@
#
# config file repos.conf:
#
-# ROOT-i386="http://slack.sarava.org/packages/slackware"
+# ROOT-i386="http://slack.sarava.org/packages/slackware/"
# REPOS-i386-10.2="slack.sarava.org%http://slack.sarava.org/packages/slackware/slackware-10.2/"
-# ROOT-x86_64="http://darkstar.ist.utl.pt/pub/slamd64/"
+# ROOT-x86_64="http://mirror1.slackadelic.com/slamd64/"
# REPOS-x86_64-10.2="slack.sarava.org%http://slack.sarava.org/packages/slamd64/slamd64-10.2/"
#
# usage:
@@ -303,12 +303,24 @@ function simplaret_purge {
function simplaret_get {
+ # TODO: with no parameters, update the existing packages at the local repo?
+ # support to --get package-version-arch-build.tgz or just half the name
+
# search for an already downloaded package
for file in `find $STORAGE/$ARCH/$VERSION/ -name $1*tgz 2> /dev/null`; do
candidate="`basename $file`"
if [ "`package_name $candidate`" == "$1" ]; then
- echo package $candidate already downloaded and stored at `dirname $file`
- exit 0
+ # check if has the same version and build number, otherwise erase the old one
+ for result in `simplaret_search `basename $file tgz` --silent`; do
+ if [ "`package_name $candidate`" == "`package_name $result`" ] && \
+ [ "`package_version $candidate`" == "`package_version $result`" ] && \
+ [ "`package_build $candidate`" == "`package_build $result`" ]; then
+ echo package $candidate already downloaded and stored at `dirname $file`
+ exit 0
+ else
+ rm $file
+ fi
+ done
fi
done