Hello community, here is the log from the commit of package yup checked in at Thu Dec 14 01:27:44 CET 2006. -------- --- yup/yup.changes 2006-11-07 08:27:13.000000000 +0100 +++ /mounts/work_src_done/NOARCH/yup/yup.changes 2006-12-12 23:38:09.000000000 +0100 @@ -1,0 +2,31 @@ +Tue Dec 5 11:50:27 CET 2006 - mge@suse.de + +- add /etc/permissions.d/yup + +------------------------------------------------------------------- +Wed Nov 29 13:58:42 CET 2006 - mge@suse.de + +- enable use of several configuration files below + /etc/sysconfig/yup.d + (following a proposal of Marcel Ritter) + +------------------------------------------------------------------- +Thu Nov 16 12:04:11 CET 2006 - mge@suse.de + +- verify bin and src rpms, + thanks to Andreas Taschner for help + +------------------------------------------------------------------- +Wed Nov 8 13:04:56 CET 2006 - mge@suse.de + +- add downloading of src.rpms from you.novell.com + +------------------------------------------------------------------- +Mon Oct 30 10:39:53 CET 2006 - mge@suse.de + +- introduce YUP_SRCRPM variable and combine with + patch/idea from Heiko Helmle posted on suse-sles-s + Date: Mon, 30 Oct 2006 09:36:37 +0100 + Subject: New YUP version 47-0.6 + +------------------------------------------------------------------- New: ---- yup.permissions ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yup.spec ++++++ --- /var/tmp/diff_new_pack.dKge1W/_old 2006-12-14 01:27:20.000000000 +0100 +++ /var/tmp/diff_new_pack.dKge1W/_new 2006-12-14 01:27:20.000000000 +0100 @@ -11,22 +11,23 @@ # norootforbuild Name: yup +BuildRequires: libidn-devel openssl-devel perl %if 0%{suse_version} < 1010 %define curl_name curl %define curl_version 7.15.5 -License: GNU General Public License (GPL) - all versions, MOZILLA PUBLIC LICENSE (MPL/NPL) +License: GNU General Public License (GPL), MOZILLA PUBLIC LICENSE (MPL/NPL) %else -License: GNU General Public License (GPL) - all versions, MOZILLA PUBLIC LICENSE (MPL/NPL) +License: GNU General Public License (GPL), MOZILLA PUBLIC LICENSE (MPL/NPL) BuildArch: noarch %endif -BuildRequires: libidn-devel openssl-devel Version: 47 -Release: 6 +Release: 13 Summary: "Yum Update Proxy" for SLE 10 Maintenance Source0: yup.sh Source1: yup.sysconfig Source2: yup.1.pod Source3: COPYING.GPL +Source4: yup.permissions %if 0%{suse_version} < 1010 Source10: %{curl_name}-%{curl_version}.tar.bz2 Patch2: %{curl_name}-%{curl_version}-lfs.patch @@ -74,11 +75,13 @@ %build pod2man --center=" " --release="%{version}-%{release}" --date="$(date)" %{S:2} > yup.$$$$; perl -p -e 's/.if n .na/.\\\".if n .na/;' yup.$$$$ > yup.1; +chmod 644 yup.1 rm -f yup.$$$$ %if 0%{suse_version} < 1010 cd %{curl_name}-%{curl_version} autoreconf -fi -CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" ./configure \ +CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \ +./configure \ --prefix=%{_prefix} \ --program-suffix=-yup \ --enable-ipv6 \ @@ -90,9 +93,6 @@ %endif %install -if [ -n "$RPM_BUILD_ROOT" ] ; then - [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT -fi %if 0%{suse_version} < 1010 cd %{curl_name}-%{curl_version} make install DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir} @@ -108,17 +108,18 @@ cd .. %endif mkdir -p $RPM_BUILD_ROOT/usr/sbin \ + $RPM_BUILD_ROOT/etc/permissions.d \ $RPM_BUILD_ROOT/usr/share/man/man1 \ $RPM_BUILD_ROOT/var/adm/fillup-templates -install -m 755 %{S:0} $RPM_BUILD_ROOT/usr/sbin/yup -install -m 644 %{S:1} $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.yup -install -m 644 yup.1 $RPM_BUILD_ROOT/usr/share/man/man1/yup.1 +install -c -m 755 %{S:0} $RPM_BUILD_ROOT/usr/sbin/yup +install -c -m 600 %{S:1} $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.yup +install -c -m 644 %{S:4} $RPM_BUILD_ROOT/etc/permissions.d/yup +install -c -m 644 yup.1 $RPM_BUILD_ROOT/usr/share/man/man1/yup.1 %if 0%{suse_version} < 1010 sed -i -e "s,/usr/bin/curl,/usr/bin/curl-yup,g" $RPM_BUILD_ROOT/usr/sbin/yup sed -i -e "s,/usr/bin/curl,/usr/bin/curl-yup,g" $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.yup sed -i -e "s,/usr/bin/curl,/usr/bin/curl-yup,g" $RPM_BUILD_ROOT/usr/share/man/man1/yup.1 %endif -gzip -9 $RPM_BUILD_ROOT/usr/share/man/man1/yup.1 cp -a %{S:3} . # # rpm -qa --queryformat='%%{name}/%%{version}/%%{release}/%%{arch}\n'| sort | bzip2 -9 > USEDFORBUILD.bz2 @@ -128,6 +129,8 @@ %defattr(-,root,root) %attr(700, root, root) /usr/sbin/yup /usr/share/man/man1/yup.1.gz +%attr(600, root, root) /etc/permissions.d/yup +%attr(644, root, root)/usr/share/man/man1/yup.1* /var/adm/fillup-templates/sysconfig.yup # %doc USEDFORBUILD.bz2 %doc COPYING.GPL @@ -141,13 +144,27 @@ %{fillup_and_insserv -i -n yup} %clean -if [ -n "$RPM_BUILD_ROOT" ] ; then - [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT -fi +rm -rf $RPM_BUILD_ROOT %changelog -n yup +* Tue Dec 05 2006 - mge@suse.de +- add /etc/permissions.d/yup +* Wed Nov 29 2006 - mge@suse.de +- enable use of several configuration files below + /etc/sysconfig/yup.d + (following a proposal of Marcel Ritter) +* Thu Nov 16 2006 - mge@suse.de +- verify bin and src rpms, + thanks to Andreas Taschner for help +* Wed Nov 08 2006 - mge@suse.de +- add downloading of src.rpms from you.novell.com * Tue Nov 07 2006 - meissner@suse.de - use 644 manpage permissions +* Mon Oct 30 2006 - mge@suse.de +- introduce YUP_SRCRPM variable and combine with + patch/idea from Heiko Helmle posted on suse-sles-s + Date: Mon, 30 Oct 2006 09:36:37 +0100 + Subject: New YUP version 47-0.6 * Tue Oct 24 2006 - meissner@suse.de - fixed the regular expressions for the sysconfig variable range. [:xdigit:]{32} -> ^[[:xdigit:]]{32}$ ++++++ yup.1.pod ++++++ --- yup/yup.1.pod 2006-10-12 17:49:33.000000000 +0200 +++ /mounts/work_src_done/NOARCH/yup/yup.1.pod 2006-12-12 12:20:08.000000000 +0100 @@ -8,21 +8,18 @@ =head1 SYNOPSIS -yup has no cmd-line paramters; for configuration see B<OPTIONS> below. +Yup does not take command line parameters; for configuration see B<OPTIONS> below. =head1 DESCRIPTION -This packages allows to configure an update-mirror for Novell maintenance packages for SUSE Linux Enterprise 10. - -Please make sure, that the number of systems to serve with the mirrored packages is in compliance with the number of subscriptions you are allowed to exercise according to your contract with Novell. - -yup is delivered without any maintenance, support and warranty. +Yup is a tool to mirror updates for Novell maintenance packages for SUSE Linux +Enterprise 10 products. =head1 OPTIONS =head2 Network Configuration -yup uses the system's proxy settings as configured in F</etc/sysconfig/proxy>. In addition, secrets for proxy-authentication should be stored in F</root/.curlrc>. This is done automatically, if the YaST proxy-module is used. There are only two relevant proxy-settings (besides authentication): +Yup uses the system's proxy settings as configured in F</etc/sysconfig/proxy>. In addition, secrets for proxy-authentication should be stored in F</root/.curlrc>. This is done automatically, if the YaST proxy-module is used. There are only two relevant proxy-settings (besides authentication): =over @@ -36,23 +33,25 @@ =back -=head2 Configuration File +=head2 Configuration File(s) + +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). -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). +Alternatively, it is possible to put several configuration files into the (hardcoded) directory F</etc/sysconfig/yup.d>; Yup loops over those files, the single file F</etc/sysconfig/yup> is ignored in this case. =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). +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 for autentication, --verbose and --fail are necessary for correct error handling, default F<--verbose --digest --remote-time --fail> +Standard parameters for curl: --digest is vital for authentication, --verbose and --fail are necessary for correct error handling, default F<--verbose --digest --remote-time --fail> =item YUP_DEST_DIR -Destination path (script will create subdirectories there), default: F</tmp/SLE10-YUP> +Destination path (script will create sub-directories there), default: F</tmp/SLE10-YUP> =item YUP_ID @@ -110,15 +109,72 @@ =back -=head1 ERRORS +Additionally here are some paramters for downloading the SRC-RPMs. +At the moment those packages are located on a different server (F<you.novell.com>), +but in full sync with F<update.novell.com>. + +=over + +=item YUP_SRCRPM + +Include .src.rpms in mirror? Default: F<no> Enable with F<you>, to download from F<you.novell.com>, later in 2007 also downloads from F<update.novell.com> might be possible; enable this with F<yes>. + +=item YOU_NCC_ACCOUNT + +Your NCC account (necessary F<for you.novell.com>) + +=item YOU_NCC_PASSWORD + +Your NCC password (necessary F<for you.novell.com>) + +=item YOU_SERVER + +F<you.novell.com> + +=back + +=head1 ERROR HANDLING + +Yup will exit with an error status if meta data for a catalog (for example, the +list of patches) cannot be downloaded. Yup will continue working when a regular +data file in a catalog, like an RPM package, cannot be downloaded, but will +exit with an error code later on. -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 BUGS + +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 -/etc/sysconfig/proxy -/etc/sysconfig/yup -/root/.curlrc +=over + +=item /etc/sysconfig/yup + +Yup's primary configuration file + +=item /etc/sysconfig/proxy + +Proxy settings for HTTP and HTTPS + +=item /root/.curlrc + +Configuration file for curl. + +=back + +=head1 SEE ALSO + +The Novell knowledge base, L<http://support.novell.com>. + +L<curl(1)> + +=head1 NOTES + +Please make sure, that the number of systems to serve with the mirrored +packages is in compliance with the number of subscriptions you are allowed to +exercise according to your contract with Novell. + +Yup is delivered without any maintenance, support and warranty. =head1 AUTHOR ++++++ yup.sh ++++++ --- yup/yup.sh 2006-10-12 18:25:38.000000000 +0200 +++ /mounts/work_src_done/NOARCH/yup/yup.sh 2006-12-12 12:20:54.000000000 +0100 @@ -32,7 +32,7 @@ # Proxy. The resulting configuration can be found in # /etc/sysconfig/proxy and /root/.curlrc (authentication data). # -# $Id: yup.sh 44 2006-10-12 16:25:37Z mge $ +# $Id: yup.sh 76 2006-11-29 12:59:37Z mge $ # # Fail on errors in simple commands. @@ -43,14 +43,14 @@ # Obtain a temporary file which we will use to capture curl command output CURLTMPFILE=$(mktemp -t yup.XXXXXXXXXX) -if test "x$CURLTMPFILE" = "x" ; then +if test "${CURLTMPFILE}." = "." ; then echo "Failed to create temp file" exit 1 fi # Obtain another temporary file which we will use for loop data LOOPTMPFILE=$(mktemp -t yup.XXXXXXXXXX) -if test "x$LOOPTMPFILE" = "x" ; then +if test "${LOOPTMPFILE}." = "." ; then echo "Failed to create temp file" exit 1 fi @@ -65,7 +65,7 @@ url=$1 localfile=$2 - if test x$localfile = "x"; then + if test "${localfile}." = "."; then localfile=$(basename $url) fi @@ -90,203 +90,306 @@ return 0 } -# import the update parameters -# ( 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_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"} -if [ "$YUP_DEBUGINFO." = "yes." ] ; then - YUP_PRODUCTS="${YUP_PRODUCTS:=SLES10} SLE10-Debug" -else - YUP_PRODUCTS="${YUP_PRODUCTS:=SLES10}" -fi -if [ "$YUP_SDK." = "yes." ] ; then - YUP_PRODUCTS="$YUP_PRODUCTS SDK10" -fi -echo "YUP_PRODUCTS =$YUP_PRODUCTS" - -# -if [ "$YUP_ID." = "." ] || [ "$YUP_PASS." = "." ] ; then - 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; +function verify_rpm() { + url=$1 + if [ -x /bin/rpm ] ; then + rpm -qKsp --nosignature $url > /dev/null + rc=$? + if [ $rc -eq 0 ] ; then + echo "" + else + if test -f "$uri"; then + echo " broken file, renaming, ..." + mv $url $url.broken + fi fi fi -fi +} -# import public proxy parameters; proxy-authentication params -# are in /root/.curlrc and automatically evaluated by curl. -# ( PROXY_ENABLED HTTPS_PROXY ) -# -. /etc/sysconfig/proxy +function fetch_repodata() { + bn=$1 + # 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" +} -# evaluate proxy parameters -# -if [ "$PROXY_ENABLED" = "yes" ]; then - if ! [ "$HTTPS_PROXY." = "." ]; then - YUP_CURLPARAMS="$YUP_CURLPARAMS --proxy $HTTPS_PROXY" +function fetch_binrpms() { + bn=$1 + # Download all the rpms mentioned in primary.xml.gz for the YUM repo. + if [ "${YUP_SRCRPM}." = "yes." ] ; then + zcat repodata/primary.xml.gz | grep -E "location[[:space:]]*href" > $LOOPTMPFILE + else + zcat repodata/primary.xml.gz | grep -E "location[[:space:]]*href" | grep -v 'rpm/src' > $LOOPTMPFILE fi -fi - -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." = "SLE10-Debug." ]; then - UPD="SLE10-Debuginfo-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 + { + while read line ; do + uri=`echo "$line"|sed -e 's/^[^"]*"//;s/".*$//;'` + dn=`dirname $uri` + test -d $dn || mkdir -p $dn + echo -e -n "$uri" + verify_rpm "$uri" + if ! test -f "$uri"; then + if ! fetch_url "$bn/$uri" "$uri" ; then + errorlog="$errorlog $bn/$uri" fi + verify_rpm "$uri" fi - if [ "$YUP_SERVER." = "." ] ; then - if [ "$YUP_SERVER_SLES." = "." ] ; then - useSERVER=$YUP_SERVER_SLED - else - useSERVER=$YUP_SERVER_SLES + done + } < $LOOPTMPFILE + return 0 +} + +function fetch_srcrpms() { + bn=$1 + # Download all the rpms mentioned in primary.xml.gz for the YUM repo. + zcat repodata/primary.xml.gz | grep -E "location[[:space:]]*href" | grep 'rpm/src' > $LOOPTMPFILE + { + while read line ; do + uri=`echo "$line"|sed -e 's/^[^"]*"//;s/".*$//;'` + dn=`dirname $uri` + test -d $dn || mkdir -p $dn + echo -e -n "$uri" + verify_rpm "$uri" + if ! test -f "$uri"; then + if ! fetch_url "$bn/$uri" "$uri" ; then + errorlog="$errorlog $bn/$uri" fi + verify_rpm "$uri" fi - else - echo "Warning: SLE $SLE unknown. Proceeding anyways ..." - # exit 1 - fi - - bn="https://${useID}:${usePASS}@${useSERVER}/repo/\$RCE/${UPD}-${useARCH}" - - echo "Using $bn" - - mkdir -p ${YUP_DEST_DIR}/${SLE}/${useARCH} - cd ${YUP_DEST_DIR}/${SLE}/${useARCH} - - mkdir -p repodata 2>/dev/null - - # 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" + done + } < $LOOPTMPFILE + return 0 +} - # Download all the rpms mentioned in primary.xml.gz for the YUM repo. - zcat repodata/primary.xml.gz|grep location.href > $LOOPTMPFILE - { - while read line ; do +function fetch_repomd() { + bn=$1 + # Download all the repo-md patches, cross check with SHA1 sum for changed ones. + grep -E "(location[[:space:]]*href|checksum[[:space:]]*type..sha)" repodata/patches.xml > $LOOPTMPFILE + { + while read line ; do + echo "$line"|grep "checksum[[:space:]]*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 - if ! test -f "$uri"; then - if ! fetch_url "$bn/$uri" "$uri" ; then + nsum=`sha1sum "$uri"|sed -e 's/ .*//;'` + if [ "${nsum}." != "${sha1}." ]; then + echo "$uri is bad ($nsum / $sha1), reloading" + rm -f "$uri" + fi + if ! test -f "$uri" ; then + if ! fetch_url "$bn/$uri" "$uri" ; then errorlog="$errorlog $bn/$uri" fi fi echo $uri - done - } < $LOOPTMPFILE + fi + done || exit $? + } < $LOOPTMPFILE +} - # Download all the repo-md patches, cross check with SHA1 sum for changed ones. - grep -E "(location.href|checksum.type..sha)" repodata/patches.xml > $LOOPTMPFILE - { - 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" +function fetch_patchrpms() { + bn=$1 + # Download all the patch and delta rpms mentioned in the patches. + grep -E "location[[:space:]]*href" repodata/patch-*.xml > $LOOPTMPFILE + { + while read line ; do + uri=`echo "$line"|sed -e 's/^[^"]*"//;s/".*$//;'` + dn=`dirname $uri` + test -d $dn || mkdir -p $dn + if ! test -f "$uri" ; then + if ! fetch_url "$bn/$uri" "$uri" ; then + errorlog="$errorlog $bn/$uri" + fi + fi + echo $uri + done || exit $? + } < $LOOPTMPFILE +} + +# import the update parameters +# ( 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 ) +# +if [ -d /etc/sysconfig/yup.d ] ; then + YUP_CONFIGs=" $( find /etc/sysconfig/yup.d/ -type f ) " +else + YUP_CONFIGs=" /etc/sysconfig/yup " +fi + +for CC in $YUP_CONFIGs; do + if [ -r $CC ]; then + echo "Using config file $CC" + . $CC + # evaluate update parameters + # + 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 "YOU_SERVER ="${YUP_SERVER:="you.novell.com"} + echo "YUP_DEST_DIR ="${YUP_DEST_DIR:="/tmp/SLE10-YUP"} + echo "YUP_ARCH ="${YUP_ARCH:="i586"} + if [ "${YUP_DEBUGINFO}." = "yes." ] ; then + YUP_PRODUCTS="${YUP_PRODUCTS:=SLES10} SLE10-Debug" + else + YUP_PRODUCTS="${YUP_PRODUCTS:=SLES10}" + fi + if [ "${YUP_SDK}." = "yes." ] ; then + YUP_PRODUCTS="$YUP_PRODUCTS SDK10" + fi + echo "YUP_PRODUCTS =$YUP_PRODUCTS" + + # + if [ "${YUP_ID}." = "." ] || [ "${YUP_PASS}." = "." ] ; then + 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 + # are in /root/.curlrc and automatically evaluated by curl. + # ( PROXY_ENABLED HTTPS_PROXY ) + # + . /etc/sysconfig/proxy + + # evaluate proxy parameters + # + if [ "$PROXY_ENABLED" = "yes" ]; then + if ! [ "$HTTPS_PROXY." = "." ]; then + YUP_CURLPARAMS="$YUP_CURLPARAMS --proxy $HTTPS_PROXY" + fi + fi + + # + # get via yup-channel + # + 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}." = "SLE10-Debug." ]; then + UPD="SLE10-Debuginfo-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 ! test -f "$uri" ; then - if ! fetch_url "$bn/$uri" "$uri" ; then - errorlog="$errorlog $bn/$uri" + 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 - echo $uri + else + echo "Warning: SLE $SLE unknown. Proceeding anyways ..." + # exit 1 fi + bn="https://${useID}:${usePASS}@${useSERVER}/repo/\$RCE/${UPD}-${useARCH}" + echo "Using $bn" + mkdir -p ${YUP_DEST_DIR}/${SLE}/${useARCH} + cd ${YUP_DEST_DIR}/${SLE}/${useARCH} + mkdir -p repodata 2>/dev/null + fetch_repodata $bn + fetch_binrpms $bn + fetch_repomd $bn + fetch_patchrpms $bn done || exit $? - } < $LOOPTMPFILE + done || exit $? - # Download all the patch and delta rpms mentioned in the patches. - grep location.href repodata/patch-*.xml > $LOOPTMPFILE - { - while read line ; do - uri=`echo "$line"|sed -e 's/^[^"]*"//;s/".*$//;'` - dn=`dirname $uri` - test -d $dn || mkdir -p $dn - if ! test -f "$uri" ; then - if ! fetch_url "$bn/$uri" "$uri" ; then - errorlog="$errorlog $bn/$uri" + # + # Get Source RPMs + # + if [ "${YUP_SRCRPM}." = "you." ] ; then + YUP_CURLPARAMS=$( echo $YUP_CURLPARAMS | sed s/--digest//g ); + YUP_CURLPARAMS="$YUP_CURLPARAMS --basic --user $YOU_NCC_ACCOUNT:$YOU_NCC_PASSWORD " + for useARCH in $YUP_ARCH; do + useSERVER=$YOU_SERVER + for SLE in $YUP_PRODUCTS; do + if [ "${SLE}." = "SLES10." ]; then + UPD="SUSE-SLES/10" + elif [ "${SLE}." = "SLED10." ]; then + UPD="SUSE-SLED/10" + elif [ "${SLE}." = "SDK10." ]; then + UPD="SLE-SDK/10" + else + echo "Warning: SLE $SLE unknown. Proceeding anyways ..." + # exit 1 fi - fi - echo $uri + YOU_useARCH=$( echo $useARCH | sed s/i586/i386/g ); + bn="https://${useSERVER}/update/$YOU_useARCH/update/${UPD}" + echo "Using $bn" + mkdir -p ${YUP_DEST_DIR}/${SLE}/${useARCH} + cd ${YUP_DEST_DIR}/${SLE}/${useARCH} + mkdir -p repodata 2>/dev/null + fetch_repodata $bn + fetch_srcrpms $bn + done || exit $? done || exit $? - } < $LOOPTMPFILE - done || exit $? -done || exit $? - -if test "x$errorlog" != "x"; then - echo "Error exit delayed from previous errors" - echo "Problematic URIs were: $errorlog" - exit 1 -fi + fi + # + # Error Report + # + if test "${errorlog}." != "."; then + echo "Error exit delayed from previous errors" + echo "Problematic URIs were: $errorlog" + exit 1 + fi + fi +done # -# Finis Africae +# Finis Africae # ++++++ yup.sysconfig ++++++ --- yup/yup.sysconfig 2006-10-24 10:13:07.000000000 +0200 +++ /mounts/work_src_done/NOARCH/yup/yup.sysconfig 2006-12-12 12:25:08.000000000 +0100 @@ -168,3 +168,31 @@ # YUP_SDK="no" +## Type: list(yes,no,you) +## Default: "no" +# +# Include .src.rpms in mirror? +# +YUP_SRCRPM="no" + +## Type: string +## Default: "" +# +# The NCC account (necessary for you.novell.com) +# +YOU_NCC_ACCOUNT="" + +## Type: string +## Default: "" +# +# The NCC password (necessary for you.novell.com) +# +YOU_NCC_PASSWORD="" + +## Type: string +## Default: "you.novell.com" +# +# The YOU server to use +# +YOU_SERVER="you.novell.com" + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org