Tiny Core Linux

General TC => Programming & Scripting - Unofficial => Topic started by: coreplayer2 on December 29, 2014, 05:53:21 PM

Title: Firefox - Extension to install the latest version
Post by: coreplayer2 on December 29, 2014, 05:53:21 PM
First, this script was designed to download and package as a tcz extension the latest version of firefox for TC-5.x and TC-6.x, however it has become a little more than that.

This version will attempt to detect the current latest official firefox download, then package it up as a firefox-official extension and install it.
There are options to specify the exact version desired if this differs from the latest, or if this script is no longer able to detect the latest version.because of a change in the mozilla latest web page..??
Additionally, an option to manually edit the firefox download http or ftp address is provided should anyone have specific localization requests.

This script is an updater and an installer.  it does not require any previous install of firefox at all.
This version of the script supports

tc-5-x86
tc-5-x86_64
tc-6-x86
tc-6-x86_64

The newly created firefox-official extension is a direct replacement, therefore will upgrade a previously installed version if found
eg: firefox-official.tcz from both tc-5-x86 & tc-6-x86 repo's

Additionally is a direct replacement for
firefox.tcz from the tc-5-x86_64 repo, however this extension will not be automatically upgraded, there will be an option to uninstall it before the script exit's

With this script (soon to be extension) these previously mentioned firefox-official extensions will no longer be supported and are likely redundant.

In the case of
firefox.tcz from the tc-5-x86_64 and
firefox.tcz from both tc-5-x86 & tc-6-x86 repo's
there is provided a means of uninstalling these outdated firefox extensions if currently installed in the systems onboot.lst
this script will not uninstall any previously installed firefox extensions unless you opt-in to do so
The onus is on the user to uninstall older and possibly conflicting firefox extensions, but I've tried to do the next best thing in that regard.

The only drawback as far as I can see is the process will probably require a reasonably good connection and some free space in terms of memory and permanent storage. 

I'll be grateful for feedback and suggestions



A huge thank you to those who have been helping to test this script.
I should also thank aus9 who's original script inspired me

Title: Re: Topic: Firefox - Extension to install the latest version
Post by: coreplayer2 on December 29, 2014, 06:01:15 PM
To use:

download the script
set executable permissions
run the script until completion
uninstall old version as required
then reboot

:)
Title: Re: Topic: Firefox - Extension to install the latest version
Post by: Misalf on December 29, 2014, 07:27:29 PM
Quote
The only drawback as far as I can see is the process will probably require a reasonably good connection [...]

I will test and report back as soon as my 3G connection limit kicks in (after downloading 5GB of data the speed is limited to 56Kbit/s). For now I know it works flawlessly at ~2Mbit/s. I'll go watching some youtube with firefox-official. (;
Title: Re: Topic: Firefox - Extension to install the latest version
Post by: coreplayer2 on December 29, 2014, 08:00:48 PM
I'm guessing if you have no problems with a 3G connection then I think we're safe!!  concern debunked..   2Mbit/s is fast compared to data plans we used to have
[emoji12]




Sent from my iPhone using Tapatalk
Title: Re: Topic: Firefox - Extension to install the latest version
Post by: coreplayer2 on December 29, 2014, 08:05:57 PM
So how long did it take to download the Firefox tar file, 20 seconds?


Sent from my iPhone using Tapatalk
Title: Re: Topic: Firefox - Extension to install the latest version
Post by: Misalf on December 29, 2014, 08:47:24 PM
~260 - ~310 Kilo Bytes per second it takes about 2 minutes 37 seconds. Just tested.

~8 Kilo Bytes per second, for a 40+ MB file will probably take like two hours. At least.. q:

Still downloading random stuff. (:
Title: Re: Topic: Firefox - Extension to install the latest version
Post by: coreplayer2 on December 30, 2014, 12:33:51 AM
Yikes but that is in throttled me de?


Sent from my iPad using Tapatalk HD
Title: Re: Topic: Firefox - Extension to install the latest version
Post by: Misalf on December 30, 2014, 02:37:08 PM
2h would be throttled mode, yes. I'm living in the stone age of the internet from time to time. ):
However, my ISP is either too lazy or doesn't care to check my bandwidth consumption or it really likes me because the bandwidth limit don't want to kick in this month for some reason. It usually does. Yay! (:

Anyway, I'm using a quite simple wget script to make sure a troublesome download will not totally fail:
Some stuff might look familiar.. (:
Code: [Select]
#!/bin/sh
## Author: Misalf
## v 0.1
## Jun-6-2014

echo -e "\033]0;Wget...\007"

#. /etc/init.d/tc-functions
#useBusybox

trap 'echo -e "\033]0;$\007" ; line="=" ; f_line ; trap 2 ; kill -2 $$' 1 2 3 13 15

##******************************************************************************************************************
##***************************************************Functions******************************************************
## coreplayer2

## Draws a line at full screen-width  ( use xy=(line#) for row position ;   linecolor=([0]-[7]) linebold=([0]-[7]) ;  line=([char]) )
f_line() {
wide=`stty size | cut -d" " -f2`
#printf "\033[3;0H"
echo -ne "\033[0${linebold};3${linecolor}m "
printf '%*s\n' "$(( wide-2 ))" '' | tr ' ' $line
printf "\033[00m"
}

## Check Connection / URL
f_chkconn () {
echo -ne "\033[00;35m Using\033[01;30m: \033[00;32m${WGET} \033[01;30m::"
echo -e "\033[00;35m URL\033[01;30m: \033[00;36m${URL}"

line="-"
f_line

echo -ne "\033[00;36m Testing connection to server\033[01;30m... \033[00m"
${WGET} -s -T 20 "${URL}" 2>/dev/null &
rotdash $!
case $? in
0) echo -e "\033[00;32mOK \033[00m"; cx=0;;
1) echo -e "\033[00;31mFail\033[00;33m!\033[00m"; cx=1; f_line; exit 1;;
esac
}
##******************************************************************************************************************
##******************************************************************************************************************

f_resolve_url() {
url=$1
domain=`echo $url | sed 's-^[^/]*/*\([^/]*\)/\?.*$-\1-'`
ipaddr=`ping -c 1 $domain | sed -n 's@^.*(\([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\).*$@\1@p' | head -1`
req_url=`echo $url | sed "s-/[^/]\+-/$ipaddr-"`
wget $req_url
}

##******************************************************************************************************************

#WGET="$(which wget)"
WGET="$(which busybox) wget"

if [ -z "$1" ]; then
echo -e "\033[00;31m No download specified\033[01;30m."
echo -e "\033[00;33m Exiting\033[01;30m..."
sleep 3
exit 1
else
if [ -z "$2" ]; then
DIR="."
URL="$1"
else
DIR="$1"
if [ ! -d "${DIR}" ]; then
echo -e "\033[00;31m Directory does not exist\033[01;30m:"
echo -e "\033[01;34m ${DIR}/"
echo -e "\033[00;33m Exiting\033[01;30m..."
sleep 3
exit 1
fi
URL="$2"
fi
fi

linebold=1
linecolor=0
line="="
f_line

f_chkconn

echo -e "\033[00;35m Downloading to\033[01;30m:"
echo -e "\033[00;34m ${DIR}/\033[00;33m${URL##*/}"
line="-"
f_line

if [ -f ${DIR}/${URL##*/} ]; then
echo -e "\033[00;35m Continuing download\033[01;30m..."
else
echo -e "\033[00;35m Starting download\033[01;30m..."
fi

##******************************************************************************************************************

echo -ne "\033]0;Wget: ${URL##*/}\007"

RETRYNUM=0
while true; do
RETRYNUM=$((RETRYNUM+1))
###xterm -title "Wget: ${URL}" -e $(which busybox) wget -P ${DIR} -c ${URL}
echo -ne "\033[00;32m"
#${WGET} -P ${DIR} -c ${URL} && (echo -e "\n\033[00;33m DONE.") ; break || (echo -e "\033[00;31mERROR\033[01;30m = \033[00;33m$?\n\n\033[00;35mRetrying...\033[00m" ; sleep 2)
${WGET} -P ${DIR} -c ${URL}
EL=$?
case $EL in
0)
echo -e "\n\033[00;33m DONE. Press any key to exit."
line="="
f_line
break
;;
*)
echo -e "\033[00;31m ERROR\033[01;30m = \033[00;33m${EL}"
linebold=0
linecolor=1
line="-"
f_line
linebold=1
linecolor=0
echo -ne "\033[00;35m Waiting 5 seconds\033[01;30m... \033[00;33m"
sleep 5 &
rotdash $!
echo -e "\033[00;35mRetrying\033[01;30m (\033[00;35m#${RETRYNUM}\033[01;30m)\033[00m"
;;
esac
done

read junk

echo -e "\033[00m"

Title: Re: Topic: Firefox - Extension to install the latest version
Post by: coreplayer2 on January 05, 2015, 04:31:05 PM
For now I know it works flawlessly at ~2Mbit/s. I'll go watching some youtube with firefox-official. (;

I take that as the script is working as intended..  :)

ok extension submitted ( named it  "firefox-latest.tcz" )
Title: Re: Topic: Firefox - Extension to install the latest version
Post by: coreplayer2 on January 07, 2015, 06:36:42 PM
I just noticed that Firefox v35.0 is soon to be released..    Unfortunately the download links and release page hasn't been updated yet..

