Mailinglist Archive: opensuse-commit (1262 mails)

< Previous Next >
commit yup
  • From: root@xxxxxxx (h_root)
  • Date: Wed, 20 Sep 2006 16:35:31 +0200 (CEST)
  • Message-id: <20060920143531.470CC1998FD@xxxxxxxxxxxxxxx>

Hello community,

here is the log from the commit of package yup
checked in at Wed Sep 20 16:35:31 CEST 2006.

--------
--- yup/yup.changes 2006-08-31 13:43:28.000000000 +0200
+++ yup/yup.changes 2006-09-20 14:32:24.000000000 +0200
@@ -1,0 +2,12 @@
+Wed Sep 20 14:32:01 CEST 2006 - mge@xxxxxxx
+
+- Add better error handling; patch by
+ Ray Dassen <rdassen@xxxxxxxxxx>
+ Fixes Novell Bug #206660
+- add support for multiple architectures
+- add support for different curl-path (YUP_CURL)
+- add support for different keys for SLES, SLED and other products
+ ( YUP_ID_SLED YUP_PASS_SLED YUP_ID_SLES YUP_PASS_SLES )
+- add ability to have different servers for different products
+
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yup.spec ++++++
--- /var/tmp/diff_new_pack.VYTp9V/_old 2006-09-20 16:34:59.000000000 +0200
+++ /var/tmp/diff_new_pack.VYTp9V/_new 2006-09-20 16:34:59.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yup (Version 1)
+# spec file for package yup (Version 16)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -10,8 +10,8 @@


Name: yup
-Version: 1
-Release: 2
+Version: 16
+Release: 1
Summary: "Yum Update Proxy" for SLE 10 Maintenance
Source0: yup.sh
Source1: yup.sysconfig
@@ -37,6 +37,7 @@
--------
Marcus Meissner
Eberhard Moenkeberg
+ Ray Dassen
Matthias Eckermann

%prep
@@ -74,6 +75,15 @@
fi

%changelog -n yup
+* Wed Sep 20 2006 - mge@xxxxxxx
+- Add better error handling; patch by
+ Ray Dassen <rdassen@xxxxxxxxxx>
+ Fixes Novell Bug #206660
+- add support for multiple architectures
+- add support for different curl-path (YUP_CURL)
+- add support for different keys for SLES, SLED and other products
+ ( YUP_ID_SLED YUP_PASS_SLED YUP_ID_SLES YUP_PASS_SLES )
+- add ability to have different servers for different products
* Thu Aug 31 2006 - meissner@xxxxxxx
- fixed typo in script for older bash versions.
* Wed Aug 30 2006 - meissner@xxxxxxx

++++++ yup.1.pod ++++++
--- yup/yup.1.pod 2006-08-30 04:50:34.000000000 +0200
+++ yup/yup.1.pod 2006-09-20 14:30:40.000000000 +0200
@@ -38,25 +38,61 @@

=head2 Configuration File

-yup needs a configuration file, currently: F</etc/sysconfig/yup>. On SUSE Linux systems, this file can be changed also using YaST's sysconfig-editor (System/YUP).
+yup needs a configuration file, currently: F</etc/sysconfig/yup>. On SUSE Linux systems, this file can be changed by also using YaST's sysconfig-editor (System/YUP).

=over

+=item YUP_CURL
+
+Path and name of curl binary, default: F</usr/bin/curl>. This might be useful on systems which need a non-standard curl-binary to make yup work (e.g. SLES 9).
+
+=item YUP_CURLPARAMS
+
+Standard parameters for curl: --digest is vital, default F<--silent --digest --remote-time>
+
=item YUP_DEST_DIR

Destination path (script will create subdirectories there), default: F</tmp/SLE10-YUP>

=item YUP_ID

-Machine ID: this value is in F</etc/zmd/deviceid> on the machine you registered with.
+Machine ID: this value is in F</etc/zmd/deviceid> on the machine you registered with. This is the default ID and also used for the SDK.

=item YUP_PASS

