Two update-BROWSER suggestions

Here is a place for your projects which are not officially supported by the Porteus Team. For example: your own kernel patched with extra features; desktops not included in the standard ISO like Gnome; base modules that are different than the standard ISO, etc...
User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Two update-BROWSER suggestions

Post#1 by Rava » 07 Mar 2020, 20:39

A suggestion to the maintainers of the update-BROWSER scripts, e.g. update-palemoon, update-firefox et cetera (including, of course, the update-BROWSER-live script, e.g. update-palemoon-live for update-palemoon. (This here is also a suggestion to improve any update-WHATEVER scripts.)

In the unlikely event that an error occurred while creating the resulting module, I suggest a new parameter besides -h for help and -d for working in $PWD instead of working in /tmp:

Code: Select all

-k  keep downloaded file, e.g. keep palemoon-VERSION.linux-x86_64.tar.xz
E.g. just now, after I ran update-palemoon -d I have these two files in $PWD:

Code: Select all

palemoon-28.8.4-x86_64-1.txz
palemoon-28.8.4-x86_64-1.xzm
I think it would make more sense to only have this instead in the end:

Code: Select all

palemoon-28.8.4-x86_64-1.xzm
and when given the -k parameter, this should be the end result:

Code: Select all

palemoon-28.8.4-x86_64-1.xzm
palemoon-28.8.4.linux-x86_64.tar.xz
(Yes, I still have the palemoon-28.8.4.linux-x86_64.tar.xz file since I copied it to another partition while the script was creating the txz and later the xzm, but probably not all users are this quick in a console doing so in the limited time span you have prior the script deleting the original downloaded file )
______________________________________

Only checked update-palemoon on the following:

Code: Select all

# update-palemoon -h
 Starting checks ... 
[OK] User is root.
[OK] Distro is Porteus
[OK] Processor is sse2 compatible
Downloading live script ...
Downloading: update-palemoon-live  DONE
 options:  -d : do operations in the present directory, instead of /tmp . 
           -h        : show this usage. 
Me thinks, it makes no sense to check something (here: user = root, distro = Porteus, CPU = sse2 compatible) and to download something when the given parameter is, like here, "-h", since the script would abort after the help is displayed anyway.

What the script should do and print back at the user should be more like this:

Code: Select all

# update-palemoon -h
 options:  -d : do operations in the present directory, instead of /tmp . 
           -h        : show this usage. 
Only when the given parameter is not "-h" and not an invalid parameter which should always trigger a script to abort with an error, only then the script should do the following

Code: Select all

Starting checks ... 
[OK] User is root.
[OK] Distro is Porteus
[OK] Processor is sse2 compatible
Downloading live script ...
Downloading: update-palemoon-live  DONE
______________________________

If the maintainer of update-palemoon and update-palmoon-live is okay with that, I could add the -k option and also alter the order to check for the "-h" parameter first and do checks and downloads after that and give you the diff (aka patch) files for update-palemoon and update-palemoon-live if you want. (Since I am still ill with a Non Corona viral pharyngitis I stay at home as much as I need to fully get completely rid of that pharyngitis, so I have more time coding for Port than I usually would have. I recently told someone who strange it is in the train people moving away from me just because I cough, and he replied with "That's a good thing! More space in the train for us!" LOL, just the kind of humour I like.)
Cheers!
Yours Rava

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3924
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

Two update-BROWSER suggestions

Post#2 by ncmprhnsbl » 07 Mar 2020, 22:32

yep, makes sense..
Rava wrote:
07 Mar 2020, 20:39
If the maintainer of update-palemoon and update-palmoon-live is okay with that, I could add the -k option and also alter the order to check for the "-h" parameter first and do checks and downloads after that and give you the diff (aka patch) files for update-palemoon and update-palemoon-live if you want.
please do :)
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Two update-BROWSER suggestions

Post#3 by Rava » 07 Mar 2020, 22:56

ncmprhnsbl wrote:
07 Mar 2020, 22:32
please do :)
Will do. Image

Since I tend to make a script as good as I can it might take a while. First I have to analyse it, add my changes and then test these.

That means in this case I also need to alter the update-palemoon script since my version cannot download the altered update-palemoon-live from any server bus has to rely on the one already in /usr/local/bin instead since that will be the most recent one.