The update script probably will not auto detect an update until 35.0.1 or higher is released :(


Title: Re: Topic: Firefox - Extension to install the latest version
Post by: coreplayer2 on January 17, 2015, 11:24:06 PM
**Update**

Get Latest Firefox script now updated to support cloud mode install (issue found and fixed while testing on TinyCorePure64.ISO/CD boot )
and fixed Firefox major version update detection
eg: firefox v34.0.05 to v35.0 now properly detected.

new script attached and updated extension submitted

Title: Re: Topic: Firefox - Extension to install the latest version
Post by: coreplayer2 on January 26, 2015, 09:48:32 PM
firefox-latest.tcz (extension) installs (or updates firefox-official to) latest version 35.0.1
Title: Re: Topic: Firefox - Extension to install the latest version
Post by: coreplayer2 on April 02, 2015, 12:37:39 AM
firefox-latest.tcz (extension) creates a new firefox-official extension (or updates a previously installed firefox-official.tcz) to latest version 37.0

in the following versions and architectures
tc-5-x86
tc-5-x86_64
tc-6-x86
tc-6-x86_64

Code: [Select]
Repo in use: http://repo.tinycorelinux.net/6.x/x86/tcz
 TCE directory in use: /mnt/sda2/tc6-x86/optional
 Warning! sda2 has only 10% free space remaining 
===============================================================================

 Fetching dependencies..
 Verifying connection to server, please wait...
 connection ok
squashfs-tools is already downloaded.
/etc/sysconfig/tcedir/optional/squashfs-tools.tcz: OK
wget is already downloaded.
wget.tcz: OK
bzip2 is already downloaded.
bzip2-lib.tcz: OK
bzip2.tcz: OK
file is already downloaded.
file is already installed!
gtk2 is already downloaded.
gtk2 is already installed!
libasound is already downloaded.
libasound is already installed!
dbus-glib is already downloaded.
dbus-glib is already installed!
hicolor-icon-theme is already downloaded.
hicolor-icon-theme is already installed!
cairo is already downloaded.
cairo is already installed!
gamin is already downloaded.
gamin is already installed!

 Acquiring latest version..
 You may choose from the selection at any time, however
   (1) The Latest version 37.0 is
       automatically processed after (30sec) timeout.
 
 Alternatively, choose a download option as desired
   (2) Specify firefox version, or
   (3) Edit download path directly,
       eg. for localization, version..

Title: Re: Topic: Firefox - Extension to install the latest version
Post by: coreplayer2 on April 03, 2015, 10:46:20 PM
Within a couple of days since Firefox version 37.0 release, there is yet another update..  version 37.0.1  is available

At least is a few Mb smaller


use firefox-latest.tcz to get it (install new or update current version)
or use update script from http://forum.tinycorelinux.net/index.php/topic,17942.msg108498.html#msg108498 (http://forum.tinycorelinux.net/index.php/topic,17942.msg108498.html#msg108498)
Title: Re: Topic: Firefox - Extension to install the latest version
Post by: coreplayer2 on April 23, 2015, 05:23:10 PM
Firefox v37.0.2 is available

Use firefox-latest.tcz extension to fetch and create the latest firefox-official.tcz,
simply reboot to install.

Consider deleting the 'firefox-official.tcz.md5.txt' file to prevent Apps > Update from downgrading to an older version when you next run Apps > Update

Title: Re: Topic: Firefox - Extension to install the latest version
Post by: coreplayer2 on May 17, 2015, 11:52:18 AM
Firefox v38.0.1 is available

Finally a version where flash v11.x works effortlessly

Use firefox-latest.tcz extension to fetch and create the latest firefox-official.tcz,
simply reboot to install.

Consider deleting the 'firefox-official.tcz.md5.txt' file to prevent Apps > Update from downgrading to an older version when you next run Apps > Update
Title: Re: Topic: Firefox - Extension to install the latest version
Post by: Misalf on May 17, 2015, 12:36:43 PM
Great!
Effortlessly for the update script or for Firefox itself?
If the latter, what effort was needed before?
I use the getFlash11 extension regularly to update Flash and it just-works in my personal custom Firefox extension.
Title: Re: Topic: Firefox - Extension to install the latest version
Post by: coreplayer2 on May 17, 2015, 01:00:05 PM
the latter,   it seem there was always some occasional minor glitch which required a restart to make flash work...   I'm pleased to find in v38.0.1 no such glitches :)


The update extension is working great also


However I've not tested yet the phenomena where Flash fails to load when there is no sound module loaded, this is not a firefox issue though..
Title: Re: Topic: Firefox - Extension to install the latest version
Post by: coreplayer2 on September 29, 2015, 07:46:21 PM
Update!!

With the help of many testers, thanks guys for your valuable feedback.   We have been updating this extension in stages.

Stage 1,   (completed)
Updates the architecture detection to automatically create Firefox for
i)   x86 (tc-32bit),
ii)  x64 (tc-32bit user-space apps on x86_64 kernel) and
iii) corepure64 (pure x86_64) configurations.

Stage 2,   (completed)
Updated to provide Firefox with locale support (complete language support as provided by Mozilla).
Detection of local language support is based on the "lang=xxxx" bootcode which modifies the download script resulting in creation of a locale specific, latest Firefox extension

Stage 3,   (in progress)
Support for .mar incremental upgrades for folks who are bandwidth challenged (if I can get this to work as advertised).


Other fixes
1. detection of free-space remaining,   (completed)
Which now reports free space in MB's available (instead of %).  This feature also limits firefox download and extension creation with less than 200MB remaining.  (fixed)

2. timeout menu's,   (in progress)
Will try to replace time-out menus with command line arguments.  the idea behind this is to assist in efficient uninterrupted extension build without missing the menu objective.

3, Name changes,    (in progress)
With the current forum discussion of older unsafe Firefox versions in repo's, perhaps it's time to revisit a name change for the created firefox extension.

a, I'm thinking simply firefox.tcz (replacing firefox-official.tcz). 

b, Perhaps also take the opportunity to submit and maintain the current firefox-ESR to the repo, this being the latest Extended Support Release.  long lasting secure revision for the repo, with less frequent updates is easier to maintain..?

c, Also maybe appropriate to change the name of this extension with an appropriate description.
I'm thinking "firefox-getLatest.tcz"  in keeping with the creation of a latest extension as opposed to firefox-latest.tcz which implies is the latest version..?

4, some minor cleanup..



thoughts..??


I've attached here the current script which incorporates the above completed changes, extension will be updated soon.
Title: Re: Topic: Firefox - Extension to install the latest version
Post by: coreplayer2 on October 06, 2015, 04:20:57 PM
Progress Update!!

New firefox-getLatest.tcz  (submitted for all x86 and x86_64 repos) which
creates a new firefox.tcz (extension) with locale support, more details below.

Updates to architecture detection for creation of firefox.tcz for  (completed)
i)   core x86 (tc-32bit),
ii)  core64 x64 (tc-32bit user-space apps on x86_64 kernel) and
iii) corepure64 (pure x86_64) configurations.


Locale support  (completed)
locale support for Firefox; complete language support as provided by Mozilla.     
Detection of local language support is based on the "lang=xxxx" bootcode which modifies the
download script resulting in creation of a locale specific, latest Firefox extension


Support for .mar incremental upgrades for folks who are bandwidth challenged (if I can get this to work as advertised).
 (in progress)


Other fixes 
1. detection of free-space remaining,  (completed)
Which now reports free space in MB's available (instead of %).  This feature also limits Firefox download and extension creation with less than 200MB remaining.


2. timeout menu's, (completed)
Replace time-out menus with command line arguments.  the idea behind this is to assist in uninterrupted extension build process


3, Name changes,   (completed)
With the current forum discussion of older unsafe Firefox versions in repo's, perhaps it's also time to revisit a name change for the created firefox extension.

a, Now simply firefox.tcz (replacing firefox-official.tcz).  (completed)

c, Also changed the name of this extension with an appropriate description.
"firefox-getLatest.tcz"  in keeping with the creation of a latest extension as opposed to firefox-latest.tcz which implies is the latest version  (completed)

d, changed permissions of created extension in keeping with tc guidelines

4, some minor cleanup..


Note: the new firefox-getLatest.tcz  replaces
the depreciated firefox-latest.tcz currently in repo
Additionally the newly created Firefox.tcz extension
replaces the depreciated local firefox-official.tcz extension

Title: Re: Topic: Firefox - Extension to install the latest version
Post by: coreplayer2 on October 06, 2015, 04:54:24 PM
I've attached the latest script used in the new firefox-getlatest.tcz (extension) here
Title: Re: Firefox - Extension to install the latest version
Post by: Lee on October 07, 2015, 11:40:50 AM
Quote
I've attached the latest script used in the new firefox-getlatest.tcz (extension) here
* firefox-getLatest.sh (14.3 kB - downloaded 3 times.)

I tried out this script under Core 4.7.7 / x86 and it worked except for one instance where the target of wget didn't explicitly start with either "http://" nor "ftp://".  Once I changed

Code: [Select]
wget -q $latestVER
to

Code: [Select]
wget -q http://$latestVER
it ran and produced the extension as expected.

Very nice!

It is, however, an  annoyance that the script goes so far as to add the new extension to onboot.lst.

(FWIW, its also annoys me that tce-load -wi adds things to onboot.lst.  Making an extension load onboot should be available but should be an "opt-in" choice, not an "opt-out" choice.)
Title: Re: Firefox - Extension to install the latest version
Post by: gerald_clark on October 07, 2015, 02:46:12 PM
Then don't do tce-load -iw.  Instead do
tce-load -w
tce-load -i
Title: Re: Firefox - Extension to install the latest version
Post by: yiyus on October 07, 2015, 04:00:47 PM
To be honest, the options are quite confusing.

When you want a new package, you can use -wi if you want to add it to onboot, -wo if you want to add it to ondemand, or -wil if you just want to install it for this session. If you only want to download it, you can use -w. Then, later you can install with -i, but the result you get is not like running -wi, it is like running -wil.

I find this not only counter intuitive, but also inconvenient, because I usually just want to try the package (so I use -wil) and decide later if I want to load it on boot, but I have to edit the onboot file for that, tce-load knows how to do it  but it does not handle this case.

Wouldn't it be more natural to have a flag to download, a flag to install, and a flag to add to onboot or ondemmand and combine these flags? I guess it would be hard to find the right moment to make a change like this, but I hope it eventually gets fixed.

(Sorry for the off-topic. The firefox extension looks good, but it has not hit the repos near to me yet).
Title: Re: Firefox - Extension to install the latest version
Post by: coreplayer2 on October 07, 2015, 10:10:49 PM
I tried out this script under Core 4.7.7 / x86 and it worked except for one instance where the target of wget didn't explicitly start with either "http://" nor "ftp://".  Once I changed
Code: [Select]
wget -q $latestVERto
Code: [Select]
wget -q http://$latestVERit ran and produced the extension as expected.

Very nice!


Lee, I'm a little baffled by this because the address to download the web page with current release information always begins ftp.