-Machine Secret: this value is in F</etc/zmd/secret> on the machine you registered with.
+Machine Secret: this value is in F</etc/zmd/secret> on the machine you registered with. This is the default Secret and also used for the SDK.
+
+=item YUP_SERVER
+
+The update server to use, default F<update.novell.com>
+
+=item YUP_ID_SLED
+
+Machine ID: this value is in F</etc/zmd/deviceid> on the machine you registered SLED with. If not set, YUP_ID will be used.
+
+=item YUP_PASS_SLED
+
+Machine Secret: this value is in F</etc/zmd/secret> on the machine you registered SLED with. If not set, YUP_PASS will be used.
+
+=item YUP_SERVER_SLED
+
+The update server to use for SLED, default F<YUP_SERVER>
+
+=item YUP_ID_SLES
+
+Machine ID: this value is in F</etc/zmd/deviceid> on the machine you registered SLES with. If not set, YUP_ID will be used.
+
+=item YUP_PASS_SLES
+
+Machine Secret: this value is in F</etc/zmd/secret> on the machine you registered SLES with. If not set, YUP_PASS will be used.
+
+=item YUP_SERVER_SLES
+
+The update server to use for SLES, default F<YUP_SERVER>

=item YUP_ARCH

-Architecture to mirror (currently it is only possible to mirror one architecture at one time), default: i586
+Architecture to mirror, default: F<i586>

=item YUP_PRODUCTS

@@ -66,7 +102,7 @@

=head1 ERRORS

-yup currently can handle only one architecture at one time.
+yup does not work properly on a standard SLES 9 at the moment; a special curl binary is necessary (curl >= 7.12.0 ) to make yup work here. Use the YUP_CURL variable to work around this limitation.

=head1 FILES


++++++ yup.sh ++++++
--- yup/yup.sh 2006-08-31 13:15:57.000000000 +0200
+++ yup/yup.sh 2006-09-20 14:30:40.000000000 +0200
@@ -32,27 +32,84 @@
# Proxy. The resulting configuration can be found in
# /etc/sysconfig/proxy and /root/.curlrc (authentication data).
#
-
-# globals
+# $Id: yup.sh 15 2006-09-19 13:14:20Z mge $
#
-CURL="/usr/bin/curl"
-CURLPARAMS="--silent --digest --remote-time"
+
+# Fail on errors.
+set -e
+
+# Obtain a temporary file which we will use to capture command output
+TMPFILE=$(mktemp -t example.XXXXXXXXXX)
+if test "x$TMPFILE" = "x" ; then
+ echo "Failed to create temp file"
+ exit 1
+fi
+
+# Clean up after us
+trap "rm -f $TMPFILE" EXIT
+
+function fetch_url() {
+ # Wrapper function: url [localfile]
+ # Fetch a URL to a local file; when the URL cannot be fetched
+ # successfully, display details and terminate.
+
+ url=$1
+ localfile=$2
+ if test x$localfile = "x"; then
+ localfile=$(basename $url)
+ fi
+
+ echo -n "Fetching $url... "
+ # Fetch the URL. As this command may fail, run it in a subshell so
+ # as not to exit immediately.
+
+ ( $YUP_CURL $YUP_CURLPARAMS $url -o $localfile > $TMPFILE 2>&1 )
+ rc=$?
+ if [ $rc -eq 0 ] ; then
+ echo "done"
+ else
+ echo "FAILED with exit code $rc"
+ echo "Failure details:"
+ echo "----------------------------------------------------------------------------"
+ cat $TMPFILE
+ echo "----------------------------------------------------------------------------"
+ echo "Exiting"
+ exit 1
+ fi
+ return 0
+}

# import the update parameters
-# ( YUP_DEST_DIR YUP_ID YUP_PASS YUP_ARCH YUP_PRODUCTS )
+# ( YUP_CURL YUP_CURLPARAMS YUP_DEST_DIR
+# YUP_ID YUP_PASS YUP_ID_SLED YUP_PASS_SLED
+# YUP_ID_SLES YUP_PASS_SLES YUP_ARCH YUP_PRODUCTS )
#
. /etc/sysconfig/yup

