Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: Paul_123 on February 21, 2016, 09:55:34 AM

Title: Replace an extension in place
Post by: Paul_123 on February 21, 2016, 09:55:34 AM
Is there any ramification from replacing an extension without rebooting?

1-stop application
2-unmount extention, and delete /usr/local/tce.installed/nameofextension.tcz
3-replace extension
4-reload extension with tce-load
5-restart application
Title: Re: Replace an extension in place
Post by: Rich on February 21, 2016, 11:12:51 AM
Hi Paul_123
When I was working on the grabber extension my build script would remove the extension as follows:
1. Remove all the symlinks to the extension.
2. Unmount the extension.
3. Remove the extension.
4. Remove the extensions entry from  /usr/local/tce.icons  otherwise you get multiple icons in wbar.

Here are the relevant lines from my build script if it helps:
Code: [Select]
#!/bin/sh

PROGRAM="grabber"

# Remove symlinks
[ -f /usr/local/bin/"$PROGRAM" ] && sudo unlink /usr/local/bin/"$PROGRAM"
[ -f /usr/local/share/pixmaps/"$PROGRAM".png ] && sudo unlink /usr/local/share/pixmaps/"$PROGRAM".png
[ -f /usr/local/share/applications/"$PROGRAM".desktop ] && sudo unlink /usr/local/share/applications/"$PROGRAM".desktop
[ -f /usr/local/etc/"$PROGRAM".conf ] && sudo unlink /usr/local/etc/"$PROGRAM".conf
[ -f /usr/local/tce.installed/"$PROGRAM" ] && sudo unlink /usr/local/tce.installed/"$PROGRAM"
[ -f /usr/local/share/doc/License/"$PROGRAM"-License.txt ] && sudo unlink /usr/local/share/doc/License/"$PROGRAM"-License.txt

# Unmount extension
[ -e /tmp/tcloop/"$PROGRAM" ] && sudo umount /tmp/tcloop/"$PROGRAM"

# Remove extension
[ -e /tmp/tcloop/"$PROGRAM" ] && sudo rm -r /tmp/tcloop/"$PROGRAM"

# Remove wbar entries
sudo busybox sed -i '/\/usr\/local\/share\/pixmaps\/'"$PROGRAM"'.png/d' /usr/local/tce.icons
sudo busybox sed -i '/SelectiveScreenshot/d' /usr/local/tce.icons
sudo busybox sed -i '/\/usr\/local\/bin\/'"$PROGRAM"'/d' /usr/local/tce.icons
Title: Re: Replace an extension in place
Post by: Paul_123 on February 21, 2016, 01:31:03 PM
Thanks for the info.

What is the relavant code for "unlink"  ?

Title: Re: Replace an extension in place
Post by: Rich on February 21, 2016, 02:14:58 PM
Hi Paul_123
It's the section titled  # Remove symlinks
Title: Re: Replace an extension in place
Post by: Paul_123 on February 21, 2016, 06:48:40 PM
Hi Paul_123
It's the section titled  # Remove symlinks

I meant what is the function "unlink".  It is not a command built into piCore
Title: Re: Replace an extension in place
Post by: Rich on February 21, 2016, 07:26:29 PM
Hi Paul_123
Sorry, I misunderstood. It's in  coreutils.tcz.
Title: Re: Replace an extension in place
Post by: nitram on February 21, 2016, 11:59:08 PM
I meant what is the function "unlink".  It is not a command built into piCore
Code: [Select]
tc@box:~$ unlink --help
Usage: unlink FILE
  or:  unlink OPTION
Call the unlink function to remove the specified FILE.

      --help     display this help and exit
      --version  output version information and exit

GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
Report unlink translation bugs to <http://translationproject.org/team/>
Full documentation at: <http://www.gnu.org/software/coreutils/unlink>
or available locally via: info '(coreutils) unlink invocation'