[Lunar-commits] <lunar> Merge from theedge: - XOrg url - wget OPTS change - last_kernel() function

Auke Kok sofar at lunar-linux.org
Mon Jul 2 04:43:13 CEST 2012


commit 3fd0ba50218f9b49b1ba19c9a2d2135c0380d2a1
Author: Auke Kok <sofar at lunar-linux.org>
Date:   Mon Oct 16 19:32:56 2006 +0000

    Merge from theedge:
    - XOrg url
    - wget OPTS change
    - last_kernel() function
---
 etc/lunar/config                              |    1 +
 var/lib/lunar/functions/misc.lunar            |   10 +++++++++
 var/lib/lunar/menu/mirrors.menu               |   29 ++++++++++++++-----------
 var/lib/lunar/plugins/download-generic.plugin |   20 ++++++++++-------
 var/lib/lunar/unset.sh                        |    1 +
 5 files changed, 40 insertions(+), 21 deletions(-)

diff --git a/etc/lunar/config b/etc/lunar/config
index ac36810..19a52c1 100755
--- a/etc/lunar/config
+++ b/etc/lunar/config
@@ -75,6 +75,7 @@ export        DIALOGRC=/etc/lunar/dialogrc
            KERNEL_URL=ftp://ftp.kernel.org
            SFORGE_URL=http://osdn.dl.sourceforge.net/sourceforge
           XFREE86_URL=ftp://ftp.xfree86.org/pub/XFree86
+             XORG_URL=ftp://ftp.freedesktop.org/pub/xorg
           LRESORT_URL=http://download.lunar-linux.org/lunar/cache
 
       MOONBASE_URL[0]=http://lunar-linux.org/lunar/
diff --git a/var/lib/lunar/functions/misc.lunar b/var/lib/lunar/functions/misc.lunar
index 4880e54..6d3eb52 100644
--- a/var/lib/lunar/functions/misc.lunar
+++ b/var/lib/lunar/functions/misc.lunar
@@ -172,3 +172,13 @@ source_basename()
 {
 	echo $1 | sed 's/.tar.\(bz2\|gz\)$//g'
 }
+
+
+last_kernel()
+{
+	if [ -f /usr/src/linux/include/linux/utsrelease.h ]; then
+		grep UTS_RELEASE /usr/src/linux/include/linux/utsrelease.h | cut -d'"' -f2
+	else
+		grep UTS_RELEASE /usr/src/linux/include/linux/version.h | cut -d'"' -f2
+	fi
+}
diff --git a/var/lib/lunar/menu/mirrors.menu b/var/lib/lunar/menu/mirrors.menu
index 76e1718..9b8df55 100644
--- a/var/lib/lunar/menu/mirrors.menu
+++ b/var/lib/lunar/menu/mirrors.menu
@@ -26,7 +26,7 @@ select_mirror()  {
            --ok-label  "Select"            \
            --menu                          \
            ""                              \
-           0 70 10                         \
+           0 80 10                         \
            $(mirror_list $1)
 }
 
@@ -39,20 +39,22 @@ mirror_menu()  {
    SF_HELP="Select mirror for downloading SourceForge sources."
    LR_HELP="Select the mirror for a last resort download place."
     X_HELP="Select mirror for downloading XFree86 related sources."
+ XORG_HELP="Select mirror for downloading XOrg related sources."
       HELP="Selecting a mirror site can speed your downloads."
 
-    COMMAND=`$DIALOG  --title "Mirror Menu"     \
-                      --ok-label      "Select"  \
-                      --cancel-label  "Exit"    \
-                      --item-help               \
-                      --menu     ""  0 0 0      \
-                      "GNOME"    ""  "$N_HELP"  \
-                      "GNU"      ""  "$G_HELP"  \
-                      "KDE"      ""  "$K_HELP"  \
-                      "KERNEL"   ""  "$L_HELP"  \
-                      "SFORGE"   ""  "$SF_HELP" \
-                      "LRESORT"  ""  "$LR_HELP" \
-                      "XFREE86"  ""  "$X_HELP"`
+    COMMAND=`$DIALOG  --title "Mirror Menu"        \
+                      --ok-label      "Select"     \
+                      --cancel-label  "Exit"       \
+                      --item-help                  \
+                      --menu     ""  0 0 0         \
+                      "GNOME"    ""  "$N_HELP"     \
+                      "GNU"      ""  "$G_HELP"     \
+                      "KDE"      ""  "$K_HELP"     \
+                      "KERNEL"   ""  "$L_HELP"     \
+                      "SFORGE"   ""  "$SF_HELP"    \
+                      "LRESORT"  ""  "$LR_HELP"    \
+                      "XFREE86"  ""  "$X_HELP"     \
+                      "XORG"     ""  "$XORG_HELP"`											
 
   do
     case  $COMMAND in
@@ -61,6 +63,7 @@ mirror_menu()  {
           KDE)      MIRROR="     KDE_URL"    ;;
           KERNEL)   MIRROR="  KERNEL_URL"    ;;
           XFREE86)  MIRROR=" XFREE86_URL"    ;;
+          XORG)     MIRROR="    XORG_URL"    ;;
           SFORGE)   MIRROR="  SFORGE_URL"    ;;
           LRESORT)  MIRROR=" LRESORT_URL"    ;;
     esac
diff --git a/var/lib/lunar/plugins/download-generic.plugin b/var/lib/lunar/plugins/download-generic.plugin
index 5117b2e..c861f7f 100644
--- a/var/lib/lunar/plugins/download-generic.plugin
+++ b/var/lib/lunar/plugins/download-generic.plugin
@@ -27,33 +27,37 @@ plugin_source_download_generic()  {
   TMP_FILE=$TMPDIR/$2
 
   if [ "$FTP_ACTIVE" == "off" -o "$FTP_PASSIVE" == "on" ] ; then
-    WGET_FTP_CONNECTION="--passive-ftp"
+    WGET_OPTS+=" --passive-ftp"
   fi
 
   if [ "$CONTINUE" == "off" ] ; then
     erase $TMP_FILE
   else
-    WGET_PARTIAL="--continue"
+    WGET_OPTS+=" --continue"
   fi
 
   if [ "$USE_CACHE" == "off" ] ; then
-    WGET_CACHE="--cache=off"
+    WGET_OPTS+=" --cache=off"
   else
-    WGET_CACHE="--cache=on"
+    WGET_OPTS+=" --cache=on"
   fi
 
   if [ -n "$DOWNLOAD_RATE" ] ; then
-    WGET_RATE="--limit-rate=${DOWNLOAD_RATE}"
+    WGET_OPTS+=" --limit-rate=${DOWNLOAD_RATE}"
   fi
 
-  WGET_RETRIES="--tries=${NUM_RETRY:-5}"
+  if [ ${1:0:8} == "https://" ]; then
+    WGET_OPTS+=" --no-check-certificate"
+  fi
+
+  WGET_OPTS+=" --tries=${NUM_RETRY:-5}"
 
   [ -n "$http_proxy" ] && export http_proxy=$http_proxy
   [ -n  "$ftp_proxy" ] && export  ftp_proxy=$ftp_proxy
   [ -n   "$no_proxy" ] && export   no_proxy=$no_proxy
 
-  verbose_msg "calling \"wget $WGET_CACHE $WGET_RATE $WGET_FTP_CONNECTION $WGET_RETRIES $WGET_PARTIAL \"$URL$2\" --output-document $TMP_FILE\""
-  if erase $TMP_FILE && wget $WGET_CACHE $WGET_RATE $WGET_FTP_CONNECTION $WGET_RETRIES $WGET_PARTIAL "$URL$2" --output-document "$TMP_FILE" ; then
+  verbose_msg "calling \"wget $WGET_OPTS \"$URL$2\" --output-document $TMP_FILE\""
+  if erase $TMP_FILE && wget $WGET_OPTS "$URL$2" --output-document "$TMP_FILE" ; then
     # looks like it worked
     if testpack $TMP_FILE ; then
       if [ "$TMP_FILE" != "$3/$2" ]; then
diff --git a/var/lib/lunar/unset.sh b/var/lib/lunar/unset.sh
index 4e369d0..f1ef2fe 100644
--- a/var/lib/lunar/unset.sh
+++ b/var/lib/lunar/unset.sh
@@ -97,5 +97,6 @@ unset VIOLET
 unset VOYEUR
 unset WHITE
 unset XFREE86_URL
+unset XORG_URL
 unset XTRA
 unset YELLOW


More information about the Lunar-commits mailing list