The base address defined earlier in the script is always this, which includes ftp.
Code: [Select]
latestVER="ftp.mozilla.org/pub/mozilla.org/firefox/releases/latest/linux-i686/en-US"
this address variable is then modified during the architecture check and then again during a locale check
Code: [Select]
latestVER=${latestVER/linux-i686/linux-x86_64}parameter substitution replaces arch (and locale). therefore (assuming en_US locale, the result can only be either
ftp.mozilla.org/pub/mozilla.org/firefox/releases/latest/linux-i686/en-US , or
ftp.mozilla.org/pub/mozilla.org/firefox/releases/latest/linux-x86_64/en-US



Interestingly this is not related to the Firefox archive download and placing http in front an ftp address should have failed to determine the current release version. 
so I think there is possibility the script failed because of some other reason,  perhaps during one of the intentional connection checks.  Then when you tried again the connection quality had improved.. 

Please try again after removing the http://  prefix, I'm anxious to hear the result

:)

Title: Re: Firefox - Extension to install the latest version
Post by: curaga on October 08, 2015, 12:38:30 AM
@coreplayer2, older busybox wget always required http:// or ftp:// in urls. I submitted a patch for that some time ago, where it adds http:// if no protocol prefix exists. 4.x must be before that.
Title: Re: Firefox - Extension to install the latest version
Post by: yiyus on October 08, 2015, 02:23:27 AM
Quote
It is, however, an  annoyance that the script goes so far as to add the new extension to onboot.lst.

After a second thought, I think there is an easy fix for this. Just change line 550 to:

Code: [Select]
grep -q firefox-getLatest.tcz ${tce_dir}/$bootlist && grep -q firefox.tcz ${tce_dir}/$bootlist || echo "firefox.tcz" >> ${tce_dir}/$bootlist

(or maybe it would be even better to do a s/firefox-getLatest.tcz/firefoz.tcz/ substitution)

Then, firefox.tcz will be added to the onboot list only if firefox-getLatest was in that list, which I think is more polite than always adding firefox.tcz.
Title: Re: Firefox - Extension to install the latest version
Post by: coreplayer2 on October 08, 2015, 06:52:17 AM
@curaga    ok I hear you now..    We need to test for wget version ?? 



@lee   sorry I misunderstood  (I think)


Will look at a resolution to this asap
Title: Re: Firefox - Extension to install the latest version
Post by: curaga on October 08, 2015, 01:03:01 PM
No need to test if you always include the protocol.
Title: Re: Firefox - Extension to install the latest version
Post by: coreplayer2 on October 11, 2015, 09:13:04 AM
I tried out this script under Core 4.7.7 / x86 and it worked except for one instance where the target of wget didn't explicitly start with either "http://" nor "ftp://".  Once I changed

Code: [Select]
wget -q $latestVER
to

Code: [Select]
wget -q http://$latestVER
it ran and produced the extension as expected.

Very nice!

OK Lee, I understand the problem now.  I  assume the one instance where it failed was on tc-4.x ? which the script has not been tested on otherwise I would have probably caught the issue.  has been tested on tc-5.x and tc-6.x only, in any case busybox version of wget is forced.   I was wrong with the protocol prefix so have added http:// to latestVER="ftp.mozilla.org/pub/mozilla.org/firefox/releases/latest/linux-i686/en-US" 
I'll have to look for an old tc-4.x to test on.  Thanks for pointing this out.

code now reads
Code: [Select]
latestVER="http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/latest/linux-i686/en-US"
this also gave me another idea  (more later..)

Quote
It is, however, an  annoyance that the script goes so far as to add the new extension to onboot.lst.
Isn't this the default action of APPS?   
I'm thinking that anyone wanting to download or update a commonly used application would want the browser available each time they boot.. am I wrong in that assumption..??
If I'm wrong with that assumption, then the philosophy behind Apps is also wrong..?
I don't honestly know where to go with this..  I think the consensus would be to have a commonly used application available on every boot.

It's an easy fix but my fear is it would confuse many folks

Title: Re: Firefox - Extension to install the latest version
Post by: coreplayer2 on October 11, 2015, 10:18:02 AM
I forgot to include a screenshot, getting the latest Firefox...

(https://db.tt/C9pNXZ5K)
Title: Re: Firefox - Extension to install the latest version
Post by: nitram on October 11, 2015, 12:03:09 PM
Both arguments have merit.

// Isn't this the default action of APPS?
Apps defaults to 'OnBoot' but patiently waits for user to press 'Go', providing option to toggle Onboot/OnDemand before install. User also has option via CLI, tce-load -wi vs tce-load -wo.

// I'm thinking that anyone wanting to download or update a commonly used application would want the browser available each time they boot.. am I wrong in that assumption..??
It's also the heaviest application many users have in /optional, so i could see how some would prefer an OnDemand option. Personally, firefox.tcz resides in OnDemand as i want quick boots to compile/test extensions, often use a lighter browser, don't use Firefox every session.

// It's an easy fix but my fear is it would confuse many folks
Maybe clarify. Don't understand how an OnBoot/OnDemand option would be confusing. That's how TC works, user has full control over the install process. In situations like Lee and myself, user wouldn't need to clean up onboot.lst after install.

Just providing feedback, it's your script so you can write how you want :)
Title: Re: Firefox - Extension to install the latest version
Post by: coreplayer2 on October 11, 2015, 02:09:53 PM
Thank you nitram for your interesting view on this subject, here is my view

I'm convinced that majority of new tc users are not entirely familiar with onboot or ondemand usage and simply expect a downloaded application to be installed and loaded on every boot.  similarly most new users are confused when recent changes to their system are not replicated on each and every reboot, clearly this is evident when they haven't grasped the application of persistence.
In my experience and I'm referring back when I was new to TC, I wanted every app downloaded to be installed on every boot up.  If there wasn't a need for an application on every bootup I simply wouldn't download it, or would remove it.  But I'm wiser now and at least know I can choose to download to my local extension store or have it available each reboot or ondemand.

Experienced users like yourself will undoubtedly know the benefits of onboot or ondemand and would setup their boot lists accordingly to taste or system ability.
For example I setup my ondemand and onboot items based on frequently used applications;  my main GoTo applications in onboot and less frequently used applications in ondemand; like this
Code: [Select]
onboot
firefox.tcz

ondemand
firefox-getLatest.tcz
 

Quote
Apps defaults to 'OnBoot' but patiently waits for user to press 'Go', providing option to toggle Onboot/OnDemand before install
or other choices which are unclear to the new user.  when presented with choices they don't yet fully understand new users will always accept the default as being the best choice based on experienced users who developed the menu.   It's hard to see a toggle choice as an argument in opposition of onboot, when onboot is still the preferred default.

Quote
Maybe clarify. Don't understand how an OnBoot/OnDemand option would be confusing
Quote
It's an easy fix but my fear is it would confuse many folks
I remember when new to TC and being confused, if I had downloaded an app to the tcz store and it did not load on the next or successive reboots was my reference..   In those scenarios I came to use "Apps > Load app locally"  way too frequently..   

Quote
User also has option via CLI, tce-load -wi vs tce-load -wo.
How many new tc users are even aware an tce-load cli option exists...??  experienced users have the choice to change / load anyway they want to. 

I could be wrong but I think anyone connected to the internet will want a browser on every boot as their GoTo app (eg firefox not only browses the web but has builtin support to read text files, image files and pdf files and likely more that I haven't discovered yet..).  If anyone has gone to the effort of installing one regardless of which brand, it's most likely their most important app for everything they do on a day to day basis.  so why not have it available on every boot?
You might say that installing via Apps you have the choice??  well I would argue only experienced users know that choice exists, for everybody else (ie the vast majority) the default is onboot.

As an updater to an existing installation; firefox-getLatest could easily be configured to load onboot if an onboot entry existed (actually wouldn't need to do much since the solution already exists).
As an initial installer; firefox-getLatest could easily be configured to download then load on a one-time basis,  leaving it to the user to figure out they have to add firefox to the onboot list to have it appear on a reboot.  (maybe that view is biased but shows exactly what I'm trying to avoid..??)

New users simply want things to work without delving into the mechanics of the system, while experienced users can choose to change the way their system operates as they wish, as usual.

I'm a believer of the "What's right, not who's right concept"  so what's the right thing to do here to respect new users and  experienced users alike..?

perhaps a Poll??
Title: Re: Firefox - Extension to install the latest version
Post by: yiyus on October 11, 2015, 05:37:05 PM
I have proposed a similar solution before, but I messed up with the formatting so you may have missed it.

You could grep for firefox-getLatest in onboot and ondemand and add the generated extension only to the lists in which getLatest is found. Then, new users will get firefox by default just pressing Ok and it will not get too much in the way of more advanced users.

I can send you a patch if you want.

For an installer extension I am working on (for plan9port), what I am doing is to try to load the generated extension when the installer is loaded and generate it if not present, so that the user just have to install the installer however he wants and it will work as expected.
Title: Re: Firefox - Extension to install the latest version
Post by: nitram on October 11, 2015, 07:16:34 PM
// Thank you nitram for your interesting view...
Get that a lot :)

//I'm convinced that majority of new tc users are not entirely familiar with onboot or ondemand usage and simply expect a downloaded application to be installed and loaded on every boot.
If you're convinced then good enough, just keep as is.

My view is different:
  - New users will not likely use your script and will simply install firefox-ESR via Apps
  - By the time they use your script, the user will understand the difference between OnBoot and OnDemand
  - You're only a new user once for a brief period of time, the script will be used regularly (Firefox release cycle) and they might appreciate the option

//...most new users are confused when recent changes to their system are not replicated on each and every reboot, clearly this is evident when they haven't grasped the application of persistence.
OnBoot, OnDemand and persistence are clearly documented (eg wiki, Core book).
It's not your fault if users don't read documentation.
The script could be adjusted to read something like:
    Which version? enter_version_#
    Install (1) OnBoot or (2) OnDemand, inexpereienced users please enter 1 (OnBoot): enter_1_or_2

//How many new tc users are even aware an tce-load cli option exists...??
As above, it's clearly documented.
Apps browser 'OnBoot' is clearly a choicebox dropdown.

// I'm a believer of the "What's right, not who's right concept"  so what's the right thing to do here to respect new users and  experienced users alike..?
Give users a choice, everyone will benefit.
If the OnBoot 'default' is clearly described and OnDemand is an option, why not?

// perhaps a Poll??
  - Might not be fair, new users won't likely vote
  - Can't see why experienced users wouldn't appreciate the option
  - Don't believe this forum supports polls

Stimulating chat. As before, it's your script so however you think is best is the way to go. I appreciate it takes a lot of work to make even minor changes to a script in regards to coding, testing and distributing. Maybe just a non-committed 'to do' review for later?
Title: Re: Firefox - Extension to install the latest version
Post by: Lee on October 13, 2015, 07:16:04 PM
Sorry - I was out of touch for couple of days.  Took me all day to read up on the the thread and write (I was trying to do it between tasks at work)...

coreplayer2 said:
Quote
I  assume the one instance where it failed was on tc-4.x ?

Yes - I was only testing on 4.7.7.

Quote
Isn't this the default action of APPS?
Yes, but that doesn't make it right.  :)

Quote
I'm thinking that anyone wanting to download or update a commonly used application would want the browser available each time they boot.
I was thinking that since it is getting "the latest version" of firefox that it would be more commonly used by people just wanting to try out the new version without committing to it as their primary browser.

Quote
am I wrong in that assumption..??
I do regularly find myself on the minority side in matters of opinion.

Quote
If I'm wrong with that assumption, then the philosophy behind Apps is also wrong..?
Yeah - just in the choice of the default value of the button.  I would have made it default to "download and load" instead of "onboot".  I didn't mean to make waves.  I'm certainly capable of editing a file like onboot.lst by hand and I regularly do so - I guess that's why  I'm touchy about things changing it as their default action.

----

Nitram said:
Quote
Just providing feedback, it's your script so you can write how you want :)

Exactly.  I thank you for the effort you have put into this.  I was just sort of hoping the majority of users felt like I do and it was only a matter of nobody bothering to mention it.

----

Coreplayer2 said:
Quote
similarly most new users are confused when recent changes to their system are not replicated on each and every reboot, clearly this is evident when they haven't grasped the application of persistence.

Yeah, I think I remember seeing that come up in the forums once or twice.   ;)

More seriously though, if they aren't going to learn about tce-load, Apps and/or persistence, I can't imagine why they're using Core in the first place.  (Every one beat me up for that - I probably deserve it.)

----

nitram said
Quote
// Thank you nitram for your interesting view...
Get that a lot :)

I usually don't ever type "LOL", but this time I really did.  I get that, too.

Title: Re: Firefox - Extension to install the latest version
Post by: coreplayer2 on October 13, 2015, 08:17:08 PM
Thanks for everyone's feedback.   I have revisited the firefox-getLatest extension and have modified it's script to address these concerns.   This took quite a while because the options provided so many conditions and of course all needed to be tested...

1. I mistakenly saw ftp. as a shortcut for the protocol in the test for latest version address, it wasn't...   so have fixed this for users of busybox wget in tc-4.x   (I tested only in TC5.x & TC6.x)
2. I have changed the install logic so that firefox.tcz is only added to the current onboot.lst if a previous version (ie: firefox-official or firefox-ESR) was already installed in that onboot.lst (supporting personal onboot.lst's)
3. If updating an older version of firefox.tcz there will be no change in onboot or ondemand status, all updates are handled via TC extension upgrade procedure occurring the next reboot.
4. If firefox.tcz in not discovered in an onboot.lst then users will be advised (reminded of this fact) before the script prompts to quit.
5. Old or depreciated Firefox extensions (ie: firefox-official.tcz firefox-ESR.tcz) will be scheduled for removal via the usual tce-audit during a subsequent reboot.
6. Any condition which require users to be advised (ie: uninstalling old Firefox versions, or advised to reboot to complete upgrade, etc. etc..)  then the script prompts the user to exit allowing time to read any notes before quitting.
 
I think we got this covered :)
Title: Re: Firefox - Extension to install the latest version
Post by: nitram on October 13, 2015, 09:51:27 PM
Thanks for your hard work coreplayer2. Received your message and will test drive later tonight. On behalf of all TC users who would prefer the OnDemand option - thank-you :)
Title: Re: Firefox - Extension to install the latest version
Post by: coreplayer2 on October 23, 2015, 03:15:24 PM
Oct 23rd 2015 Update..