# evaluate update parameters
#
-echo "YUP_DEST_DIR="${YUP_DEST_DIR:="/tmp/SLE10-YUP"}
-echo "YUP_ARCH ="${YUP_ARCH:="i586"}
-echo "YUP_PRODUCTS="${YUP_PRODUCTS:="SLES10"}
+echo "YUP_CURL ="${YUP_CURL:="/usr/bin/curl"}
+echo "YUP_CURLPARAMS ="${YUP_CURLPARAMS:="--verbose --digest --remote-time --fail"}
+ # --verbose: we use a wrapper function and only display curl output in
+ # case of errors; in that case, we want details.
+ #
+ # --fail: we want curl to exit with a non-zero exit status when a URL
+ # could not be retrieved, in particular for things like invalid
+ # credentials (HTTP 403)
+
+echo "YUP_SERVER ="${YUP_SERVER:="update.novell.com"}
+echo "YUP_DEST_DIR ="${YUP_DEST_DIR:="/tmp/SLE10-YUP"}
+echo "YUP_ARCH ="${YUP_ARCH:="i586"}
+echo "YUP_PRODUCTS ="${YUP_PRODUCTS:="SLES10"}
#
if [ "$YUP_ID." = "." ] || [ "$YUP_PASS." = "." ] ; then
- echo "UpdateMirror not configured properly - please run: "
- echo "YaST->System->Sysconfig Editor->System->YUP"
- exit 1;
+ if [ "$YUP_ID_SLED." = "." ] || [ "$YUP_PASS_SLED." = "." ] ; then
+ if [ "$YUP_ID_SLES." = "." ] || [ "$YUP_PASS_SLES." = "." ] ; then
+ echo "UpdateMirror not configured properly - please run: "
+ echo "YaST->System->Sysconfig Editor->System->YUP"
+ exit 1;
+ fi
+ fi
fi

# import public proxy parameters; proxy-authentication params
@@ -65,78 +122,113 @@
#
if [ "$PROXY_ENABLED" = "yes" ]; then
if ! [ "$HTTPS_PROXY." = "." ]; then
- CURLPARAMS="$CURLPARAMS --proxy $HTTPS_PROXY"
+ YUP_CURLPARAMS="$YUP_CURLPARAMS --proxy $HTTPS_PROXY"
fi
fi

-for SLE in $YUP_PRODUCTS; do
- if [ "$SLE." = "SLES10." ]; then
- UPD="SLES10-Updates/sles-10"
- elif [ "$SLE." = "SLED10." ]; then
- UPD="SLED10-Updates/sled-10"
- elif [ "$SLE." = "SDK10." ]; then
- UPD="SLE10-SDK-Updates/sles-10"
- else
- echo "SLE $SLE unknown."
- exit 1
- fi
-
- bn="https://${YUP_ID}:${YUP_PASS}@update.novell.com/repo/\$RCE/${UPD}-${YUP_ARCH}/";
+for useARCH in $YUP_ARCH; do
+ for SLE in $YUP_PRODUCTS; do
+ useID=$YUP_ID
+ usePASS=$YUP_PASS
+ useSERVER=$YUP_SERVER
+ if [ "$SLE." = "SLES10." ]; then
+ UPD="SLES10-Updates/sles-10"
+ if [ "$YUP_ID_SLES." != "." ] && [ "$YUP_PASS_SLES." != "." ] ; then
+ useID=$YUP_ID_SLES
+ usePASS=$YUP_PASS_SLES
+ fi
+ if [ "$YUP_SERVER_SLES." != "." ] ; then
+ useSERVER=$YUP_SERVER_SLES
+ fi
+ elif [ "$SLE." = "SLED10." ]; then
+ UPD="SLED10-Updates/sled-10"
+ if [ "$YUP_ID_SLED." != "." ] && [ "$YUP_PASS_SLED." != "." ] ; then
+ useID=$YUP_ID_SLED
+ usePASS=$YUP_PASS_SLED
+ fi
+ if [ "$YUP_SERVER_SLED." != "." ] ; then
+ useSERVER=$YUP_SERVER_SLED
+ fi
+ elif [ "$SLE." = "SDK10." ]; then
+ UPD="SLE10-SDK-Updates/sles-10"
+ if [ "$YUP_ID." = "." ] || [ "$YUP_PASS." = "." ] ; then
+ if [ "$YUP_ID_SLES." = "." ] || [ "$YUP_PASS_SLES." = "." ] ; then
+ useID=$YUP_ID_SLED
+ usePASS=$YUP_PASS_SLED
+ else
+ useID=$YUP_ID_SLES
+ usePASS=$YUP_PASS_SLES
+ fi
+ fi
+ if [ "$YUP_SERVER." = "." ] ; then
+ if [ "$YUP_SERVER_SLES." = "." ] ; then
+ useSERVER=$YUP_SERVER_SLED
+ else
+ useSERVER=$YUP_SERVER_SLES
+ fi
+ fi
+ else
+ echo "Warning: SLE $SLE unknown. Proceeding anyways ..."
+ # exit 1
+ fi

- echo "Using $bn"
+ bn="https://${useID}:${usePASS}@${useSERVER}/repo/\$RCE/${UPD}-${useARCH}/";

