aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2006-11-21 21:30:39 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2006-11-21 21:30:39 +0000
commitaf734540a4e3fd2844b57fd643b747ee787ce125 (patch)
tree222702453f87e2e514dbdccebd470757647e2b17
parent78d80cb2fa854d1852f34ccc2f651ce68507cb62 (diff)
downloadsimplepkg-af734540a4e3fd2844b57fd643b747ee787ce125.tar.gz
simplepkg-af734540a4e3fd2844b57fd643b747ee787ce125.tar.bz2
simplaret: start changing repos scheme
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@38 04377dda-e619-0410-9926-eae83683ac58
-rw-r--r--conf/repos.conf.new24
-rwxr-xr-xsrc/simplaret85
2 files changed, 75 insertions, 34 deletions
diff --git a/conf/repos.conf.new b/conf/repos.conf.new
index 66a499e..9da9f67 100644
--- a/conf/repos.conf.new
+++ b/conf/repos.conf.new
@@ -3,20 +3,20 @@
#
# root repositories
-ROOT-i386="http://slackware.mirrors.tds.net/pub/slackware/"
-ROOT-i386="http://slack.sarava.org/slackware/"
-ROOT-x86_64="http://mirror1.slackadelic.com/slamd64/"
-ROOT-x86_64="http://ftp.heanet.ie/pub/slamd64/"
+ROOT-i386="tds%http://slackware.mirrors.tds.net/pub/slackware/"
+ROOT-i386="sarava%http://slack.sarava.org/slackware/"
+ROOT-x86_64="slackadelic%http://mirror1.slackadelic.com/slamd64/"
+ROOT-x86_64="heanet%http://ftp.heanet.ie/pub/slamd64/"
# 10.2
-REPOS-i386-10.2="slack.sarava.org%http://slack.sarava.org/packages/slackware/slackware-10.2/"
-REPOS-i386-10.2="slack.sarava.org-noarch%http://slack.sarava.org/packages/noarch/"
-REPOS-x86_64-10.2="slack.sarava.org%http://slack.sarava.org/packages/slamd64/slamd64-10.2/"
-REPOS-x86_64-10.2="slack.sarava.org-noarch%http://slack.sarava.org/packages/noarch/"
+REPOS-i386-10.2="sarava%http://slack.sarava.org/packages/slackware/slackware-10.2/"
+REPOS-i386-10.2="sarava-noarch%http://slack.sarava.org/packages/noarch/"
+REPOS-x86_64-10.2="sarava%http://slack.sarava.org/packages/slamd64/slamd64-10.2/"
+REPOS-x86_64-10.2="sarava-noarch%http://slack.sarava.org/packages/noarch/"
# 11.0
-REPOS-i386-11.0="slack.sarava.org%http://slack.sarava.org/packages/slackware/slackware-11.0/"
-REPOS-i386-11.0="slack.sarava.org-noarch%http://slack.sarava.org/packages/noarch/"
-REPOS-x86_64-11.0="slack.sarava.org%http://slack.sarava.org/packages/slamd64/slamd64-11.0/"
-REPOS-x86_64-11.0="slack.sarava.org-noarch%http://slack.sarava.org/packages/noarch/"
+REPOS-i386-11.0="sarava%http://slack.sarava.org/packages/slackware/slackware-11.0/"
+REPOS-i386-11.0="sarava-noarch%http://slack.sarava.org/packages/noarch/"
+REPOS-x86_64-11.0="sarava%http://slack.sarava.org/packages/slamd64/slamd64-11.0/"
+REPOS-x86_64-11.0="sarava-noarch%http://slack.sarava.org/packages/noarch/"
diff --git a/src/simplaret b/src/simplaret
index 797c2d6..1e07f29 100755
--- a/src/simplaret
+++ b/src/simplaret
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# simplaret v0.1.1: simplepkg's retrieval tool
+# simplaret v0.2: 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,23 +24,19 @@
#
# config file repos.conf:
#
-# 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://mirror1.slackadelic.com/slamd64/"
-# REPOS-x86_64-10.2="slack.sarava.org%http://slack.sarava.org/packages/slamd64/slamd64-10.2/"
+# ROOT-i386="sarava%http://slack.sarava.org/packages/slackware/"
+# REPOS-i386-10.2="sarava%http://slack.sarava.org/packages/slackware/slackware-10.2/"
+# ROOT-x86_64="slackadelic%http://mirror1.slackadelic.com/slamd64/"
+# REPOS-x86_64-10.2="sarava%http://slack.sarava.org/packages/slamd64/slamd64-10.2/"
#
# usage:
#
-# --update: baixa lista de pacotes de cada repositorio
-# --search: busca
-# --get [-a]: baixa um unico pacote
-# --get-pacthes: baixa os patches e faz o checksum / gpg
-# --purge [-w N]: remove o cache
-#
-# precedence:
-#
-# - checa antes o repositorio raiz, caso o pacote nao seja encontrado segue na ordem das
-# definicoes REPOS do arquivo de configuracao
+# --update: downloads package list for each package
+# --search: search for packages
+# --get [-a]: donwload a package
+# --get-pacthes: download patches
+# --upgrade: download and aplly patches
+# --purge [-w N]: purge package cache
#
SIMPLARET_CONF="/etc/simplepkg/simplepkg.conf"
@@ -145,6 +141,13 @@ function simplaret_download {
}
+function simplaret_repos {
+
+ # return all REPOS definitions for some ARCH and VERSION
+ grep -e "^REPOS-$ARCH-$VERSION=" $REPOS_CONF | cut -d = -f 2 | sed -e 's/"//g' -e "s/'//g" | cut -d "#" -f 1
+
+}
+
function simplaret_repos_name {
if echo $repos | grep -qe %; then
@@ -183,9 +186,36 @@ function simplaret_repos_url {
}
+function simplaret_root {
+
+ # return all ROOT definitions for some ARCH and VERSION
+ grep -e "^ROOT-$ARCH=" $REPOS_CONF | cut -d = -f 2 | sed -e 's/"//g' -e "s/'//g" | cut -d "#" -f 1
+
+}
+
function simplaret_root_url {
- root_url="`grep -e "^ROOT-$ARCH=" $REPOS_CONF | cut -d = -f 2 | sed -e 's/"//g' -e "s/'//g" | cut -d "#" -f 1`"
+ if echo $repos | grep -qe %; then
+ root_url="`echo $root | cut -d % -f 2`"
+ if [ -z "$repos_url" ]; then
+ echo you should set a url for the repository $root for arch $ARCH
+ echo please correct your $REPOS_CONF so this repository definition looks like this:
+ echo ROOT-$ARCH=\"repository-name%repository-url\"
+ exit 1
+ fi
+ else
+ echo you should set a url for the repository $root for arch $ARCH
+ echo please correct your $REPOS_CONF so this repository definition looks like this:
+ echo ROOT-$ARCH=\"repository-name%repository-url\"
+ exit 1
+ fi
+
+}
+
+function simplaret_patches {
+
+ # return all REPOS definitions for some ARCH and VERSION
+ grep -e "^PATCHES-$ARCH-$VERSION=" $REPOS_CONF | cut -d = -f 2 | sed -e 's/"//g' -e "s/'//g" | cut -d "#" -f 1
}
@@ -193,17 +223,23 @@ function simplaret_update {
echo updating package information for arch $ARCH and version $VERSION...
+ # TODO: new repos scheme
+
if [ ! -d "$STORAGE/$ARCH/$VERSION" ]; then
mkdir -p $STORAGE/$ARCH/$VERSION
else
simplaret_backup_index $STORAGE/$ARCH/$VERSION
fi
- simplaret_root_url
- simplaret_get_index "$root_url/$DISTRO_FOLDER/$extra_folder" $STORAGE/$ARCH/$VERSION
- simplaret_check_index $STORAGE/$ARCH/$VERSION
+ for root in `simplaret_root`; do
- for repos in `grep -e "^REPOS-$ARCH-$VERSION=" $REPOS_CONF | cut -d = -f 2 | sed -e 's/"//g' -e "s/'//g" | cut -d "#" -f 1`; do
+ simplaret_root_url
+ simplaret_get_index "$root_url/$DISTRO_FOLDER/$extra_folder" $STORAGE/$ARCH/$VERSION
+ simplaret_check_index $STORAGE/$ARCH/$VERSION
+
+ done
+
+ for repos in `simplaret_repos`; do
simplaret_repos_name
simplaret_repos_url
@@ -225,6 +261,9 @@ function simplaret_update {
function simplaret_search {
+ # first search in ROOT repositories
+ # TODO ...
+
if [ ! -f "$STORAGE/$ARCH/$VERSION/FILELIST.TXT" ]; then
if [ "$WARNING" != "0" ] || [ ! -z "$SILENT" ]; then
echo warning: no file list for root repository on arch $ARCH version $VERSION, please do a simplaret --update
@@ -243,7 +282,9 @@ function simplaret_search {
done
fi
- for repos in `grep -e "^REPOS-$ARCH-$VERSION=" $REPOS_CONF | cut -d = -f 2 | sed -e 's/"//g' -e "s/'//g" | cut -d "#" -f 1`; do
+ # then search in the REPOS repositories
+
+ for repos in `simplaret_repos`; do
simplaret_repos_name
@@ -348,7 +389,7 @@ function simplaret_get {
fi
# then search for the package in contrib repos
- for repos in `grep -e "^REPOS-$ARCH-$VERSION=" $REPOS_CONF | cut -d = -f 2 | sed -e 's/"//g' -e "s/'//g" | cut -d "#" -f 1`; do
+ for repos in `simplaret_repos`; do
simplaret_repos_name
simplaret_repos_url
if [ ! -f "$STORAGE/$ARCH/$VERSION/$repos_name/FILELIST.TXT" ]; then