I've updated the firefox-getLatest extension to help acquire latest available firefox version, to accommodate Mozilla's recently updated directory structure and web site previously used to obtain the latest release.

Also added some other minor improvements, for example a better "firefox-getLatest.sh -h" menu description of how to obtain beta versions.  Also improved connection tests, since the repo had a temporary issue this week

Attached is the updated script from the extension update submitted today


Title: Re: Firefox - Extension to install the latest version
Post by: coreplayer2 on October 31, 2015, 06:33:25 PM
OK, to avoid conflicts with future Lang variations I made a minor change to the script.  Unfortunately this didn't work out so well for our German friends

So I'll modify the extension to reflect the current language directory status for de users and others, meanwhile I've attached a temporary modified script for those requiring DE language version.

 
Title: Re: Firefox - Extension to install the latest version
Post by: Misalf on November 01, 2015, 01:16:56 AM
Sorry if I drop my two cents here without actually knowing what the problem is about LANG=de (and variants) - I'm not asking; I trust you coreplayer2. However, I'm hoping that  kmaps  will be left out of the equation? As I'm using German keyboard layout but English language (default LANG=C).
Title: Re: Firefox - Extension to install the latest version
Post by: coreplayer2 on November 01, 2015, 07:02:27 AM
Quote
I'm hoping that  kmaps will be left out of the equation?
Yes, the script uses only the $LANG variable

Title: Re: Firefox - Extension to install the latest version
Post by: coreplayer2 on November 04, 2015, 06:22:00 PM
Firefox Update v42.0

latest script (attached below) has been updated to fix the change in Mozilla's latest directory structure
extension update will be submitted tomorrow

In this grabber screenshot Firefox v42.0 in German language is being downloaded and packaged for tinycore
(https://db.tt/2kKdkvAt)

Title: Re: Firefox - Extension to install the latest version
Post by: coreplayer2 on November 15, 2015, 07:02:28 PM
Hello Firefox fans

Updated extension firefox-getLatest.tcz now posted to repo

Use the above extension to get the latest Firefox v42.0
Title: Re: Firefox - Extension to install the latest version
Post by: raj on November 20, 2015, 06:50:23 AM
Hi coreplayer2,

>> Updated extension firefox-getLatest.tcz now posted to repo
Neither firefox-getLatest.tcz nor firefox-getLatest.sh work anymore.  I managed to get it working last week but on new Tiny Core 6.4.1 is doesn't work!  I suspect Mozilla have changed their web-site location.

Thanks in advance for help.

Best regards,
raj

Title: Re: Firefox - Extension to install the latest version
Post by: coreplayer2 on November 20, 2015, 12:45:00 PM
Since Mozilla can't be consistent from one week to the next I have come up with a new plan to prevent the wget from spitting out errors but it will be next week before I can implement the change

So meanwhile Firefox-ESR is available for those who need a current Firefox browser


Sent from my iPhone using Tapatalk
Title: Re: Firefox - Extension to install the latest version
Post by: raj on November 20, 2015, 03:14:50 PM
Thank you coreplayer2,

Look forward to the new solution  :)
Title: Re: Firefox - Extension to install the latest version
Post by: coreplayer2 on November 22, 2015, 01:05:38 PM
Many minor changes this week, mostly due to Mozilla's restructuring of their servers again.   Seems to be a weekly occurrence so this time I've incorporated a fallback method to overcome these frequent directory changes.  The script will use the fallback method if the version checker fails to find the latest version.


Also restored the manual selection method to full functionality.
remember to use this feature use the "firefox-getLatest.sh -m" command.

extension submitted, but as always pm me if you would like to get the tcz asap

Maybe I can get to adding some useful features now instead of chasing my tail..
Title: Re: Firefox - Extension to install the latest version
Post by: coreplayer2 on November 22, 2015, 02:20:52 PM
I feel we're making great progress,  this update brings additional Firefox_"Private" and "Safe-mode" browsing desktop menu items

Desktop menu items
    firefox
        Firefox
        Firefox_private
        Firefox_safe-mode

(https://db.tt/iUmCifqm)

Thanks Misalf for the contribution
:)



Title: Re: Firefox - Extension to install the latest version
Post by: raj on November 23, 2015, 01:04:37 PM
Thank you coreplayer2 for swiftly updating the script. Much appreciated.
Title: Re: Firefox - Extension to install the latest version
Post by: grandadruss on November 24, 2015, 04:56:15 PM
Downloaded script above (17.13kb) - had to search and replace 34.0.5 with 42.0 to get it to work. No joy with -m 42.0
Just in case this helps someone.
All up-to-date now with extra menu items, thanks to all!  :)
Title: Firefox - Extension to install the latest version
Post by: coreplayer2 on November 24, 2015, 07:20:06 PM
you shouldn't have to change anything.  We've been testing the script for the last few days without any issue getting the correct version.   Unless there's been a change at Mozilla within the last 30mins otherwise Ivan explain what happened in your scenario
A screenshot or terminal output would really help with troubleshooting please

If manually entering the version the command is

./firefox-getLatest.sh -m

Then at the prompt type 42.0 enter

Usually this is a backup method, or installing a previous version.

Sent from my iPhone using Tapatalk
Title: Re: Firefox - Extension to install the latest version
Post by: coreplayer2 on November 24, 2015, 09:49:36 PM
During recent firefox-getLatest testing, we discovered an issue with FLWM and FLWM_Topside Window Managers.   It appears the new desktop menu feature providing Firefox "Private viewing" and "Safe-Mode" has brought to the forefront an WM incompatibility when two similar extension names are loaded via the onboot.lst, for example "firefox" and "firefox-getLatest" and at least one of the extensions has desktop sub-menu items.  We've discovered the issue is present in all versions of FLWM topside or standard from either tc-5.x or tc-6.x (x86 & x86_64).   Whereas Hackedbox is unaffected.  Openbox is not directly effected by this issue but has another problem mentioned below.
The result of this anomaly occurs when the WM loads at boot, it appears the menu building function can not differentiate between extension names with either Capital letters or Hyphens, resulting in corrupted sub menus. 