Do you already have a variant or at least a code snippet that instead of downloading the *live script relies on a local /usr/local/bin/update-palemoon-live script ?
Since when I recall right you are not the one who can upload the *live script, but you need a recent one to at least test update-palemoon and update-palemoon-live .
Cheers!
Yours Rava

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3924
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

Two update-BROWSER suggestions

Post#4 by ncmprhnsbl » 08 Mar 2020, 02:43

Rava wrote:
07 Mar 2020, 22:56
Do you already have a variant or at least a code snippet that instead of downloading the *live script relies on a local /usr/local/bin/update-palemoon-live script ?
not really..
Rava wrote:
07 Mar 2020, 22:56
Since when I recall right you are not the one who can upload the *live script,
no, i have write access to that part of the server..
before we get too far... i have been looking at combining a lot of the update-* scripts into one with an option for each browser(which by it's nature covers the -h issue) ..
i'll see if i can get a module together, for some wider testing and discussion..
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Two update-BROWSER suggestions

Post#5 by Rava » 08 Mar 2020, 02:46

ncmprhnsbl wrote:
08 Mar 2020, 02:43
i'll see if i can get a module together, for some wider testing and discussion..
You mean a module for me, for me adding my suggestions above?
Cheers!
Yours Rava

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3924
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

Two update-BROWSER suggestions

Post#6 by ncmprhnsbl » 08 Mar 2020, 04:02

Rava wrote:
08 Mar 2020, 02:46
You mean a module for me, for me adding my suggestions above?
i mean for anyone to try and for you to add to if you want..
update-browser-20200308.xzm
usage:

Code: Select all

# update-browser -h

Download live script from server to update a web browser.
usage: /usr/bin/update-browser <option=-d,-h> <browser option=-g,-c,-f,-o,-p,-b,-n,-F,-P,-y>
 options:
  -d : use current directory for build work. 
   *note: this option is passed to the live script. 
  -g : google-chrome. 
  -c : chromium. 
  -f : firefox. 
  -o : opera. 
  -p : palemoon. 
  -b : basilisk. 
  -n : netsurf. 
  -F : Flashplayer-plugin for firefox, palemoon, basilisk. 
  -P : Pepperflash-plugin for chromium, opera. 
  -y : youtube-dl, terminal program for downloading youtube(and other) videos. 
  -h : show this usage. 
note: netsurf just downloads the netsurf bundle from the server, which was made for porteus 5rc1.. not sure it works with 4.0 or less..
Rava wrote:
07 Mar 2020, 22:56
Do you already have a variant or at least a code snippet that instead of downloading the *live script relies on a local /usr/local/bin/update-palemoon-live script ?
for this, simply comment out the network/download related lines and just have it run /usr/local/bin/$LIVESCRIPT $1 (or whatever path is convenient) .. i imagine..
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Two update-BROWSER suggestions

Post#7 by Rava » 08 Mar 2020, 19:43

My suggestion that -h should give the help info and not do any checks or downloads is already implemented into "update-browser-20200308.sh" (I locally renamed the script to have its version number be part of its name for editing convenience) - as shown in your text screenshot above, and my own test with

Code: Select all

# ./update-browser-20200308.sh -h
gives the same result.
So that part of my suggestion is no longer needed to be applied. :)
Cheers!
Yours Rava

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Two update-BROWSER suggestions

Post#8 by Rava » 11 Mar 2020, 08:45

ncmprhnsbl, I looked into the code of update-browser.
Seems we need a 2nd parameter to be given to the update-???-live script.

Why are the chrome and chromium scripts handled in a different way than all the other scripts?

Code: Select all

if [ "$LIVE" = "chrome" ] || [ "$LIVE" = "chromium" ]; then
   /usr/local/bin/$LIVESCRIPT -- $WD
else
   /usr/local/bin/$LIVESCRIPT $WD
fi
Such extra behaviour makes it harder to change code that is meant for all scripts.
Cheers!
Yours Rava

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3924
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

Two update-BROWSER suggestions

Post#9 by ncmprhnsbl » 11 Mar 2020, 12:08

because update-chrome/chromium-live are self extracting archives (makeself) that need the parameter passed to the extracted script, not the makeself archive itself, hence the -- .update-chrome/chromium-live also handle -d differently, instead of using $pwd , a choose directory function:

Code: Select all

set_pwd() {
echo $txtcyan " Please enter the path to the directory you want to use "
echo "  to do the file operations: " $rst
read WRKDIR
}
this is because pwd becomes /tmp/<blah> once the makself extracts itself, instead of the
i'm considering making that standard for all the scripts, because i think it's a better way of doing it..
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Two update-BROWSER suggestions

Post#10 by Rava » 11 Mar 2020, 12:37

ncmprhnsbl wrote:
11 Mar 2020, 12:08
instead of using $pwd , a choose directory function:

Code: Select all

set_pwd() {
echo $txtcyan " Please enter the path to the directory you want to use "
echo "  to do the file operations: " $rst
read WRKDIR
}
Does that mean the user has to give the wanted $PWD once again, even when he passed the -d parameter to update-browser?

__________________

Anyhow, I have a question about youtube-dl. Who one here knows that script the best?
Cheers!
Yours Rava

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3924
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

Two update-BROWSER suggestions

Post#11 by ncmprhnsbl » 11 Mar 2020, 22:13

Rava wrote:
11 Mar 2020, 12:37
Does that mean the user has to give the wanted $PWD once again, even when he passed the -d parameter to update-browser?
well, it means the user needs to pass -d to get the choice of whatever dir, be that pwd or any other..
Rava wrote:
11 Mar 2020, 12:37
Anyhow, I have a question about youtube-dl. Who one here knows that script the best?
you mean youtube-dl itself?
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Two update-BROWSER suggestions

Post#12 by Rava » 12 Mar 2020, 06:12

ncmprhnsbl wrote:
11 Mar 2020, 22:13
well, it means the user needs to pass -d to get the choice of whatever dir, be that pwd or any other..
So, say, the user is in /mnt/ext3/temp/, which is an ext3 filesystem, starts update-browser -d -WHATEVER-BROWSER and then even the chrome script knows that it should do the work in /mnt/ext3/temp/ ?
Even though the self extracted script ran from /tmp ?
At least the set_pwd() function is not to be found in what I renamed into update-browser-20200308.sh .
ncmprhnsbl wrote:
11 Mar 2020, 22:13
you mean youtube-dl itself?
Yes.
Cheers!
Yours Rava

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3924
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

Two update-BROWSER suggestions

Post#13 by ncmprhnsbl » 12 Mar 2020, 06:34

Rava wrote:
12 Mar 2020, 06:12
So, say, the user is in /mnt/ext3/temp/, which is an ext3 filesystem, starts update-browser -d -WHATEVER-BROWSER and then even the chrome script knows that it should do the work in /mnt/ext3/temp/ ?
Even though the self extracted script ran from /tmp ?
At least the set_pwd() function is not to be found in what I renamed into update-browser-20200308.sh .
no . for chrome/chromium, if you use -d, you will get a prompt that asks where you would like to do the work, which you then provide in /where/i/want format..
where you run it from is no longer relevant..
the set_pwd() function is in the live scripts..

youtube-dl: open a topic and ask your question, and experts will come ;)
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Two update-BROWSER suggestions

Post#14 by Rava » 12 Mar 2020, 08:05

ncmprhnsbl wrote:
12 Mar 2020, 06:34
no . for chrome/chromium, if you use -d, you will get a prompt that asks where you would like to do the work, which you then provide in /where/i/want format..
where you run it from is no longer relevant..
I presume most users would prefer to
move into /where/i/want/ prior executing the script
run the script with the -d parameter
expect the script to use /where/i/want/ as working directory.

At least that is how I like it. By doing so I would only have to move into one target directory and then can run as many update-BROWSER script instances as I want, and all would work and create stuff in my current $PWD.

Having to tell each instant which $PWD I want is tedious.

It should be possible to pass the $PWD to the live script. E.g. expand "-d" into "-d $PWD" or such.
Cheers!
Yours Rava

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Two update-BROWSER suggestions

Post#15 by Ed_P » 12 Mar 2020, 19:12

Rava wrote:
12 Mar 2020, 08:05
I presume most users would prefer to
move into /where/i/want/ prior executing the script
Not saying your approach is bad but I don't agree. I know I don't. I expect a script or app to do what it needs to do when I execute it from the menu wherever I happen to be.
Ed

Post Reply