- mkdir -p ${YUP_DEST_DIR}/${SLE}/${YUP_ARCH}
- cd ${YUP_DEST_DIR}/${SLE}/${YUP_ARCH}
+ echo "Using $bn"

- mkdir repodata 2>/dev/null
+ mkdir -p ${YUP_DEST_DIR}/${SLE}/${useARCH}
+ cd ${YUP_DEST_DIR}/${SLE}/${useARCH}

- # Always download all the necessary metadata
-
- $CURL $CURLPARAMS $bn/repodata/repomd.xml.asc -o repodata/repomd.xml.asc
- $CURL $CURLPARAMS $bn/repodata/repomd.xml.key -o repodata/repomd.xml.key
- $CURL $CURLPARAMS $bn/repodata/repomd.xml -o repodata/repomd.xml
- $CURL $CURLPARAMS $bn/repodata/filelists.xml.gz -o repodata/filelists.xml.gz
- $CURL $CURLPARAMS $bn/repodata/primary.xml.gz -o repodata/primary.xml.gz
- $CURL $CURLPARAMS $bn/repodata/patches.xml -o repodata/patches.xml
-
- # Download all the rpms mentioned in primary.xml.gz for the YUM repo.
- zcat repodata/primary.xml.gz|grep location.href| while read line ; do
- uri=`echo "$line"|sed -e 's/^[^"]*"//;s/".*$//;'`
- dn=`dirname $uri`
- test -d $dn || mkdir -p $dn
- test -f "$uri" || $CURL $CURLPARAMS "$bn/$uri" -o "$uri"
- echo $uri
- done
+ mkdir -p repodata 2>/dev/null

- # Download all the repo-md patches, cross check with SHA1 sum for changed ones.
- grep -E "(location.href|checksum.type..sha)" repodata/patches.xml| while read line ; do
- echo "$line"|grep "checksum.type..sha" >/dev/null
- res=$?
- if [ "$res" == "0" ]; then
- sha1=`echo "$line"|sed -e 's/^.*sha">//;s/<.checksum.*$//;'`
- else
- uri=`echo "$line"|sed -e 's/^[^"]*"//;s/".*$//;'`
- dn=`dirname $uri`
- test -d $dn || mkdir -p $dn
- nsum=`sha1sum "$uri"|sed -e 's/ .*//;'`
- if [ "x$nsum" != "x$sha1" ]; then
- echo "$uri is bad ($nsum / $sha1), reloading"
- rm -f "$uri"
+ # Always download all the necessary metadata
+
+ fetch_url "$bn/repodata/repomd.xml.asc" "repodata/repomd.xml.asc"
+ fetch_url "$bn/repodata/repomd.xml.key" "repodata/repomd.xml.key"
+ fetch_url "$bn/repodata/repomd.xml" "repodata/repomd.xml"
+ fetch_url "$bn/repodata/filelists.xml.gz" "repodata/filelists.xml.gz"
+ fetch_url "$bn/repodata/primary.xml.gz" "repodata/primary.xml.gz"
+ fetch_url "$bn/repodata/patches.xml" "repodata/patches.xml"
+
+ # Download all the rpms mentioned in primary.xml.gz for the YUM repo.
+ zcat repodata/primary.xml.gz|grep location.href| while read line ; do
+ uri=`echo "$line"|sed -e 's/^[^"]*"//;s/".*$//;'`
+ dn=`dirname $uri`
+ test -d $dn || mkdir -p $dn
+ test -f "$uri" || fetch_url "$bn/$uri" "$uri"
+ echo $uri
+ done
+
+ # Download all the repo-md patches, cross check with SHA1 sum for changed ones.
+ grep -E "(location.href|checksum.type..sha)" repodata/patches.xml| while read line ; do
+ echo "$line"|grep "checksum.type..sha" >/dev/null
+ res=$?
+ if [ "$res" == "0" ]; then
+ sha1=`echo "$line"|sed -e 's/^.*sha">//;s/<.checksum.*$//;'`
+ else
+ uri=`echo "$line"|sed -e 's/^[^"]*"//;s/".*$//;'`
+ dn=`dirname $uri`
+ test -d $dn || mkdir -p $dn
+ nsum=`sha1sum "$uri"|sed -e 's/ .*//;'`
+ if [ "x$nsum" != "x$sha1" ]; then
+ echo "$uri is bad ($nsum / $sha1), reloading"
+ rm -f "$uri"
+ fi
+ test -f "$uri" || fetch_url "$bn/$uri" "$uri"
+ echo $uri
fi
- test -f "$uri" || $CURL $CURLPARAMS "$bn/$uri" -o "$uri"
- echo $uri
- fi
- done
+ done