Meanwhile, an underscore is recognized by FLWM and when our firefox-getLatest extension is rebuild as firefox_getLatest the desktop menus are build uncorrupted.  So....

Because of this issue I have decided to rename firefox-getLatest.tcz to firefox_getLatest.tcz on all future update submissions to the repo.   Unfortunate as this is it's the easiest resolution to the dilemma.



Note; Openbox require the use of 2x underscores or Hyphens in a menu item name to be recognized and written as one. Not ideal but not as sever as the resulting corruption when building sub-menus in FLWM with Hyphens

Attached for your pleasure is the updated script reflecting this name change,  this will appear in the repo's soon
Title: Re: Firefox - Extension to install the latest version
Post by: coreplayer2 on December 15, 2015, 06:40:44 PM
I've been waiting almost a month for Mozilla to update Firefox again, needed to verify firefox_getLatest extension will perform as expected, I'm happy to say it does :)  Though I was hoping for a minor version update before going straight to v43.0, will try to stay ahead of that..


Run firefox_getLatest from the desktop menu (note: Sorry, had to change the extension name again, a result of an issue with flwm.
So make sure you've downloaded the latest version from the repo).

Anyhow,  Firefox version 43.0 is out and is available for x86, x86_64 in all supported languages as required
(https://db.tt/ALkVH8vp)
...
(https://db.tt/hT1qc060)


Anyone needing a different/specific version can always use firefox_getLatest.sh -m from the terminal to fetch their desired version,
see here for more:  firefox_getLatest.sh -h
(https://db.tt/UHQ1elAP)


If interested, this is the current mechanism for detecting Firefox  current/latest version, which appears to be working quite well.
Code: [Select]
addressX='https://download.mozilla.org/?product=firefox-latest&os=linux&lang=en-US'
curl -s $addressX 2>/dev/null | grep -o '[[:digit:]]*\.[[:digit:]]' 2>/dev/null | sort -u | tail -1 >/tmp/ffversion
curl -s $addressX 2>/dev/null | grep -o '[[:digit:]]*\.[[:digit:]]*\.[[:digit:]]' 2>/dev/null | sort -u | tail -1 >>/tmp/ffversion
VER=$(cat /tmp/ffversion | sort -u | tail -1)



Latest script is attached in case of difficulty getting the correct extension
Title: Re: Firefox - Extension to install the latest version
Post by: Misalf on December 17, 2015, 01:58:56 PM
Seems Firefox version 43 crashes on YouTube.com when playing a video and  ffmpeg.tcz  is not loaded.
Also, if  ffmpeg.tcz  is loaded, Firefox falls back to Flash even though I set YT to use HTML5.
Title: Re: Firefox - Extension to install the latest version
Post by: Misalf on December 17, 2015, 03:13:25 PM
Hmm, no. Settings that were suggested in order to enable HTML5 video actually prevented Firefox from working correctly.
So at  about:config  I set these settings back to default:
media.fragmented-mp4.*
media.mediasource.*
That fixed the crash and HTML5 video works again.
Title: Re: Firefox - Extension to install the latest version
Post by: coreplayer2 on December 18, 2015, 09:27:20 PM
Interesting....   so all is well on the Firefox HTML5 and YouTube front  :)
I wish I could say the same for the new signing of add-on's in v43+, but add-ons will catch up eventually..

Meanwhile I didn't have to wait long to test minor updates with the latest script because Firefox v43.0.1 is out and the mechanism works well

No one should experience any difficulties getting the very latest firefox,  enjoy

Title: Re: Firefox - Extension to install the latest version
Post by: coreplayer2 on January 09, 2016, 05:42:06 PM
Attached "firefox_getLatest.sh" script has been updated to v2.1

with improvements to
I)  detection of older squashfs-tools for compatibility with tc-4.x & tc-5  (x86 versions)
2) detection of architecture

Has been tested on tc-5, tc-6, tc-7 with all possible architectures

Will submit the updated extension asap
thanks for your patience
Title: Re: Firefox - Extension to install the latest version
Post by: tp4web on March 18, 2016, 09:09:41 AM
Hi, when I try the firefox_getLatest.sh from repository, it does download Firefox 45, seems to install fine and also creates a icon on wbar, but will not launch Firefox. It seems to create all files.

I tried it on VMWare and from SD card (installed using TinyCore but using corepure64.gz and vmlinuz64.gz). I can run Firefox ESR fine but not the latest 45. Using flwm or fluxbox has no impact.

Manually trying to execute using PCManFM shows error message [Failed to execute child process "/tmp/tcloop/firefox/usr/local/firefox/firefox" (No such file or directory)]
Title: Re: Firefox - Extension to install the latest version
Post by: gerald_clark on March 18, 2016, 09:26:54 AM
It sounds like you have not loaded firefox.tcz.
Title: Re: Firefox - Extension to install the latest version
Post by: coreplayer2 on March 18, 2016, 10:39:57 AM
Exactly, firefox has most likely not been installed correctly. 
Also remember that you can not have both firefoxESR and firefox installed at the same time.  firefox_getLatest will attempt to remove old versions if installed, however if you've manually downloaded firefoxESR afterwards then there may be a conflict.

firefox_getLatest is setup to be almost fool proof, but as always you can interfere with the install process if you're not that familiar with how TC installs applications.  firefox_getLatest iirc will not install firefox.tcz to the onboot list unless an older variant was previously installed there.

As Gerald suggested firefox hasn't been allowed to install correctly along with it's deps.  So to fix that please use "Apps" to remove any previously installed firefoxESR editions, then proceed to install firefox.tcz correctly to your "onboot.lst"   Or manually install for this session.   Either way, attempting to launch firefox without the correct path will most likely fail, as you've experienced using the file manager probably will not work as desired.

If you prefer to use the commandline, then use

tce-load -i firefox

remember to add firefox.tcz to your onboot.lst using Apps if you choose to have firefox loaded after each bootup.

good luck
Title: Re: Firefox - Extension to install the latest version
Post by: tp4web on March 18, 2016, 12:33:44 PM
Sorry, I did not make it clear. This is on TinyCorePure64-7.0. Right after booting from ISO, I goto Apps -> Select fastest Mirror -> search for firefox. I select firefox_getLatest.tcz. I select  "Download + Load" option and click Go. TCE: path shows as /tmp/tce/optional. After it says OK, I open terminal and type firefox_getLatest.sh. The output of this is what I attached in my previous post.

I am not adding firefox.tcz to OnBoot.lst as I guess should not matter as I am using this machine for just one boot cycle. In the sense, boot and load TinyCore from any computer, go to website, do something, shutdown computer.

I just repeated the same steps now, and I get this new message (I sweat I had not seen that before):
grep: /etc/sysconfig/tcedir/onboot.lst: No such file or directory

Doing: tce-load -i firefox shows firefox is already installed!
Title: Re: Firefox - Extension to install the latest version
Post by: gerald_clark on March 18, 2016, 02:26:27 PM
The ISO is not writable.  Use a standard disk based installation.
Title: Re: Firefox - Extension to install the latest version
Post by: coreplayer2 on March 18, 2016, 04:35:22 PM
so..

I found that in this scenario booting to a tinycore64.iso (burned to a cd) the symlink required by Firefox is not being created.    though it works fine if installed to a USB drive (last time i checked).
 at the terminal, type
Code: [Select]
ln -s /lib /lib64then launch firefox


normally you would launch firefox_getLatest from the desktop menu, then after installing the latest (now 45.0.1) launch firefox from the wbar icon


I'm typing this from tinycore64 cd from where I installed firefox_getLatest, then created the symlink and launched firefox from the firefox icon
Title: Re: Firefox - Extension to install the latest version
Post by: tp4web on March 18, 2016, 04:54:46 PM
Thanks, I tried it again now using my USB drive and firefox_getLatest.sh was able to install firefox 45.0.1 and after reboot, firefox is working fine.
Title: Re: Firefox - Extension to install the latest version
Post by: coreplayer2 on March 18, 2016, 05:13:39 PM
Your welcome

It should work from a cd as I've tested the script from many scenarios.  Maybe it is related to the file system, however now that I'm looking at the startup file I see where this needs work and will fix it ASAP


Sent from my iPhone using Tapatalk
Title: Re: Firefox - Extension to install the latest version
Post by: coreplayer2 on May 28, 2016, 11:58:02 PM
Updated "firefox_getLatest.tcz" extension submitted to x86 and x86_64 repo's.

Updates dep files for for addition of GTK3 and contains "lib64" fix for corepure64.



Script v2.2 is attached for your perusal or if preferred to update firefox.tcz (rather than wait for extension submission process)
Title: Re: Firefox - Extension to install the latest version
Post by: coreplayer2 on August 03, 2017, 03:57:36 PM
Updated "firefox_getLatest" extension submitted to x86 and x86_64 repo's

To comply with latest busybox changes.


In case anyone has difficulty with the current extension no longer completing the connection check, an updated script has been attached to this post
Title: Re: Firefox - Extension to install the latest version
Post by: coreplayer2 on December 18, 2018, 09:07:24 AM
Updated "firefox_getLatest.tcz" extension posted to x86 and x86_64 repo's.

Updates include addition of run time dependencies (one is critical for firefox v64.0)

gcc_libs.tcz
gdk-pixbuf2.tcz
 

Title: Re: Firefox - Extension to install the latest version
Post by: xor on August 22, 2019, 09:33:09 PM
Updated "firefox_getLatest.tcz" extension posted to x86 and x86_64 repo's.

Updates include addition of run time dependencies (one is critical for firefox v64.0)

gcc_libs.tcz
gdk-pixbuf2.tcz

can you add the current code to the forum!?

Code: [Select]
#!/bin/sh
#author coreplayer2
# version 2.4
#Aug 03 2017

###################################
# firefox_getLatest is a script to
# download and install the latest
# version of Firefox with locale
# support
# May be run with options, eg:
# firefox_getLatest.sh -h
# firefox_getLatest.sh -m
###################################


. /etc/init.d/tc-functions
useBusybox

trap 'f_cleanup ; trap 2 ; kill -2 $$' 1 2 3 13 15

if [ "$USER" = root ] ; then
   echo "Don't run as root please, exiting."
   sleep 2
   exit 1
fi

OIFS=$IFS
IFS=' '

##******************************************************************************************************************
##***************************************************Functions******************************************************

##draw at full screen width a line in blue ( use xy=(line#) for row position )
f_line() {
wide=$(stty size | cut -d" " -f2)
printf "\033["$xy";0H${BLUE}"
printf '%*s\n' "$(( wide-1 ))" '' | tr ' ' =
printf "${NORMAL}"
}

f_cleanup (){
find /tmp/firefox* -type d -exec sudo chown tc:staff {} +
find /tmp/firefox* -type f -exec sudo chown tc:staff {} +

clean1ist="/tmp/firefox.* /tmp/ff*"
for clean in ${clean1ist}; do
   rm -fr $clean
done

if [ -f ${tczStore}/test_file ]; then
  rm -f ${tczStore}/test_file
fi

IFS=$OIFS
}

f_location (){
getMirror
echo " ${MAGENTA}Repo ${WHITE}in use: ${CYAN}$MIRROR${NORMAL} "
echo " ${MAGENTA}TCE ${WHITE}directory in use: ${CYAN}${tczStore}${NORMAL} "
}

f_connchk (){
echo " ${MAGENTA}Verifying connection to server, please wait...${NORMAL}"
wget --spider -q -T 20 ${address}
case $? in
0)
   echo " ${GREEN}connection ok${NORMAL}"
;;
1)
   echo " ${MAGENTA}Using alternative web address...${NORMAL}"
   wget --spider -q -T 20 ${address2}
   case $? in
     0)
