[Lunar-commits] r23487 - in lunar/branches/stable: bin etc/lunar/mirrors usr/share/man/man1 var/lib/lunar/functions var/lib/lunar/plugins
Auke Kok
sofar at lunar-linux.org
Sun Mar 4 20:20:35 CET 2007
Author: sofar
Date: 2007-03-04 20:20:35 +0100 (Sun, 04 Mar 2007)
New Revision: 23487
Modified:
lunar/branches/stable/bin/lvu
lunar/branches/stable/etc/lunar/mirrors/XORG
lunar/branches/stable/usr/share/man/man1/lvu.1
lunar/branches/stable/var/lib/lunar/functions/aliases.lunar
lunar/branches/stable/var/lib/lunar/functions/config.lunar
lunar/branches/stable/var/lib/lunar/functions/depends.lunar
lunar/branches/stable/var/lib/lunar/functions/download.lunar
lunar/branches/stable/var/lib/lunar/functions/modules.lunar
lunar/branches/stable/var/lib/lunar/plugins/download-generic.plugin
Log:
Backmerge from theedge: speedups, cleanups, mirror changes.
Modified: lunar/branches/stable/bin/lvu
===================================================================
--- lunar/branches/stable/bin/lvu 2007-03-04 18:11:28 UTC (rev 23486)
+++ lunar/branches/stable/bin/lvu 2007-03-04 19:20:35 UTC (rev 23487)
@@ -338,11 +338,11 @@
show_module_component() {
- COMPONENT=$1
- MODULE=$2
- SECTION=$(find_section $MODULE)
- if [ -e $MOONBASE/$SECTION/$MODULE/$COMPONENT ] ; then
- cat $MOONBASE/$SECTION/$MODULE/$COMPONENT
+ SCRIPT_DIRECTORY=$MOONBASE/$(find_section $2)/$2
+ if [[ -e "$SCRIPT_DIRECTORY/$1.$PLATFORM" ]]; then
+ cat "$SCRIPT_DIRECTORY/$1.$PLATFORM"
+ elif [[ -e "$SCRIPT_DIRECTORY/$1" ]] ; then
+ cat "$SCRIPT_DIRECTORY/$1"
fi
}
@@ -1197,8 +1197,8 @@
compile)
run_details $2 ;
- if [ -f $COMPILE_LOGS/$2-$(lvu version $2).bz2 ] ; then
- view_file $COMPILE_LOGS/$2-$(lvu version $2).bz2
+ if [ -f $COMPILE_LOGS/$2-$(module_version $2).bz2 ] ; then
+ view_file $COMPILE_LOGS/$2-$(module_version $2).bz2
else
VERSION=$(installed_version $2)
view_file $COMPILE_LOGS/$2-$(installed_version $2).bz2 \
Modified: lunar/branches/stable/etc/lunar/mirrors/XORG
===================================================================
--- lunar/branches/stable/etc/lunar/mirrors/XORG 2007-03-04 18:11:28 UTC (rev 23486)
+++ lunar/branches/stable/etc/lunar/mirrors/XORG 2007-03-04 19:20:35 UTC (rev 23487)
@@ -6,11 +6,10 @@
Brazilia ftp://ftp.unicamp.br/pub/X11/releases/
France ftp://mirror.cict.fr/x.org/
France http://mirror.cict.fr/x.org/
-Germany ftp://ftp.gwdg.de/pub/x11/x.org/
+Germany ftp://ftp.gwdg.de/pub/x11/x.org/pub/
Germany ftp://ftp.portal-to-web.de/pub/mirrors/x.org/
Germany http://www.portal-to-web.de/pub/mirrors/x.org/
-Germany http://ftp.gwdg.de/pub/x11/x.org/
-Germany ftp://ftp.fu-berlin.de/unix/X11/FTP.X.ORG/
+Germany ftp://ftp.fu-berlin.de/unix/X11/FTP.X.ORG/pub/
Greece ftp://ftp.ntua.gr/pub/X11/
HongKong ftp://ftp.cs.cuhk.edu.hk/pub/X11/
Italy http://mi.mirror.garr.it/mirrors/x.org/
Modified: lunar/branches/stable/usr/share/man/man1/lvu.1
===================================================================
--- lunar/branches/stable/usr/share/man/man1/lvu.1 2007-03-04 18:11:28 UTC (rev 23486)
+++ lunar/branches/stable/usr/share/man/man1/lvu.1 2007-03-04 19:20:35 UTC (rev 23487)
@@ -55,6 +55,7 @@
.PP
.B lvu
submit|edit|unedit [module]
+.PP
.B lvu
$MODULE_SCRIPT <module>
.SH "COPYRIGHT"
Modified: lunar/branches/stable/var/lib/lunar/functions/aliases.lunar
===================================================================
--- lunar/branches/stable/var/lib/lunar/functions/aliases.lunar 2007-03-04 18:11:28 UTC (rev 23486)
+++ lunar/branches/stable/var/lib/lunar/functions/aliases.lunar 2007-03-04 19:20:35 UTC (rev 23487)
@@ -12,13 +12,13 @@
# translate %ALIAS if needed to a module name that is installed
# and add it to the dependency chain if needed
unalias() {
- local TARGET TARGETS TARGETBYNUM N CHOICE CACHED_ALIAS
# quick exit code
- if [ "${1:0:1}" != "%" ] ; then
+ if [[ "${1:0:1}" != "%" ]] ; then
echo $1
return
fi
+ local TARGET TARGETS TARGETBYNUM N CHOICE CACHED_ALIAS
# lookup in cache
CACHED_ALIAS=$(get_local_config `echo LUNAR_ALIAS_${1:1}`)
if [ -n "$CACHED_ALIAS" ]; then
Modified: lunar/branches/stable/var/lib/lunar/functions/config.lunar
===================================================================
--- lunar/branches/stable/var/lib/lunar/functions/config.lunar 2007-03-04 18:11:28 UTC (rev 23486)
+++ lunar/branches/stable/var/lib/lunar/functions/config.lunar 2007-03-04 19:20:35 UTC (rev 23487)
@@ -18,12 +18,12 @@
############################################################
-
-set_config() {
+set_config()
+{
local LINE NEW
debug_msg "set_config ($@)"
- LINE=$(cat $1 | grep -w "$2=.*")
+ LINE=$(grep -w "$2=.*" $1)
if [ "$1" == "$LOCAL_CONFIG" ] ; then
NEW=$(printf "%16s=%s" "$2" "$3")
else
@@ -48,7 +48,8 @@
}
-unset_config() {
+unset_config()
+{
debug_msg "unset_config ($@)"
# on-demand creation
@@ -65,32 +66,35 @@
}
-get_config() {
- if [ -f $1 ] ; then
- cat $1 | grep -w "$2=.*" | cut -d= -f2- | sed -e 's/^"//' -e 's/"$//'
+get_config()
+{
+ if [[ -f $1 ]] ; then
+ grep -w "$2=.*" $1 | cut -d= -f2- | sed -e 's/^"//' -e 's/"$//'
fi
}
-set_local_config() {
+set_local_config()
+{
debug_msg "set_local_config ($@)"
set_config "$LOCAL_CONFIG" "$1" "$2"
}
-unset_local_config() {
+unset_local_config()
+{
debug_msg "unset_local_config ($@)"
unset_config "$LOCAL_CONFIG" "$1"
}
get_local_config() {
- debug_msg "get_local_config ($@)"
get_config "$LOCAL_CONFIG" "$1"
}
-set_module_config() {
+set_module_config()
+{
debug_msg "set_module_config ($@)"
if [ -n "$MODULE" ] ; then
set_config "$DEPENDS_CONFIG/$MODULE" "$1" "$2"
@@ -98,7 +102,8 @@
}
-unset_module_config() {
+unset_module_config()
+{
debug_msg "unset_module_config ($@)"
if [ -n "$MODULE" ] ; then
unset_config "$DEPENDS_CONFIG/$MODULE" "$1"
@@ -106,7 +111,8 @@
}
-get_module_config() {
+get_module_config()
+{
debug_msg "get_module_config ($@)"
if [ -n "$MODULE" ] ; then
get_config "$DEPENDS_CONFIG/$MODULE" "$1"
@@ -114,7 +120,8 @@
}
-get_other_module_config() {
+get_other_module_config()
+{
debug_msg "get_other_module_config ($@)"
if [ -n "$1" ] ; then
get_config "$DEPENDS_CONFIG/$1" "$2"
Modified: lunar/branches/stable/var/lib/lunar/functions/depends.lunar
===================================================================
--- lunar/branches/stable/var/lib/lunar/functions/depends.lunar 2007-03-04 18:11:28 UTC (rev 23486)
+++ lunar/branches/stable/var/lib/lunar/functions/depends.lunar 2007-03-04 19:20:35 UTC (rev 23487)
@@ -29,14 +29,13 @@
debug_msg "find_depends ($@)"
find_depends_intern() {
- local DEP LINE
+ local DEP
for DEP in $(awk -F: -v mod=$1 '{if ($1==mod){print $2}}' $DEPENDS_CACHE) ; do
DEP=$(unalias "$DEP")
# this is our shortcut out:
if ! grep -qx "$DEP" $TMP_FDEPS ; then
- debug_msg "$DEP"
echo "$DEP" >> $TMP_FDEPS
- if [[ "$(grep "^$1:$DEP:" $DEPENDS_CACHE | cut -d: -f3)" == "required" ]] ; then
+ if grep -q "^$1:$DEP:required:" $DEPENDS_CACHE ; then
echo "$DEP"
find_depends_intern "$DEP"
elif module_installed "$DEP" ; then
Modified: lunar/branches/stable/var/lib/lunar/functions/download.lunar
===================================================================
--- lunar/branches/stable/var/lib/lunar/functions/download.lunar 2007-03-04 18:11:28 UTC (rev 23486)
+++ lunar/branches/stable/var/lib/lunar/functions/download.lunar 2007-03-04 19:20:35 UTC (rev 23487)
@@ -41,7 +41,11 @@
plugin_call SOURCE_DOWNLOAD $1 $2 $3
RETVAL=$?
if [ $RETVAL == 2 ]; then
- message "${PROBLEM_COLOR}Warning:${QUERY_COLOR} I don't know how to download \"$1\"${DEFAULT_COLOR}"
+ # refuse to continue - it's useless to have the user attempt to
+ # download cvs/svn etc snapshots from the cache URLs
+ error_message "${PROBLEM_COLOR}I don't know how to download ${QUERY_COLOR}\"$1\".${DEFAULT_COLOR}"
+ error_message "${MESSAGE_COLOR}Install the package that provides the method and plugin to download it.${DEFAULT_COLOR}"
+ exit 1
fi
return $RETVAL
}
Modified: lunar/branches/stable/var/lib/lunar/functions/modules.lunar
===================================================================
--- lunar/branches/stable/var/lib/lunar/functions/modules.lunar 2007-03-04 18:11:28 UTC (rev 23486)
+++ lunar/branches/stable/var/lib/lunar/functions/modules.lunar 2007-03-04 19:20:35 UTC (rev 23487)
@@ -287,8 +287,9 @@
# function : module_installed
# usage : module_installed $MODULE
# purpose : check if $MODULE is installed (or held)
-module_installed() {
- $(cut -d: -f1,3 $MODULE_STATUS | grep -q -e "^$1:installed" -e "^$1:held")
+module_installed()
+{
+ grep -q "^$1:[[:digit:]]*:installed:\|^$1:[[:digit:]]*:held:" $MODULE_STATUS
}
@@ -297,7 +298,7 @@
# purpose : check if $MODULE is held
module_held() {
debug_msg "module_held ($@)"
- $(cut -d: -f1,3 $MODULE_STATUS | grep -q "^$1:held")
+ grep -q "^$1:[[:digit:]]*:held:" $MODULE_STATUS
}
Modified: lunar/branches/stable/var/lib/lunar/plugins/download-generic.plugin
===================================================================
--- lunar/branches/stable/var/lib/lunar/plugins/download-generic.plugin 2007-03-04 18:11:28 UTC (rev 23486)
+++ lunar/branches/stable/var/lib/lunar/plugins/download-generic.plugin 2007-03-04 19:20:35 UTC (rev 23487)
@@ -70,7 +70,10 @@
return 1
fi
else
+ # don't report errors against cache misses
+ if [ "$URL" != "$LRESORT_URL/" ]; then
activity_log "lget" "$MODULE" "$VERSION" "failed" "broken URL: \"$URL$2\""
+ fi
return 1
fi
}
More information about the Lunar-commits
mailing list