WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: tce upgrade script missing  (Read 5187 times)

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
tce upgrade script missing
« on: March 06, 2009, 06:21:45 PM »
It would be useful a tce upgrade script that checks and eventually download extensions from the repository if newer then the local that the user has.
dCore user

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: tce upgrade script missing
« Reply #1 on: March 06, 2009, 09:07:40 PM »
Actually the ability to remove and upgrade libraries was one of the reasons behind the uninstall utilities.  But we had removed the version numbers from the names of extensions, especially library ones to reduce the need to constantly update .dep files with each time a library extension was updated.  Without those version numbers in the extension name, there is no simple and reliable way to automate checking for newer extensions.  Well, the timestamps of the extensions on ibiblio could be compared with files in the system.  But to be honest I think this is a degree of automation that goes well beyond what a nomadic, normally RAM based system needs.  Personally I would rather make the decision of which extensions in the system to remove and upgrade on a one by one basis.

Offline mikshaw

  • Sr. Member
  • ****
  • Posts: 368
Re: tce upgrade script missing
« Reply #2 on: March 06, 2009, 11:37:54 PM »
I suppose you could theoretically make a script that checks the date that the desired extension is added to the repository...don't know how reliable that would be.

I'm with Jason, though.  There's only so far an automated system can go before it gets into an area where there is a whole lot of extra code written just to check and compare files, when it's just simper to leave it up to the user to download what you want.  Honestly, the abilitiy of keeping packages updated all the time is overrated.  Some apps I use have had multiple upgrades over the years, but I see no reason to grab those upgrades because they really don't make the app any better for me.

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
Re: tce upgrade script missing
« Reply #3 on: March 07, 2009, 03:00:25 AM »
the version of an extension is written in the info file
dCore user

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: tce upgrade script missing
« Reply #4 on: March 07, 2009, 07:09:59 AM »
If the extension is stored somewhere, the md5sum could be checked. If it's not the same as the latest from ibiblio, a newer extension would be available.
The only barriers that can stop you are the ones you create yourself.

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: tce upgrade script missing
« Reply #5 on: March 07, 2009, 07:40:50 AM »
Md5 would work if the extension was kept.  But to support PPI the timestamp of the /usr/local/tce.installed files could be compared to the extensions on ibiblio.  TC's time and date routine seems to work well even though my system clocks are in poor maintenance. 

That or the script fetching the version number from the info file on the server and storing it, and then comparing it to what is available on the server with each run.

Offline tobiaus

  • Suspended
  • Hero Member
  • *****
  • Posts: 599
Re: tce upgrade script missing
« Reply #6 on: March 08, 2009, 09:23:32 PM »
hopefully this would be an extension, too.

Offline florian

  • Full Member
  • ***
  • Posts: 116
    • Home Page
Re: tce upgrade script missing
« Reply #7 on: March 09, 2009, 07:09:25 PM »
Hi,
I had created this script to check wether I had latest version of a particular extension.
Maybe the participants of this thread will find it useful too.

Code: [Select]
#!/bin/sh

# computes a md5sum of the tce/tcz extension file passed as a parameter,
# and compares it with the md5 checksum stored on the online repository.

# this for instance allows to detect if a new version of an extension
# is available.

MD5=/tmp/$(basename $0)_$$.md5
clean() { rm -f $MD5 $MD5.server 2>/dev/null ; }
die() { echo "$1"; clean; exit 1; }
. /etc/init.d/tc-functions

[ $# = 1 ] || die "Usage: $(basename $0) EXTENSION"
[ -f "$1" ] || die "$1: no such file"

MIRROR=`awk '/Mirror/ {print $2}' /opt/.tcrc`
PROTOCOL=`awk '/Protocol/ {print $2}' /opt/.tcrc`
stringinstring .tce "$1" && REPO="tce"
stringinstring .tcz "$1" && REPO="tcz"

[ -z $REPO ] && die "$1: not a tce or tcz extension file"
URL="$PROTOCOL"://"$MIRROR"/"$REPO"/"$1"

trap clean SIGHUP SIGINT SIGTERM
md5sum "$1" > $MD5
wget -q "$URL.md5.txt" -O $MD5.server || die "can't fetch checksum from server"
diff $MD5 $MD5.server > /dev/null || die "differs from server"
clean

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: tce upgrade script missing
« Reply #8 on: March 09, 2009, 09:43:08 PM »
I haven't looked at it very closely...just copied/pasted and ran...."upgrade_script /tcZ/extension.tcz".
Couldn't get it to work...just got  "wget: server returned error: HTTP/1.1 404 Not Found
can't fetch checksum from server"   

Offline tobiaus

  • Suspended
  • Hero Member
  • *****
  • Posts: 599
Re: tce upgrade script missing
« Reply #9 on: March 09, 2009, 11:40:34 PM »
i can't ever use wget to download anything from the main download site., for this reason. if you make aria2 a dep of this uninstaller, i've used that to download tinycore instead of wget.

you could try using ftp instead of http? tce-fetch uses wget -q, but i don't know why it succeeds.

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
Re: tce upgrade script missing
« Reply #10 on: May 03, 2009, 06:36:25 PM »
if u launch this script from a dir containg extensions and u save the script made above by florian tce-chk.sh
my script elencates at the end all the extensions that are not up to date.

Code: [Select]
#!/bin/sh
#controlla se tutte le estensioni presenti directory corrente sono aggiornate
#checks if all the extensions in the current dir are uptodate
#jls_legalze unsenepopiu at tin dot it

FILETMP=`mktemp`
for FILE in *; do
if [ -f $FILE ]; then
estensione=${FILE##*.}
if [ $estensione = tce ] || [ $estensione = tcz ] || [ $estensione = tcel ] || [ $estensione = tczl ] || [ $estensione = tcem ] || [ $estensione = tczm ] || [ $estensione = tcelm ] || [ $estensione = tczlm ]; then
if [ `tce-chk.sh $FILE` ]; then
echo "ok"
else
echo "errori:"
echo $FILE >> $FILETMP
fi
fi
fi
done
cat $FILETMP
rm -f $FILETMP
dCore user