- # Download all the patch and delta rpms mentioned in the patches.
- grep location.href repodata/patch-*.xml| while read line ; do
- uri=`echo "$line"|sed -e 's/^[^"]*"//;s/".*$//;'`
- dn=`dirname $uri`
- test -d $dn || mkdir -p $dn
- test -f "$uri" || $CURL $CURLPARAMS "$bn/$uri" -o "$uri"
- echo $uri
- done
+ # Download all the patch and delta rpms mentioned in the patches.
+ grep location.href repodata/patch-*.xml| while read line ; do
+ uri=`echo "$line"|sed -e 's/^[^"]*"//;s/".*$//;'`
+ dn=`dirname $uri`
+ test -d $dn || mkdir -p $dn
+ test -f "$uri" || fetch_url "$bn/$uri" "$uri"
+ echo $uri
+ done

+ done
done

#

++++++ yup.sysconfig ++++++
--- yup/yup.sysconfig 2006-08-30 04:32:12.000000000 +0200
+++ yup/yup.sysconfig 2006-09-20 14:30:40.000000000 +0200
@@ -35,6 +35,22 @@
#

## Type: string
+## Default: "/usr/bin/curl"
+#
+# path and name of curl binary
+#
+YUP_CURL=""
+
+## Type: string
+## Default: "--verbose --digest --remote-time --fail"
+#
+# std parameters for curl:
+# --digest is vital for autentication
+# --verbose and --fail are necessary for correct error handling
+#
+YUP_CURLPARAMS=""
+
+## Type: string
## Default: "/tmp/SLE10-YUP"
#
# destination path (script will create subdirectories there)
@@ -47,6 +63,7 @@
# Machine ID: this value is in
# /etc/zmd/deviceid
# on the machine you registered with.
+# This is the default ID and also used for the SDK.
#
YUP_ID=""

@@ -56,18 +73,79 @@
# Machine Secret: this value is in
# /etc/zmd/secret
# on the machine you registered with.
+# This is the default Secret and also used for the SDK.
#
YUP_PASS=""

-## Type: list(i586,ppc,s390x,ia64,x86_64)
+## Type: string
+## Default: "update.novell.com"
+#
+# The update server to use
+#
+YUP_SERVER="update.novell.com"
+
+## Type: regexp([:xdigit:])
+## Default: ""
+#
+# Machine ID: this value is in
+# /etc/zmd/deviceid
+# on the machine you registered SLED with.
+# If not set, YUP_ID will be used.
+#
+YUP_ID_SLED=""
+
+## Type: regexp([:xdigit:])
+## Default: ""
+#
+# Machine Secret: this value is in
+# /etc/zmd/secret
+# on the machine you registered with.
+# If not set, YUP_PASS will be used.
+#
+YUP_PASS_SLED=""
+
+## Type: string
+## Default: ""
+#
+# The update server to use for SLED
+#
+YUP_SERVER_SLED=""
+
+## Type: regexp([:xdigit:])
+## Default: ""
+#
+# Machine ID: this value is in
+# /etc/zmd/deviceid
+# on the machine you registered SLES with.
+# If not set, YUP_ID will be used.
+#
+YUP_ID_SLES=""
+
+## Type: regexp([:xdigit:])
+## Default: ""
+#
+# Machine Secret: this value is in
+# /etc/zmd/secret
+# on the machine you registered SLES with.
+# If not set, YUP_PASS will be used.
+#
+YUP_PASS_SLES=""
+
+## Type: string
+## Default: ""
+#
+# The update server to use for SLES
+#
+YUP_SERVER_SLES=""
+
+## Type: string(i586,ppc,s390x,ia64,x86_64)
## Default: "i586"
#
-# Architecture to mirror
-# (currently it is only possible to mirror one architecture at one time)
+# Architecture(s) to mirror
#
YUP_ARCH=""

-## Type: list("SLES10","SLED10","SLES10 SDK10","SLED10 SDK10","SLES10 SLED10 SDK10")
+## Type: string("SLES10","SLED10","SLES10 SDK10","SLED10 SDK10","SLES10 SLED10 SDK10")
## Default: "SLES10"
#
# Products to mirror (SLES, SLED, with or without SDK)


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread