General TC > Programming & Scripting - Unofficial

view repository info.lst and display already downloaded + loaded tcz extentions


this post was a large part of the inspiration/motivation for this script

--- Quote from: roberts on April 11, 2012, 06:01:59 PM ---1. With "Load local", I am using a standard FLTK widget that just so happens to offer "favorites" where you can create a shortcut to selecting a file. I my drop that standard widget and just reuse some of my existing code. That way, I could display only "not already loaded" extensions that would be more practical and consistent with the rest of the layout.

--- End quote ---

i have imagined at times that it would be a good thing to see
what extensions all ready down loaded
and after coming a cross the above quote
 it seems to make seance to see
what extensions are loaded as well as down loaded

the script needs less.tcz to display colours  (to use it without less it needs modification)
and it will also download info.lst
i have only used it on 4.x

--- Code: ---#!/bin/sh
. /etc/init.d/tc-functions
 # is less instaled
 if [ ! -f /usr/local/tce.installed/less ] ; then
   tce-load -iw less

 # is info.lst avalible
 if [ ! -f /etc/sysconfig/tcedir/info.lst ] ; then
   url=`cat /opt/tcemirror`
   v=`version` ;v=${v:0:1}


   if [ "${v:0:1}" = "4" ] ; then
     tcz_path=`cat /opt/.tcedir`/optonal

   wget -P $dir $u

  # cat $info_file |less -r
info=`cat $info_file`

# do stuff
for i in $info
  if [ ! -f $tcz_path/$i ] ; then
       # extentions in repository
       #echo " >$i"

${NORMAL}  > $i"

${NORMAL}  > $i"

       # extentions downloaded
       #echo "< ${GREEN}$i${NORMAL}"
       tmp_string="<   ${GREEN}$i${NORMAL}"
       # extentions loaded
       if [ -f $tcz_installed/${i%.*} ] ; then
        tmp_string="<${YELLOW}!  ${GREEN}$i${YELLOW}!${NORMAL}"


# show all
 echo "$tmp_info"|less -r

# show local only (loaded&notloaded)
  #echo "$already_downloaded" |less -r
# show remote only
  #echo "$not_already_downloaded" |less -r

--- End code ---
hears is quick key
<    downloaded
<!   downloaded +loaded
   > not downloaded 
and a screenshot

#^ April 16, 2012
 # ----
edit see also tce-status !


[0] Message Index

Go to full version