Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to test-1.13 sorcery by Jaka Kranjc (5fad337a7ae2cb97734158e1927fb800a2880a80)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Jaka Kranjc <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to test-1.13 sorcery by Jaka Kranjc (5fad337a7ae2cb97734158e1927fb800a2880a80)
  • Date: Fri, 14 Mar 2008 14:13:00 -0500

GIT changes to test-1.13 sorcery by Jaka Kranjc <lynxlynxlynx AT sourcemage.org>:

ChangeLog | 15 ++++++
etc/sorcery/local/README | 2
etc/sorcery/version | 2
usr/sbin/scribe | 64
+++++++++++++-------------
var/lib/sorcery/modules/dl_handlers/dl_wget | 31 +++++++-----
var/lib/sorcery/modules/libmisc | 11 ++++
var/lib/sorcery/modules/liburl | 4 -
var/lib/sorcery/modules/url_handlers/url_http | 30 +++++++-----
8 files changed, 99 insertions(+), 60 deletions(-)

New commits:
commit 5fad337a7ae2cb97734158e1927fb800a2880a80
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

1.13.8-rc5

commit d2cc7c63789a7b915c0275642565c977d89a8d3f
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

scribe: output errors to stderr #13738 , fixed punctuation
(cherry-picked from commit 73bed26b3a15b1c575e0363fc08ee351173ec85b)

(cherry-picked from commit 78df69e944527b6e92a62480f6796e611f19c67e)

commit 58117f53366efd0886a76ae894db669394f3de9e
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

libmisc: added error_message, a message() that also outputs to stderr

(cherry-picked from commit 5a78bf41b279d97d83240837cee808a817d6291a)

commit ec346b8d0568dfcf956f18cbd33facba0d0b4a7d
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

* url_http: pass along all the arguments in url_https_verify
* dl_wget: pass hints to dl_wget_set_options and use them
* url_http, dl_wget: support the no-check-certificate source hint
#14106

(cherry-picked from commit 3f46ec43345c225113b764a16292faa68539f22f)

commit 29fe822d51055776b44430493a211b41026d4531
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

liburl: pass along all the arguments in url_verify

(cherry-picked from commit 5ab8b9839327e2f844dc23e8c39de6d5e40ea8e7)

commit 9476400aa907d74817884a559cece270e4a46182
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

dl_wget, url_http: removed EOL whitespace

commit d377cbbf1588ff660e875879082272fe77a82114
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

liburl: fixed typo in a comment

commit 2c1fd8883c02fdc28cef91ef1cb80ca51d3ce3c2
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

local/README: fixed typo

(cherry-picked from commit e770fc607bbce8e6622acfa7d5778141a6604e78)

diff --git a/ChangeLog b/ChangeLog
index 4521af9..a5b7818 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2008-01-31 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * libmisc: added error_message, a message() that also outputs to
stderr
+ * scribe: output errors to stderr #13738 , fixed punctuation
+
+2008-01-30 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * url_http: pass along all the arguments in url_https_verify
+ * dl_wget: pass hints to dl_wget_set_options and use them
+ * url_http, dl_wget: support the no-check-certificate source hint
#14106
+
+2008-01-30 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * liburl: pass along all the arguments in url_verify
+
+2008-01-29 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * local/README: fixed typo
+
2008-01-24 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* cast: fixed typo in pre-review-queue message #14228

diff --git a/etc/sorcery/local/README b/etc/sorcery/local/README
index b5e659d..ecb66dd 100755
--- a/etc/sorcery/local/README
+++ b/etc/sorcery/local/README
@@ -4,6 +4,6 @@ configuration files.
"/etc/sorcery/local/config" contains the variables that
you wish to override in /etc/sorcery/config.

-Addtionally, "/etc/sorcery/local" stores your config for
+Additionally, "/etc/sorcery/local" stores your config for
Linus Torvalds' Linux Kernel and XFree86.