echo " ${GREEN}connection ok${NORMAL}"
     ;;
     1)
echo " ${YELLOW}${message}${NORMAL}"
sleep 5
exit
     ;;
   esac
;;
esac
}

f_freespace (){
free=$(df -m /dev/$tcz_partition | grep dev | awk '{ printf "%d\n",$4 }')
if [ ! -z $free ]; then
    if [ $free -lt $required ]; then
echo -e " ${YELLOW}Caution, ${WHITE}$tcz_partition ${YELLOW}has less than ${WHITE}${required} MB ${YELLOW}free space remaining ${NORMAL}"
xy=4
f_line
echo -e " Please free up space to continue\n exiting... "
sleep 10
exit 2
    fi
    if [ $free -gt 200 ]; then
echo -e " ${MAGENTA}$tcz_partition ${WHITE}has: ${CYAN}${free} MB ${WHITE}free space remaining${NORMAL} "
xy=4
f_line
    fi
fi
if [ -z $free ]; then
echo -e " ${YELLOW}Caution, unable to determine free space remaining ${NORMAL}"
sleep 4
fi
}


##******************************************************************************************************************
##*****************************************************Main*********************************************************

unset l
unset free
unset ans
unset VER
unset VX
unset ffdownload
unset installdir
unset rebootToInstall

required=100
ff=firefox
tce_dir=/etc/sysconfig/tcedir
op=${tce_dir}/optional
tczStore=$(readlink -f $op)
part1=${tczStore#/mnt/}
tcz_partition=${part1%%/*}
tczup=${tczStore}/upgrade
ffBuild=firefox.${RANDOM}$RANDOM
ffBuildPath=/tmp/$ffBuild
ffdirpath=${ffBuildPath}/firefox/usr/local
addressX='https://download.mozilla.org/?product=firefox-latest'
addressY="https://dl.dropboxusercontent.com/u/35323031/TC_FIREFOX_VERSION/ffAltVersion"
ffdownload="http://download.cdn.mozilla.net/pub/mozilla.org/firefox/releases/34.0.5/linux-i686/en-US/firefox-34.0.5.tar.bz2"
message1="check internet connection, then try again"
message2="verify connection, perhaps a typo? then try again"
lib=0
xy=0


#Options
while getopts amh option
do
case "$option" in
a ) mode=1 ; break;;
m ) mode=2 ; break;;
h ) help=1 ; break;;
esac
done
unset option


clear
f_location
[ -z "$tcz_partition" ] || f_freespace
xy=4
f_line


##Help
if [ "x$help" == x1 ]; then
  clear
  cat <<-helpinfo
================================================================
 Default:       firefox_getLatest.sh -a  (auto detect mode)

================================================================
 Manual:        firefox_getLatest.sh -m  (manually enter version)
                 
                Specify exact firefox version to install
                perhaps the latest or an earlier version
                eg: 38.0 || 39.0.3 || 40.0 || 40.0.2
                or 52.1.2esr (for ESR version)
                or 42.0b9 (sample for a beta version)

 note: you can find available valid versions from
 http://download.cdn.mozilla.net/pub/mozilla.org/firefox/releases/
================================================================
 help:          firefox_getLatest.sh -h  (this help menu)

================================================================
helpinfo
exit 3
fi

f_cleanup >/dev/null 2>&1
IFS=' '
##test for writable tce dir
if [ ! -f "${tczStore}/test_file" ]; then
  touch ${tczStore}/test_file
  if [ "x$?" != x0 ]; then
      echo "${RED} tce directory not writable${NORMAL} "
      f_cleanup >/dev/null 2>&1
      exit 4
  fi
fi


echo -e "\n ${BLUE}Fetching dependencies${NORMAL}.. "
unset address
unset message
address="http://tinycorelinux.net/index.html"
address2="http://forum.tinycorelinux.net/index.php"
message=$message1
f_connchk

#load dependencies
#check for old versions of squashfs-tools
toolsOld=squashfs-tools-4.x
toolsNew=squashfs-tools
tcVer=$(version)
tcMajorVer=${tcVer%%.*}
case $tcMajorVer in
  [45]) [ -f /lib/ld-linux-x86-64.so.2 ] && sqfsTools=$toolsNew || sqfsTools=$toolsOld ;;
     *) sqfsTools=$toolsNew ;;
esac

deps1="$sqfsTools \
curl \
wget \
bzip2 \
file \
gtk3 \
libasound \
dbus-glib \
hicolor-icon-theme \
cairo \
gamin \
libGLESv2 \
ca-certificates"

for Z in $deps1
do
tce-load -w $Z 1>/dev/null
tce-load -i $Z 1>/dev/null
  if [ ! -e /usr/local/tce.installed/$Z ]; then
      echo "${RED}  Dependency install failed${NORMAL} "
      f_cleanup >/dev/null 2>&1
      exit 5
  fi
done


#check for cirtificates install
[ -e /etc/ssl ] || sudo ln -s /usr/local/etc/ssl /etc/ssl


##discover firefox arch
ARCH=$(uname -m)
case $ARCH in
  x86_64) [ -f /lib/ld-linux-x86-64.so.2 ] && ffdownload=${ffdownload/linux-i686/linux-x86_64}; lib=x86_64 ;;
esac


#LANG=ew_ES.ISO-8859-15 #uncomment for testing
##firefox multilanguage support
for l in $(echo ${LANG%.*}); do
case $l in
C) l=en-US ;; #English
en_GB*) l=en-GB ;;
en_ZA*) l=en-ZA ;;
en*) l=en-US ;;
es_ES*) l=es-ES ;; #Spanish
es_MX*) l=es-MX ;;
es_CL*) l=es-CL ;;
es_AR*) l=es-AR ;;
es*) l=es-ES ;;
fr*) l=fr ;; #French
de*) l=de ;; #German
af*) l=af ;; #Afrikaans
sq*) l=sq ;; #Albanian
ar*) l=ar ;; #Arabic
an*) l=an ;; #Aragonese
hy_AM*) l=hy-AM ;; #Armenian
ast*) l=ast ;; #Asturian
as*) l=as ;; #Assamese
az*) l=az ;; #Azerbaijani
eu*) l=eu ;; #Basque
be*) l=be ;; #Belarusian
bn_BD*) l=bn-BD ;; #Bengali (Bangladesh)
bn_IN*) l=bn-IN ;; #Bengali (India)
bs*) l=bs ;; #Bosnian
br*) l=br ;; #Breton
bg*) l=bg ;; #Bulgarian
ca*) l=ca ;; #Catalan
zh_CN*) l=zh-CN ;; #Chinese (Simplified)
zh*) l=zh-TW ;; #Chinese (Traditional)
hr*) l=hr ;; #Croatian
cs*) l=cs ;; #Czech
da*) l=da ;; #Danish
nl*) l=nl ;; #Dutch
et*) l=et ;; #Estonian
fi*) l=fi ;; #Finnish
fy*) l=fy-NL ;; #Frisian
ff*) l=ff ;; #Fulah
gd*) l=gd ;; #Gaelic (Scotland)
gl*) l=gl ;; #Galician
el*) l=el ;; #Greek
gu*) l=gu-IN ;; #Gujarati (India)
he*) l=he ;; #Hebrew
hi_IN*) l=hi-IN ;; #Hindi (India)
hu*) l=hu ;; #Hungarian
is*) l=is ;; #Icelandic
id*) l=id ;; #Indonesian
ga_IE*) l=ga-IE ;; #Irish
it*) l=it ;; #Italian
ja*) l=ja ;; #Japanese
kn*) l=kn ;; #Kannada
kk*) l=kk ;; #Kazakh
km*) l=km ;; #Khmer
ko*) l=ko ;; #Korean
lv*) l=lv ;; #Latvian
lt*) l=lt ;; #Lithuanian
mk*) l=mk ;; #Macedonian
ms*) l=ms ;; #Malay
ml*) l=ml ;; #Malayalam
mr*) l=mr ;; #Marathi
nb_NO*) l=nb-NO ;; #Norwegian (Bokmal)
nn_NO*) l=nn-NO ;; #Norwegian (Nynorsk)
or*) l=or ;; #Oriya
fa*) l=fa ;; #Persian
pl*) l=pl ;; #Polish
pt_BR*) l=pt-BR ;; #Portuguese (Brazilian)
pt_PT*) l=pt-PT ;; #Portuguese (Portugal)
ro*) l=ro ;; #Romanian
ru*) l=ru ;; #Russian
sr*) l=sr ;; #Serbian
si*) l=si ;; #Sinhala
sk*) l=sk ;; #Slovak
sl*) l=sl ;; #Slovenian
sv_SE*) l=sv-SE ;; #Swedish
ta*) l=ta ;; #Tamil
te*) l=te ;; #Telugu
th*) l=th ;; #Thai
tr*) l=tr ;; #Turkish
uk*) l=uk ;; #Ukrainian
hsb*) l=hsb ;; #Upper Sorbian
uz*) l=uz ;; #Uzbek
vi*) l=vi ;; #Vietnamese
cy*) l=cy ;; #Welsh
xh*) l=xh ;; #Xhosa
*) l=en-US ; echo -e "\n ${YELLOW}Error. Check locale bootcode, \
using defualt${NORMAL}.\n " ;; #fallback defualt
esac
done
ffdownload=${ffdownload/en-US/$l}


##**********************************************download selection**************************************************

case ${mode:=1} in
1 )
#auto discover version
echo -e "\n ${BLUE}Acquiring latest version${NORMAL}.. "
cd /tmp

curl -s $addressX 2>/dev/null | grep -o '[[:digit:]]*\.[[:digit:]]' 2>/dev/null | sort -u | tail -1 >/tmp/ffversion
curl -s $addressX 2>/dev/null | grep -o '[[:digit:]]*\.[[:digit:]]*\.[[:digit:]]' 2>/dev/null | sort -u | tail -1 >>/tmp/ffversion
VER=$(cat /tmp/ffversion | sort -u | tail -1)

if [ -n "$VER" ]; then
  echo -e "\n ${GREEN}The Latest version ${WHITE}is ${CYAN}${VER}${NORMAL} \n "
echo -e " ${BLUE}Downloading Firefox${NORMAL}.. \n "
  /usr/local/bin/wget -c -t 20 ${ffdownload//34.0.5/$VER} -O /tmp/firefox.tar.bz2
else
echo -e "${YELLOW} Version not found, \n ${BLUE}attempting alternate method${NORMAL}.."
f_cleanup >/dev/null 2>&1
wget $addressY >/dev/null 2>&1
VER=$(cat /tmp/ffAltVersion)
if [ -n "$VER" ]; then
  echo -e "\n ${GREEN}The Latest version ${WHITE}is ${CYAN}${VER}${NORMAL} \n "
  echo -e " ${BLUE}Downloading Firefox${NORMAL}.. \n "
  /usr/local/bin/wget -c -t 20 ${ffdownload//34.0.5/$VER} -O /tmp/firefox.tar.bz2
fi
fi
if [ ! -n "$VER" ]; then
  echo -e "\n ${YELLOW}Error acquiring latest version${NORMAL},\n \
suggest using the manual option \n \
see \"firefox_getLatest.sh -h\" for more "
read -p " Press Enter to exit"
exit 6
fi
;;

2 )
#specify version
echo -e "\n Enter exact version requested. \n For example to download \
version 34.0.5 simply type \n\n  ${WHITE}34.0.5${NORMAL} \n"
echo -n " at the prompt, then select enter: "

read -t 300 VER

unset address
unset message
address=${ffdownload//34.0.5/$VER}
address2=${ffdownload//34.0.5/$VER}
message=$message2
f_connchk

/usr/local/bin/wget -c -t 20 ${ffdownload//34.0.5/$VER} -O /tmp/firefox.tar.bz2
;;

3 )
#modify download link (This feature to be completed soon)
if [ ! -f "/tmp/ffdownload_link.txt" ]; then
echo "$ffdownload" > /tmp/ffdownload_link.txt
echo -e " The download link has been saved in /tmp/ffdownload_link.txt
 until next reboot.  please edit the download path specifying
 version directoy, filename and language as desired.
 save the file and restart this update script selecting option ${WHITE}(${MAGENTA}3${WHITE})${NORMAL}
 again to use the modified address\n\n "
sleep 30
exit 7
fi

ffpath=$(cat /tmp/ffdownload_link.txt)

if [ -f "/tmp/ffdownload_link.txt" ]; then

unset address
unset message
address=${ffpath}
address2=${ffpath}
message=$message2
f_connchk

/usr/local/bin/wget -c -t 20 ${ffpath} -O /tmp/firefox.tar.bz2
else
echo " ${YELLOW} No path file found, please try again${NORMAL}"
f_cleanup >/dev/null 2>&1
sleep 5
exit 8
fi
;;

* )
 echo -e "\n\n${YELLOW}Error key not supported\n\n${NORMAL}"
;;

esac

#End of Version selection
##******************************************************************************************************************
#Creat new extension

if [ ! -d "$ffBuildPath" ]; then
dirlist="tce.installed \
share/applications \
share/doc/${ff} \
share/pixmaps "

for d in $dirlist
do
  [ ! -f ${ffdirpath}/$d ] && mkdir -p ${ffdirpath}/$d
done
fi

if [ -f "${tczStore}/firefox.tcz" ] ; then
installdir="$tczup"
else
installdir="$tczStore"
fi

##Make support files
echo "gtk3.tcz
libasound.tcz
dbus-glib.tcz
hicolor-icon-theme.tcz
cairo.tcz
gamin.tcz
libGLESv2.tcz
" > "${ffBuildPath}/${ff}.tcz.dep"

cat > ${ffdirpath}/share/applications/${ff}.desktop << "EOF1"
[Desktop Entry]
Name=firefox
Exec=firefox
Terminal=False
Comment=Firefox Web Browser
StartupNotify=True
Type=Application
Categories=Application;Network;
Icon=firefox.png
X-FullPathIcon=/usr/local/share/pixmaps/firefox.png

EOF1

cat > ${ffdirpath}/share/applications/${ff}~1.desktop << "EOF8"
[Desktop Entry]
Name=firefox_private
GenericName=Web Browser
Exec=firefox -private-window
Terminal=False
Comment=Firefox Web Browser
StartupNotify=True
Type=Application
Categories=Application;Network;
Icon=firefox.png
X-FullPathIcon=/usr/local/share/pixmaps/firefox.png

EOF8

cat > ${ffdirpath}/share/applications/${ff}~2.desktop << "EOF9"
[Desktop Entry]
Name=firefox_safe-mode
GenericName=Web Browser
Exec=firefox -safe-mode
Terminal=False
Comment=Firefox Web Browser
StartupNotify=True
Type=Application
Categories=Application;Network;
Icon=firefox.png
X-FullPathIcon=/usr/local/share/pixmaps/firefox.png

EOF9

if [ x"$lib" != xx86_64 ]; then
cat > ${ffdirpath}/tce.installed/${ff} << "EOF2"
#!/bin/sh
[ -d /var/lib/dbus ] || mkdir -p /var/lib/dbus
[ -f /var/lib/dbus/machine-id ] || dbus-uuidgen --ensure=/var/lib/dbus/machine-id

if [ -f /usr/local/bin/firefox ] ; then 
rm -rf /usr/local/bin/firefox
ln -s /usr/local/firefox/firefox /usr/local/bin/firefox
else
ln -s /usr/local/firefox/firefox /usr/local/bin/firefox
fi

EOF2

elif [ x"$lib" == xx86_64 ]; then
cat > ${ffdirpath}/tce.installed/firefox << "EOF3"
#!/bin/sh

# ln to binary on PATH
if [ ! -h /usr/local/bin/firefox ]; then
ln -s /usr/local/firefox/firefox /usr/local/bin/firefox
fi

# ln lib64 to lib
if [ ! -e /lib64 ]; then
ln -s /lib /lib64
fi

EOF3
fi


licensefile="${ffdirpath}/share/doc/${ff}/COPYING"
while [ ! -f "$licensefile" ]; do
cat > $licensefile << "EOF5"
License information may be obtained from
about:license

EOF5
done


cd /tmp
#updating build dir with archive contents

if [ -f /tmp/firefox.tar.bz2 ] ; then
echo -e "\n ${BLUE}Unpacking Archive${NORMAL}.. "
{
tar jxvf firefox.tar.bz2 -C $ffdirpath 1>/dev/null
  if [ "x$?" != x0 ]; then
      echo "${RED} Corrupt archive, please re-start operation ${NORMAL} "
      f_cleanup >/dev/null 2>&1
      sleep 5
      exit 9
  fi
} &
rotdash $!
fi

if [ ! -f ${ffdirpath}/share/pixmaps/firefox.png ]; then
cp ${ffdirpath}/${ff}/browser/chrome/icons/default/default48.png ${ffdirpath}/share/pixmaps/${ff}.png
fi


#set permissions
if [ "$PWD" != "$ffBuildPath/${ff}" ]; then
  cd $ffBuildPath/${ff}
fi

find . -type d -exec sudo chown root:root {} +
find . -type d -exec sudo chmod 755 {} +
find . -type f -exec sudo chown root:root {} +
cd ..
find $ffdirpath -iname tce.installed -exec sudo chown root:staff {} +
find $ffdirpath -iname tce.installed -exec sudo chmod 775 {} +
find ${ffdirpath}/tce.installed -type f -exec sudo chown tc:staff {} +
find ${ffdirpath}/tce.installed -type f -exec sudo chmod 755 {} +


echo -e "\n ${BLUE}Creating extension${NORMAL}.. "
mksquashfs ${ff}/ ${ff}.tcz 1>/dev/null
md5sum ${ff}.tcz > ${ff}.tcz.md5.txt

if [ ! -d ${tczup} ]; then
  mkdir -p ${tczup}
fi

if [ -f "${tczup}/${ff}.tcz" ]; then
  rm -f ${tczup}/${ff}.tcz
fi

echo -e "\n ${BLUE}Installing firefox${NORMAL}.. "
sleep 1
copylist="firefox.tcz \
firefox.tcz.md5.txt \
firefox.tcz.dep "

for c in $copylist
do
  [ -f ${ffBuildPath}/$c ] && cp ${ffBuildPath}/$c ${installdir}/$c
done


cd "$tce_dir"
bootlist=$(getbootparam lst)
[ -n "$bootlist" ] || bootlist="onboot.lst"

#load latest firefox if no other firefox is already loaded
if [ x"$installdir" = x"$tczStore" ]; then
  if [ ! -f /usr/local/tce.installed/firefox ]; then
    if [ ! -f /usr/local/tce.installed/firefox-ESR ]; then
      if [ ! -f /usr/local/tce.installed/firefox-official ]; then
        tce-load -i -s ${tczStore}/firefox.tcz
        [ ! -f /usr/local/tce.installed/firefox ] || \
echo -e "\n ${BLUE}Firefox has been installed${NORMAL}.. "
        rebootToInstall=0
      fi
    fi
  fi
elif [ x"$installdir" = x"$tczup" ]; then
  echo -e "\n ${BLUE}Firefox has been scheduled to update an \n \
existing install on next reboot${NORMAL}.. \n"
  rebootToInstall=1
fi

#if firefox*(anyVersion) not in onboot.lst then speak out!
if [ x0 = x$(grep -c firefox-ESR.tcz ${tce_dir}/$bootlist) ]; then
  if [ x0 = x$(grep -c firefox-official.tcz ${tce_dir}/$bootlist) ]; then
    if [ x0 = x$(grep -c firefox.tcz ${tce_dir}/$bootlist) ]; then
      echo -e " ${MAGENTA}Note: ${CYAN}If you want firefox to load on each reboot, \n \
      remember to add "firefox.tcz" to your onboot.lst ${NORMAL}.. "
      rebootToInstall=2
    fi
  fi
fi

#if firefox*(oldVersion) is installed in onboot.lst then add new version to list
if [ x1 = x$(grep -c firefox-ESR.tcz ${tce_dir}/$bootlist) ] || \
[ x1 = x$(grep -c firefox-official.tcz ${tce_dir}/$bootlist) ]; then
  echo "firefox.tcz" >> ${tce_dir}/$bootlist
  rebootToInstall=1
fi

#uninstall old firefox extensions
if [ -f "${tczStore}/firefox-official.tcz" ]; then
tce-audit builddb >/dev/null 2>&1
echo -e "\n Preparing to uninstall depreciated firefox-official.tcz "
tce-audit delete /etc/sysconfig/tcedir/optional/firefox-official.tcz
rebootToInstall=1
fi
if [ -f "${tczStore}/firefox-ESR.tcz" ]; then
tce-audit builddb >/dev/null 2>&1
echo -e "\n Preparing to uninstall firefox-ESR.tcz "
tce-audit delete /etc/sysconfig/tcedir/optional/firefox-ESR.tcz
rebootToInstall=1
fi

[ ! -f "${tczup}/firefox.tcz" ] || rebootToInstall=1

f_cleanup >/dev/null 2>&1

IFS=$OIFS

case $rebootToInstall in
  0 )
     exit 0
  ;;
  1 )
     echo -e "\n${GREEN} Please reboot to complete install${NORMAL}\n"
     read -p " Press Enter to exit"
     exit 10
  ;;
  2 )
     read -p " Press Enter to exit"
     exit 0
  ;;
esac


##*******************************************************End********************************************************
##******************************************************************************************************************
Title: Re: Firefox - Extension to install the latest version
Post by: neonix on June 10, 2023, 06:25:31 AM
firefox_getLatest.tcz should have "browser" in key section. When I want to check how many web browsers TC have in appbrowser, theres no firefox. Some new users may not know that firefox is possible with this extension.
Title: Re: Firefox - Extension to install the latest version
Post by: CNK on June 10, 2023, 03:55:39 PM
firefox_getLatest.tcz should have "browser" in key section. When I want to check how many web browsers TC have in appbrowser, theres no firefox. Some new users may not know that firefox is possible with this extension.

Sounds like a good idea.

Perhaps one of the TC extension repo admins would like to change tags "firefox get latest" to "firefox get latest web browser" in firefox_getLatest.tcz.info for x86 and x86_64?
Title: Re: Firefox - Extension to install the latest version
Post by: CNK on July 13, 2023, 04:02:28 PM
For the record, in the latest update to Firefox_getLatest.tcz I added "browser" to the tags as requested.

Inspired by this thread (http://forum.tinycorelinux.net/index.php/topic,26283.0.html) (as apparantly nobody else was), I added support in the firefox_getLatest.sh (http://tinycorelinux.net/14.x/x86_64/tcz/src/firefox_getLatest/firefox_getLatest.sh) script for verifying the OpenPGP signature of the Firefox download to make sure that it was the file released by Mozilla and not one substituted by someone who has hacked into a CDN server or the internet connection.

To do this, you first have to manually save the latest key published on the Mozilla Blog (https://blog.mozilla.org/security/) to "/tmp/mozkey", then run:
Code: [Select]
gpg --no-default-keyring --keyring ~/DOTgnupg/trustedkeys.kbx --import /tmp/mozkey
(replace "DOT" with a ".", the forum gave me server errors)

The "gpg" command is in the gnupg.tcz extension on x86_64. Just to confuse things, on x86 it's installed by gnupg.tcz as "gpg2", so use that instead of "gpg".

Now the "-g" option to firefox_getLatest.sh should check the signature and show an error if it doesn't match the downloaded file before it's installed.

The key is changed every two years, after which you have to add the new one.
Title: Re: Firefox - Extension to install the latest version
Post by: xor on November 17, 2023, 11:13:28 PM
Quote
Manual:        firefox_getLatest.sh -m  (manually enter version)

Quote
tr*) l=tr ;;      #Turkish

You still haven't answered how to install this!?

how to do it!?

Title: Re: Firefox - Extension to install the latest version
Post by: xor on November 17, 2023, 11:49:54 PM
Where are the update notes!?

Quote
#!/bin/sh
#author coreplayer2
#Minor changes by CNK
# version 2.10
#JUL 6 2023

###################################
# firefox_getLatest is a script to
# download and install the latest
# version of Firefox with locale
# support
# May be run with options, eg:
# firefox_getLatest.sh -h
# firefox_getLatest.sh -m
###################################
Title: Re: Firefox - Extension to install the latest version
Post by: CNK on November 18, 2023, 01:47:23 PM
Quote
You still haven't answered how to install this!?

I don't think I've been asked. I don't know what you're asking either - installing Firefox or installing the firefox_getLatest.sh script? But honestly I usually can't understand your posts so you might just have to find help from someone else with whatever it is. Or maybe you're not talking to me at all? Coreplayer2 is gone though.

Possibly this is what you want (to enter in a terminal):
Code: [Select]
LANG=tr firefox_getLatest.sh -m

Quote
Where are the update notes!?

That one I can answer. They're where they've always been, in the info file (http://www.tinycorelinux.net/14.x/x86/tcz/firefox_getLatest.tcz.info).

Code: [Select]
Change-log:             ---
                        2014/12/20 Original
                        2015/01/17 Updated to support cloud mode install and Firefox major update
                        2015/10/03 Support for command-line options
                        2015/10/04 Name change and permissions update
                        2015/10/11 fix for wget used in tc-4.x
                        2015/10/14 onboot improvements and some cosmetic changes
                        2015/10/31 Updated language detection
                        2015/11/16 Updated cleanup function
                        2015/11/22 firefox get version fixes
                        2015/11/22 Added additional firefox desktop menus
                        2015/11/23 Minor changes/fixes in wget arguments and menu inconsistencies
                        2015/11/24 Name change to accommodate new menu items and WM's
                        2016/01/09 Improved detection of arch. and squashfs-tools versions in tc4 & tc5
                        2016/05/28 Fixed lib64 (corepure64) and added GTK3 to dep lists
                        2017/05/19 added ca-certificates to dep list
                        2017/05/19 updated to comply with busybox changes
                        2018/12/15 updated dep lists (added gcc_libs & gdk-pixbuf2)
                        2020/11/10 Added libXt to dep list. Also options -e and -b (CNK)
                        2020/12/25 Fixed script file not owned by root in last extension (CNK)
                        2021/05/03 Improved version number extraction (CNK)
                        2022/02/08 Added libXtst to dep list. Also added -d option (CNK)
                        2022/11/17 Updated download URL. Exit if download fails (CNK)
Current:                2023/07/06 Fix deleting temp. files when not tc user. Add -g option (CNK)
Title: Re: Firefox - Extension to install the latest version
Post by: xor on November 18, 2023, 09:35:53 PM
My native language is not English and I write correspondence via Google Translate.

my local home language is "LANG=tr"

I am asking how to download the latest firefox version in my local language with which command.

The "firefox_getLatest.sh -m" command downloads only the English version.

Thank you in advance for your reply.

Quote
Title: Re: Firefox - Extension to install the latest version
Post by: CNK on November 18, 2023, 11:23:49 PM
my local home language is "LANG=tr"

I am asking how to download the latest firefox version in my local language with which command.

The "firefox_getLatest.sh -m" command downloads only the English version.

Great, then it's like I said, just put "LANG=tr" at the start of the command:
Code: [Select]
LANG=tr firefox_getLatest.sh -m
Title: Re: Firefox - Extension to install the latest version
Post by: xor on November 19, 2023, 12:16:15 AM
" LANG=tr firefox_getLatest.sh -m " ??? This situation made me feel like a fool! :(

Please improve the code to allow entering an argument like this;

" firefox_getLatest.sh -tr "
or
" firefox_getLatest.sh -tr -m "

Can you take this suggestion into consideration!?

If your native language is English, there is no situation that affects you anyway!

But this is very important for those whose native language is not English!
Title: Re: Firefox - Extension to install the latest version
Post by: CNK on November 19, 2023, 01:28:43 PM
The idea of LANG is that you have it set to your native language in your shell environment (shown with the command "printenv", I guess yours might be unset so it will say "LANG=C" which defaults to English), then it doesn't need to be said on the command line.

If you want to use one language for a particular program and another for everything else, then setting "LANG" at the start like "LANG=tr [program]" is the standard way to do it for any program on Linux. It overrides your usual LANG environment variable.

Adding extra command-line options isn't useful because the current approach is already consistent with most other software. It's not foolish, it makes it clear that you're deliberately overriding the language setting that other software on your system uses.
Title: Re: Firefox - Extension to install the latest version
Post by: patrikg on November 20, 2023, 06:30:06 AM
Have seen some programs even need to set the LC_ALL env variable to set the language.
Not only the LANG.
Because then setting the LC_ALL set's all LOCALE variables to that specific value.
So to be very sure with the locale variables... you need to set them like this....i think..

Code: [Select]
$LANG=C LC_ALL=C locale
LANG=C
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=C
Title: Re: Firefox - Extension to install the latest version
Post by: xor on November 21, 2023, 03:06:18 AM
Where do I need to add this in the process of making an iso file with ezra master!?
Title: Re: Firefox - Extension to install the latest version
Post by: Rich on November 21, 2023, 04:44:54 AM
Hi xor
Do not try to hijack this thread and make it about ezremaster.
Start a new thread for that.