WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Updating tcz apps  (Read 48121 times)

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
Re: Updating tcz apps
« Reply #15 on: June 10, 2009, 09:06:22 AM »
Your update script is getting better all the time. How about taking a crack at adding the dependencies as well.
big pc man

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: Updating tcz apps
« Reply #16 on: June 10, 2009, 11:47:31 AM »
It already does, since "tce-load $APP  wget install" works like appbrowser.  If you want it to update a dep that's already installed, you would run "update" on that particular extension.  

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
Re: Updating tcz apps
« Reply #17 on: June 10, 2009, 11:59:51 AM »
Yes I got that. What I meant was to go to the next level and check the deps to see if they have changed and then reinstall them if need be. In doing so the application including it's deps would be updated. Now that would be heroic.
big pc man

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: Updating tcz apps
« Reply #18 on: June 10, 2009, 12:28:11 PM »
Yes I got that. What I meant was to go to the next level and check the deps to see if they have changed and then reinstall them if need be. In doing so the application including it's deps would be updated. Now that would be heroic.

That would involve that whole issue of recording install dates, etc., etc., noted in another thread. Also, I like having the choice of what and what not to update. 

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
Re: Updating tcz apps
« Reply #19 on: June 10, 2009, 12:52:21 PM »
I get your point. Flexibility has many advantages over automation. I was just thinking there has been a lot of good work by Florian, jls_legalize and you on this subject.  Putting all three of your contributions together would be great. I would do it but I'm not up to your level yet.
Code: [Select]
from Florian

#!/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

Code: [Select]
jls_legalize
"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."

#!/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
big pc man

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: Updating tcz apps
« Reply #20 on: June 10, 2009, 08:52:22 PM »
I was thinking along similar lines after your previous post.  Download the md5.txt files associated with the apps in the tcz folder, and do a md5 -c with them.  The one's that FAIL need updating. 

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: Updating tcz apps
« Reply #21 on: June 11, 2009, 04:19:24 AM »
Bug fix (wasn't updating some files with name conflicts)

Edit: check-update script is listed in a separate thread


« Last Edit: December 08, 2009, 04:09:37 AM by jpeters »

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: Updating tcz apps
« Reply #22 on: June 11, 2009, 05:40:47 AM »
I was surprised after running check-update that about 10 extensions required updating. The update script completed the work in about a minute.  To be completely safe, though, I might reboot  at some point  :)
« Last Edit: June 11, 2009, 05:44:02 AM by jpeters »

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
Re: Updating tcz apps
« Reply #23 on: June 11, 2009, 09:59:10 AM »
I was surprised after running check-update that about 10 extensions required updating. The update script completed the work in about a minute.  To be completely safe, though, I might reboot  at some point  :)

Great progress! Thanks for the contributions to tinycore.
big pc man

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: Updating tcz apps
« Reply #24 on: June 11, 2009, 04:21:20 PM »
I was surprised after running check-update that about 10 extensions required updating. The update script completed the work in about a minute.  To be completely safe, though, I might reboot  at some point  :)

Great progress! Thanks for the contributions to tinycore.

Hope that works for now.  Given the time it takes to download & check md5's, keeping the two scripts separate seems best. 

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: Updating tcz apps
« Reply #25 on: June 12, 2009, 06:24:03 PM »
Adds check-update option "update -c"; help "update --help";  version "update --version".  If {tcz*,tce*} ext mistakingly included, opens help menu.  (for TC_2)

Edit: Added cleanup for check-update
Edit2: Fixed bug...relocated an exit
  

« Last Edit: December 08, 2009, 04:10:12 AM by jpeters »

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: Updating tcz apps
« Reply #26 on: June 14, 2009, 01:48:42 AM »
(for TC_2)
Update includes switches:
"update -c"           checks tce dir for update candidates
"update -d APP"   (eg, "update -d gnumeric")  checks dependencies for update candidates
"update --help"
"update --version"
"update APP"         Updates   (eg "update gnumeric" )  


« Last Edit: December 08, 2009, 04:10:48 AM by jpeters »

Offline nickispeaki

  • Full Member
  • ***
  • Posts: 177
Re: Updating tcz apps
« Reply #27 on: June 14, 2009, 01:36:57 PM »
tinycore 2.0:

1)emelfm2.tcz don't start after intalling by appbrowser....
emelfm.tcz works great!

2)leafpad don't work.

I think, may be dependencies of leafpad and emelfm2 doesn't sutisfied.

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: Updating tcz apps
« Reply #28 on: June 14, 2009, 02:11:44 PM »
I tried both with no problem. The dependencies should already be loaded after installing with appbrowser,  although wget install would load them if they weren't.  You might try "update -d leafpad" or emelfm2  to check on dependencies.  Did you type "update leafpad"  (not leafpad.tcz)?  Does it require a reboot to work (so far, I haven't had to).   note:  the update script works only for extensions that have been previously installed...so dependencies should already be loaded and presumably working.  
  
« Last Edit: June 14, 2009, 02:43:32 PM by jpeters »

Offline nickispeaki

  • Full Member
  • ***
  • Posts: 177
Re: Updating tcz apps
« Reply #29 on: June 14, 2009, 02:31:25 PM »
sh: update: not found
sh: upgrate: not found
 ???