diff --git a/etc/sorcery/version b/etc/sorcery/version
index 031c510..59f2749 100644
--- a/etc/sorcery/version
+++ b/etc/sorcery/version
@@ -1 +1 @@
-1.13.8-rc4
+1.13.8-rc5
diff --git a/usr/sbin/scribe b/usr/sbin/scribe
index a411d4e..7710b9b 100755
--- a/usr/sbin/scribe
+++ b/usr/sbin/scribe
@@ -58,9 +58,9 @@ EOF
## Common error messag when downloading a grimoire fails.
#---------------------------------------------------------------------
function scribe_download_fail_error_msg() {
- message "Error downloading grimoire..."
- message "Grimoire tarballs are located at $CODEX_TARBALL_URL"
- message "Grimoire rsync modules are located at $CODEX_RSYNC_URL"
+ error_message "Error downloading grimoire..."
+ error_message "Grimoire tarballs are located at $CODEX_TARBALL_URL"
+ error_message "Grimoire rsync modules are located at $CODEX_RSYNC_URL"
}

#---------------------------------------------------------------------
@@ -75,7 +75,7 @@ function unpackage_grimoire_tarball() {
#check for a successful unzip
if ! [ -d $grimoire ]; then
#uh oh! bad unzip.
- message "ERROR: Grimoire tarball for $grim_name not" \
+ error_message "ERROR: Grimoire tarball for $grim_name not" \
"formated correctly!."
return 1
fi
@@ -105,7 +105,7 @@ function scribe_validate_tree_common() {
local grim_name=$2
local grimoire=$3
if ! test -d "$scribe_target"; then
- message "Downloaded a tree but directory doesn't exist! file a bug if
you see this"
+ error_message "Downloaded a tree but directory doesn't exist! file a
bug if you see this."
return 1
fi
if [[ "$scribe_target" != "$grim_name" ]] ; then
@@ -150,14 +150,14 @@ function scribe_add() {
fi

if codex_find_grimoire $grimoire >/dev/null; then
- message "${PROBLEM_COLOR}There already exists a grimoire with" \
+ error_message "${PROBLEM_COLOR}There already exists a grimoire with" \
"the name $grimoire! Refusing to add.${DEFAULT_COLOR}"
continue
fi

# avoid deleting $grimoire if it is a dir #13742
if [[ -d $grimoire ]]; then
- message "${PROBLEM_COLOR}The grimoire $grimoire is an" \
+ error_message "${PROBLEM_COLOR}The grimoire $grimoire is an" \
"exsisting directory! Refusing to add!${DEFAULT_COLOR}"
continue
fi
@@ -194,14 +194,14 @@ function scribe_add_update_worker() {
local add_or_update=$3

if [ -z $grimoire ] ; then
- message "Empty grimoire name! Please contact the sorcery team if" \
- "you see this"
+ error_message "Empty grimoire name! Please contact the sorcery team if" \
+ "you see this."
return 1
fi

if [[ $add_or_update == update ]] ; then
if ! test -d $grimoire ; then
- message "$grimoire is not a directory! refusing to update"
+ error_message "$grimoire is not a directory! refusing to update!"
return 1
fi
fi
@@ -214,7 +214,7 @@ function scribe_add_update_worker() {
if [ -n "$from" ]; then
if ! url_is_valid "$from"; then
#if not valid, use default
- message "Error: $from is not a recognized url. Using default."
+ error_message "Error: $from is not a recognized url. Using the
default."
from=""
else
grim_target=$(basename $from)
@@ -226,7 +226,7 @@ function scribe_add_update_worker() {
#from is empty - use the default
prefix=$(url_get_prefix $CODEX_URL)
if [[ $? != 0 ]]; then
- message "${PROBLEM_COLOR}Failed to get the \$CODEX_URL prefix!" \
+ error_message "${PROBLEM_COLOR}Failed to get the \$CODEX_URL prefix!" \
"${DEFAULT_COLOR}"
popd &>/dev/null
return 1
@@ -293,7 +293,7 @@ function scribe_add_update_worker() {
popd &>/dev/null; return 1
fi
else
- message "Unknown download type $scribe_type, file a bug if you see this"
+ error_message "Unknown download type $scribe_type, file a bug if you see
this."
return 1
fi
popd &>/dev/null
@@ -332,7 +332,7 @@ function scribe_fix() {
for grim in $grimoires; do

if ! grimoire=$(codex_find_grimoire $grim) ; then
- message "Grimoire $grim not found"
+ error_message "Grimoire $grim not found!"
return 1
fi

@@ -341,13 +341,13 @@ function scribe_fix() {
if scribe_fix_metadata $grimoire; then
message "$grimoire fixed."
else
- message "$grimoire not fixed"
+ error_message "$grimoire not fixed!"
fi
elif query "Metadata for $grimoire found. Fix anyway?" n; then
if scribe_fix_metadata $grimoire 1; then
message "$grimoire fixed."
else
- message "$grimoire not fixed"
+ error_message "$grimoire not fixed!"
fi
else
message "$grimoire ignored"
@@ -368,7 +368,7 @@ function scribe_fix_metadata() {
local URL grimoire_dir grimoire_name

if ! grimoire_dir=$(codex_find_grimoire $1) ; then
- message "Grimoire $1 not found, this may be a sorcery bug..."
+ error_message "Grimoire $1 not found, this may be a sorcery bug..."
return 1
fi
grimoire_name=$(basename $1)
@@ -437,7 +437,7 @@ function scribe_localize() {
function scribe_localize_sub() {
path=$(codex_find_grimoire $grimoire)
if [ -z "$path" ]; then
- message "No such grimoire: $grimoire"
+ error_message "No such grimoire: $grimoire"
continue
fi
touch "$path/GRIMOIRE" &&
@@ -463,7 +463,7 @@ function scribe_reindex() {

for grim in $grimoires; do
if ! grimoire=$(codex_find_grimoire $grim) ; then
- message "Grimoire $grim not found"
+ error_message "Grimoire $grim not found!"
return 1
fi
paths="$paths $grimoire"
@@ -490,7 +490,7 @@ function scribe_remove() {
# if the grimoire name starts with / they may have given a
# full path, the [[ ]] actually doesnt expand /* to $(ls /)
if ! grimoire=$(codex_find_grimoire $grim) ; then
- message "Grimoire $grim not found"
+ error_message "Grimoire $grim not found!"
return 1
fi

@@ -498,7 +498,7 @@ function scribe_remove() {
rm -rf $grimoire &&
message "Removing grimoire $grimoire from codex" &&
codex_remove_grimoire $grimoire ||
- { message "An error occured trying to remove $grimoire, I wonder why"
+ { error_message "An error occured trying to remove $grimoire, I wonder
why?"
return 1
}
done
@@ -520,19 +520,19 @@ function scribe_set(){
local grim2=$2 grimoire2
local idx1 idx2
if [ $grim1 == $grim2 ] ; then
- message "$grim1 IS $grim2, can't set a grimoire to itself"
+ error_message "$grim1 IS $grim2, can't set a grimoire to itself!"
return 1
fi
if ! codex_find_grimoire $grim1 grimoire1 idx1 ; then
- message "Grimoire $grim1 not found"
+ error_message "Grimoire $grim1 not found!"
return 1
fi
if ! codex_find_grimoire $grim2 grimoire2 idx2 ; then
- message "Grimoire $grim2 not found"
+ error_message "Grimoire $grim2 not found!"
return 1
fi
if [ $idx1 -eq $idx2 ] ; then
- message "This shouldn't happen, but if it does contact the sorcery team"
+ error_message "This shouldn't happen, but if it does contact the sorcery
team."
return 1
elif [ $idx1 -lt $idx2 ] ; then
let idx2-- # grim1 is before grim2, by removing grim1, the position
@@ -560,11 +560,11 @@ function scribe_swap() {
local grim2=$2 grimoire2
local idx1 idx2
if ! codex_find_grimoire $grim1 grimoire1 idx1 ; then
- message "Grimoire $grim1 not found"
+ error_message "Grimoire $grim1 not found!"
return 1
fi
if ! codex_find_grimoire $grim2 grimoire2 idx2 ; then
- message "Grimoire $grim2 not found"
+ error_message "Grimoire $grim2 not found!"
return 1
fi
message -n "swapping "
@@ -588,21 +588,21 @@ function scribe_update() {
while [ -n "$1" ] ; do
grim="$1"
if ! grimoire=$(codex_find_grimoire $grim) ; then
- message "Grimoire $grim not found"
+ error_message "Grimoire $grim not found"
if [[ "$2" == "from" ]] ; then shift 3 ; else shift 1 ; fi
let rc++
continue
fi

if ! [ -e $grimoire/GRIMOIRE ] && ! scribe_fix_metadata $grim; then
- message "$grim has invalid metadata. Not Updating"
+ error_message "$grim has invalid metadata. Not Updating"
if [[ "$2" == "from" ]] ; then shift 3 ; else shift 1 ; fi
let rc++
continue
fi

if codex_is_local $grimoire; then
- message "${SPELL_COLOR}$grim${MESSAGE_COLOR} is being marked" \
+ error_message "${SPELL_COLOR}$grim${MESSAGE_COLOR} is being marked" \
"as local. Won't update.${DEFAULT_COLOR}"
if [[ "$2" == "from" ]] ; then shift 3 ; else shift 1 ; fi
continue
@@ -628,12 +628,12 @@ function scribe_update() {
grim=$(basename $grimoire)
if ! [ -e $grimoire/GRIMOIRE ] && ! scribe_fix_metadata $grimoire; then
#no metadata found. dont auto-update
- message "$grim has invalid metadata. Not Updating"
+ error_message "$grim has invalid metadata. Not Updating"
continue
fi

if codex_is_local $grimoire; then
- message "${SPELL_COLOR}$grim${MESSAGE_COLOR} is being marked as
local. Won't update.${DEFAULT_COLOR}"
+ error_message "${SPELL_COLOR}$grim${MESSAGE_COLOR} is being marked
as local. Won't update.${DEFAULT_COLOR}"
continue
fi

diff --git a/var/lib/sorcery/modules/dl_handlers/dl_wget
b/var/lib/sorcery/modules/dl_handlers/dl_wget
index b69ca19..9272aa3 100755
--- a/var/lib/sorcery/modules/dl_handlers/dl_wget
+++ b/var/lib/sorcery/modules/dl_handlers/dl_wget
@@ -2,14 +2,14 @@
#---------------------------------------------------------------------
##
##=head1 SYNOPSIS
-##
+##
## Url handler functions for downloading http, https, and ftp urls
##
##=head1 DESCRIPTION
##
-## This file contains functions for downloading and verifying
+## This file contains functions for downloading and verifying
## http, https, and ftp urls. This file uses the "wget" program.
-##
+##
##=head1 COPYRIGHT
##
## Copyright 2002 by the Source Mage Team
@@ -36,7 +36,7 @@ function dl_wget_get() {

for url in $url_list; do
local WGET_OPTIONS
- dl_wget_set_options $url
+ dl_wget_set_options $url $hints
dl_wget_call_wget $target $url
rc=$?
[[ $rc == 0 ]] && break
@@ -52,11 +52,11 @@ function dl_wget_get() {

#---------------------------------------------------------------------
# dl_wget_call_wget <filename> <extension-less filename> <url>
-#
+#
# Private Function. Call wget to download the url.
#
#---------------------------------------------------------------------
-function dl_wget_call_wget() {
+function dl_wget_call_wget() {
local FILE=$1
local URL=$2

@@ -73,13 +73,15 @@ function dl_wget_call_wget() {
}

#---------------------------------------------------------------------
-# dl_wget_set_wget_options
-#
+# dl_wget_set_wget_options
+#
# Private Function. Sets wget options
#
#---------------------------------------------------------------------
function dl_wget_set_options() {
local URL=$1
+ local hints="$2"
+
if [ -n "$ACTIVE_FTP" ] ; then
unset PASSIVE
else
@@ -88,7 +90,7 @@ function dl_wget_set_options() {

# Check for ? in the url, this seems to indicate that there may be
# some cgi redirection involved which means continued downloading would
- # not work (bug 8993).
+ # not work (bug 8993).
# The sourceforge check pre-dates that but is lacking any documentation,
# I suspect it is a less general attempt to solve the same problem.
# (afk 2005-06-25)
@@ -113,13 +115,18 @@ function dl_wget_set_options() {
else
URL_HTTP_RETRIES="-t 3"
fi
-
+
+ local check_certificate
+ if list_find "$hints" no-check-certificate; then
+ check_certificate=--no-check-certificate
+ fi
+
ONLY_NEWER=""
DEREF_SYM="--retr-symlinks"

- WGET_OPTIONS="$URL_HTTP_TIMEOUT $URL_HTTP_RETRIES $NO_CACHE $RATE $PASSIVE
$CONTINUE $ONLY_NEWER $DEREF_SYM"
+ WGET_OPTIONS="$URL_HTTP_TIMEOUT $URL_HTTP_RETRIES $NO_CACHE $RATE $PASSIVE
$CONTINUE $ONLY_NEWER $DEREF_SYM $check_certificate"
debug 'dl_wget' "wget options: $WGET_OPTIONS"
-}
+}
#---------------------------------------------------------------------
##=back
##
diff --git a/var/lib/sorcery/modules/libmisc b/var/lib/sorcery/modules/libmisc
index ef28027..22534bc 100755
--- a/var/lib/sorcery/modules/libmisc
+++ b/var/lib/sorcery/modules/libmisc
@@ -178,6 +178,17 @@ function real_message() {
}

#---------------------------------------------------------------------
+## @Type Private
+## @param error message to echo
+## @Stdout message
+## @Stderr message
+## echo's the given arguments if SILENT is not set.
+#---------------------------------------------------------------------
+function error_message() {
+ real_message "$@" 1>&2
+}
+
+#---------------------------------------------------------------------
## @param type
## @param message
##
diff --git a/var/lib/sorcery/modules/liburl b/var/lib/sorcery/modules/liburl
index f32252a..1934b82 100755
--- a/var/lib/sorcery/modules/liburl
+++ b/var/lib/sorcery/modules/liburl
@@ -80,7 +80,7 @@
#---------------------------------------------------------------------
# Load library files (url_*) that contain url handlers
#
-# (2002/09/29) added if so it onlt loads the stuff once
+# (2002/09/29) added if so it only loads the stuff once
#---------------------------------------------------------------------
if ! [[ $URL_HANDLER_FILES ]] ; then
URL_HANDLER_FILES=`ls $SGL_LIBRARY_MODULES/url_handlers/url_*[^~]`
@@ -431,7 +431,7 @@ function url_expand() {
#---------------------------------------------------------------------
function url_verify() {
$STD_DEBUG
- url_generic_apifunc verify $1
+ url_generic_apifunc verify "$@"
}

#---------------------------------------------------------------------
diff --git a/var/lib/sorcery/modules/url_handlers/url_http
b/var/lib/sorcery/modules/url_handlers/url_http
index 912753a..e0fc50f 100755
--- a/var/lib/sorcery/modules/url_handlers/url_http
+++ b/var/lib/sorcery/modules/url_handlers/url_http
@@ -2,14 +2,14 @@
#---------------------------------------------------------------------
##
##=head1 SYNOPSIS
-##
+##
## Url handler functions for downloading http, https, and ftp urls
##
##=head1 DESCRIPTION
##
-## This file contains functions for downloading and verifying
+## This file contains functions for downloading and verifying
## http, https, and ftp urls. This file uses the "wget" program.
-##
+##
##=head1 COPYRIGHT
##
## Copyright 2002 by the Source Mage Team
@@ -39,49 +39,55 @@ function url_https_bucketize() {

#---------------------------------------------------------------------
##=item url_http_verify <url>
-##
+##
## Verifies the specified http url. Returns true if the url exists
## OR if the url is an empty string.
##
#---------------------------------------------------------------------
function url_http_verify() {
local URL=$1
+ local hints="$2"
+ local check_certificate
+
+ if list_find "$hints" no-check-certificate; then
+ check_certificate=--no-check-certificate
+ fi

if [ -n "$URL" ]; then
- if OUTPUT=`wget --passive-ftp -t 1 -T 30 --spider "$URL" 2>&1`; then
+ if OUTPUT=`wget --passive-ftp -t 1 -T 30 --spider $check_certificate
"$URL" 2>&1`; then
true
else
echo $OUTPUT
false
fi
- fi
+ fi
}


#---------------------------------------------------------------------
##=item url_https_verify <url>
-##
+##
## Verifies the specified https url. Returns true if the url exists
## OR if the url is an empty string.
##
#---------------------------------------------------------------------
function url_https_verify() {
- url_http_verify $1
+ url_http_verify "$@"
}


#---------------------------------------------------------------------
##=item url_ftp_verify <url>
-##
+##
## Verifies the specified ftp url. Echos results of wget if file
## is not found.
##
#
# Implementation note: wget --spider still downloads ftp files in
-# full rather than just checking that the file is there. To get
+# full rather than just checking that the file is there. To get
# around this problem, we download the directory and see if the file
# is in the directory listing.
-#
+#
#---------------------------------------------------------------------
function url_ftp_verify() {
local URL=$1
@@ -99,7 +105,7 @@ function url_ftp_verify() {
rm -f .listing
false
fi
- fi
+ fi
}

#---------------------------------------------------------------------



  • [SM-Commit] GIT changes to test-1.13 sorcery by Jaka Kranjc (5fad337a7ae2cb97734158e1927fb800a2880a80), Jaka Kranjc, 03/14/2008

Archive powered by MHonArc 2.6.24.

Top of Page