]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
simplaret: new var SIMPLARET_DOWNLOAD_FROM_NEXT_REPO
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Mon, 9 Apr 2007 15:54:19 +0000 (15:54 +0000)
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Mon, 9 Apr 2007 15:54:19 +0000 (15:54 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@326 04377dda-e619-0410-9926-eae83683ac58

trunk/conf/repos.conf.new
trunk/doc/CHANGELOG
trunk/lib/common.sh
trunk/src/simplaret
trunk/templates/vserver/vserver.d/var/www/htdocs/missing.html

index 930ff80a4c54bbe7c5e0393365410b257c6a31b2..1d77419f87f0cd11928fd68d53c96555aeec1302 100644 (file)
@@ -1,5 +1,6 @@
 #
 # repository definitions for simplaret
+# please dont use any spaces inside a repository definition
 #
 
 # root repositories
@@ -24,7 +25,7 @@ PATCHES-x86_64-10.2="sarava%http://slack.sarava.org/packages/slamd64/slamd64-10.
 
 # x86_64 10.2b
 REPOS-x86_64-10.2b="sarava%http://slack.sarava.org/packages/slamd64/slamd64-10.2b/"
-PATCHES-x86_64-10.2b=""sarava%http://slack.sarava.org/packages/slamd64/slamd64-10.2b/patches/"
+PATCHES-x86_64-10.2b="sarava%http://slack.sarava.org/packages/slamd64/slamd64-10.2b/patches/"
 
 # i386 11.0
 REPOS-i386-11.0="sarava%http://slack.sarava.org/packages/slackware/slackware-11.0/"
index afc190a1c38ba60b42955151da16584d68f91a7c..76bd63b429077866b9f3624b62428ebdcf0d7e27 100644 (file)
@@ -11,6 +11,10 @@ simplepkg changelog
   - lspkg:
     - small bugfix
 
+  - common.sh:
+     - on search_template, doesnt return a template from
+       defaults/ if the function is called with --update
+
 0.5pre9 - 0.5pre13
 ==================
 
index 2680cff42b06f8e5a42b851e77b122b66e85542e..f331e56b33ab55f41224545f41885bd42f26ed6f 100644 (file)
@@ -391,7 +391,8 @@ function search_template {
     TEMPLATE_BASE="$TEMPLATE_FOLDER/$1"
   elif [ -f "$TEMPLATE_FOLDER/$1/$1.template" ]; then
     TEMPLATE_BASE="$TEMPLATE_FOLDER/$1/$1"
-  elif [ -f "$BASE_CONF/defaults/templates/$1/$1.template" ]; then
+  elif [ -f "$BASE_CONF/defaults/templates/$1/$1.template" ] && \
+       [ "$2" != "--update" ]; then
     TEMPLATE_BASE="$BASE_CONF/defaults/templates/$1/$1"
   else
     if [ "$2" == "--new" ]; then
index 374c988c4ebca327383425c039414e4aab11027b..719063c203cb53355fdc7d5c5e7d8ef8506c5cd6 100755 (executable)
@@ -489,7 +489,7 @@ function simplaret_get {
   # get a package
   # usage: simplaret_get <package-name> [--silent]
 
-  local silent generate_patches
+  local silent generate_patches search search_results
 
   # prevent user to stay in $storage
   cd 
@@ -507,7 +507,13 @@ function simplaret_get {
   done
 
   # then search for the package in the repositories
-  for result in `simplaret_search $1 --formatted`; do
+  search="`simplaret_search $1 --formatted`"
+  search_results="`echo $search | bc -l`"
+
+  for result in $search; do
+
+    # remaining search results
+    let search_results--
 
     file="`echo $result | cut -d , -f 1`"
     repos_type="`echo $result | cut -d , -f 2`"
@@ -558,11 +564,14 @@ function simplaret_get {
         if [ "$2" != "--silent" ]; then
           echo Error downloading $candidate from $repos_type repository $repository_url, please check your settings
         fi
-        # TODO: must check if there's also more repositories to try,
-        #       otherwise this function will never return an error code
-        #if [ "$SIMPLARET_DOWNLOAD_FROM_NEXT_REPO" != "1" ]; then
+        # check if there's also more repositories to try
+        if [ "$SIMPLARET_DOWNLOAD_FROM_NEXT_REPO" != "1" ]; then
           return 1
-        #fi
+        else
+          if (($search_results <= 0)); then
+            return 1
+          fi
+        fi
       else
         LAST_DOWNLOADED_PACKAGE="$folder/$candidate"
         if [ "$2" != "--silent" ]; then
index b2eec17db4572c6ee3ba765b205742752e427b83..27623243e289f75aa303e91977f36302ea95087b 100644 (file)
@@ -5,7 +5,7 @@
 <body>
   <center>
   <pre>
-  O endere&ccedil;o que voc&ecirc; requisitou n&atilde;o p&ocirc;de ser encontrado :(
+  File not found.
   </pre>
   </center>
 </body>