WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Replace an extension in place  (Read 2368 times)

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1228
Replace an extension in place
« 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

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11515
Re: Replace an extension in place
« Reply #1 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

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1228
Re: Replace an extension in place
« Reply #2 on: February 21, 2016, 01:31:03 PM »
Thanks for the info.

What is the relavant code for "unlink"  ?


Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11515
Re: Replace an extension in place
« Reply #3 on: February 21, 2016, 02:14:58 PM »
Hi Paul_123
It's the section titled  # Remove symlinks

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1228
Re: Replace an extension in place
« Reply #4 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

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11515
Re: Replace an extension in place
« Reply #5 on: February 21, 2016, 07:26:29 PM »
Hi Paul_123
Sorry, I misunderstood. It's in  coreutils.tcz.

Offline nitram

  • Hero Member
  • *****
  • Posts: 1054
Re: Replace an extension in place
« Reply #6 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'