Poll

Should the repo speed test progress indicatory be displayed as pulsating bar with text updates, or a bar indicating percentage of repo's tested (also with text updates)?

Pulsating bar, with text updates
1 (5.3%)
Percent completed, with text updates
14 (73.7%)
Scrap the idea and keep my favorite repo a secret!
4 (21.1%)

Total Members Voted: 15

Author Topic: SCRIPT: Repo speed test GUI  (Read 11598 times)

Offline pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2880
    • other projects...
Re: TESTING & POLL: Repo speed test GUI
« Reply #15 on: November 01, 2009, 10:09:14 AM »
Travis, great job, script works very well! And me too, I prefer the percentage version  ;)

wrt OpenOffice repo: please do not include or maintain it in the list. This repo is only needed to install or add another OO-language and we have GOO to do this job. Tex specifically asked to disable it after a manual install of OO, plus it might be moved to a different location in the future, etc. GOO will deal with all these things. In addition, if more than one repo is enabled both, GOO and addlocale will complain about an incorrect repo setup and will quit, meaning they can not be used when the OO-repo is enabled.

best,
-pinoc

Offline travisN000

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1758
Re: TESTING & POLL: Repo speed test GUI
« Reply #16 on: November 01, 2009, 11:53:34 AM »
Travis, great job, script works very well!


..Thank you, the complement is very much appreciated, especially from such an accomplished scripter / coder as yourself! (..most everything I know of bash scripting I have learned by reading scripts written by community members such as yourself!)

wrt OpenOffice repo: please do not include or maintain it in the list. This repo is only needed to install or add another OO-language and we have GOO to do this job. Tex specifically asked to disable it after a manual install of OO, plus it might be moved to a different location in the future, etc. GOO will deal with all these things.


That was my understanding, but I figured you would find your way here eventually and verify!  ;) ;D

In addition, if more than one repo is enabled both, GOO and addlocale will complain about an incorrect repo setup and will quit, meaning they can not be used when the OO-repo is enabled.

best,
-pinoc


Perhaps when I get this thing packaged up and to the repo it can be utilized by GOO / addlocale to fix such problematic configurations ??

Now that I have the most challenging part of the synaptic-repair script re-written to use the zenity GUI, I am trying to decide if I should do the same with synaptic-repair..  the one disadvantage I see to doing this, is that sometimes with a borked install the repair needs to be done from a console boot. 

I'm sure with a little time and effort I could create a set of functions similar to the yorn function (..yes or no) that I borrowed from mkrepo for the non-gui synaptic-repair script, that would also emulate various other zenity dialogs.  Then it would just be a matter of detecting if the user was in a console or X session (..or maybe zenity is smart enough to handle this; I haven't tried it).

And me too, I prefer the percentage version  ;)


..getting the percentage to work properly with zenity has always been a challenge (mostly because zenity eats any variable set while the progress meter is running).  In working on this script I learned a few things that are not well documented in most of the zenity resources that I have seen.  I think I may try and document this more in my thread on GUI dialogs for bash / shell scripting, so I (and others) can refer to it in the future.



Offline pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2880
    • other projects...
Re: TESTING & POLL: Repo speed test GUI
« Reply #17 on: November 01, 2009, 01:05:24 PM »
Quote
..Thank you, the complement is very much appreciated, especially from such an accomplished scripter / coder as yourself! (..most everything I know of bash scripting I have learned by reading scripts written by community members such as yourself!)
accomplished scripter...  :D :D :D  this is really funny! In fact I am a software developer but for more than 12 years I only code in IDL for anything and everything (see 'other projects' in my footer). Believe it or not but I have no clue about any other programming language. 6 years ago I wrote a 3-line bash script and then last year I started with addlocale, bash from scratch (and still now the major work-load of addlocale is an IDL-script which processes the language archives addlocale downloads). So, 95% of the addlocale bash code is copy/paste from stuff found in Google, and the remaining 5% from other scripts of our repo. I even had to look-up how to write an if-condition using bash... ;D Learning by searching Google and then try & error or success. Much of the code is 'sledgehammer programing', very cumbersome but as long as it works  ::) 
   
Quote
Perhaps when I get this thing packaged up and to the repo it can be utilized by GOO / addlocale to fix such problematic configurations ??
GOO is set to not continue when the OO-repo is already active because that is the task of GOO. The rule is to have only one repo active and the OO-repo should be disabled. GOO will tell you this and I opted to not remove/modify any user-specified repo settings, instead the user should just follow the rule to have only one repo (which is not the OO-repo of course) activated.

And, yes, the timeout in the download speed test is very useful and I want to include this in the next version of GOO/AL, so thank you for that! All this is a great example of community work, we learn from each other for the benefit of all, and it's fun too!

best,
-pinoc

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15829
  • LXDE! Coffee, Bacon and Cheesecake!
Re: TESTING & POLL: Repo speed test GUI
« Reply #18 on: November 01, 2009, 01:53:32 PM »
% complete :D


DuhClown

  • Guest
Re: TESTING & POLL: Repo speed test GUI
« Reply #19 on: November 01, 2009, 05:20:18 PM »
Too cool tool.

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6849
  • MLU
Re: TESTING & POLL: Repo speed test GUI
« Reply #20 on: November 01, 2009, 06:51:44 PM »
Quote
..getting the percentage to work properly with zenity has always been a challenge (mostly because zenity eats any variable set while the progress meter is running).  In working on this script I learned a few things that are not well documented in most of the zenity resources that I have seen.  I think I may try and document this more in my thread on GUI dialogs for bash / shell scripting, so I (and others) can refer to it in the future.

Yes please do.
It was one of the most annoying features - or alleged features - of Zenity when I tried it some time ago.
I gave up and used the pulsating bar.

Is it possible to run the script without having the sources list written?
I do not really want to overwrite it and have to copy it back .... also it might be useful just as a test in the event of a temporary glitch to get the info needed to determine which to use temporarily.

If that is the way it is set, my apologies .... I have not run it .....

regards.

Offline travisN000

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1758
Re: TESTING & POLL: Repo speed test GUI
« Reply #21 on: November 01, 2009, 10:24:54 PM »
Quote
..getting the percentage to work properly with zenity has always been a challenge (mostly because zenity eats any variable set while the progress meter is running).  In working on this script I learned a few things that are not well documented in most of the zenity resources that I have seen.  I think I may try and document this more in my thread on GUI dialogs for bash / shell scripting, so I (and others) can refer to it in the future.

Yes please do.
It was one of the most annoying features - or alleged features - of Zenity when I tried it some time ago.
I gave up and used the pulsating bar.

The short answer is to pipe a function or a for/while loop to the zenity progress dialog.  To change the percent progress you have to have your function or loop echo out the percent number (0-100); to change the progress dialog's text you echo out the new text, beginning with the # character, from within the function or loop.  

..the problem with this approach is that any variables that are set inside of a function or loop that is piped to zenity simply disappear..  I had to write the repo speed test results to a file because zenity was eating the bash array I was trying to store them in.  The upside to this is that your (unsorted) speed test results are stored in $HOME/repo-speed-test/ until you run the script again.

If you want to view these results sorted at a later time, just run the following command:
Code: [Select]
sort -nr $HOME/repo-speed-test/repo_goodlist.txt
..or to format it a little more readable:
Code: [Select]
sort -nr $HOME/repo-speed-test/repo_goodlist.txt | awk -F" " '{print $1,"    \t",$2}'

(EDIT: commands edited to reflect recent changes to script)

Is it possible to run the script without having the sources list written?
I do not really want to overwrite it and have to copy it back .... also it might be useful just as a test in the event of a temporary glitch to get the info needed to determine which to use temporarily.

If that is the way it is set, my apologies .... I have not run it .....

regards.

If you click Cancel when prompted to select a default repository (..the dialog that displays your speed test results) it will exit and not overwrite your sources.list

I suppose it might be good to mention that in that dialog's text.  ;)
« Last Edit: November 03, 2009, 12:26:31 AM by travisn000 »

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6849
  • MLU
Re: TESTING & POLL: Repo speed test GUI
« Reply #22 on: November 02, 2009, 02:38:12 AM »
Quote
I had to write the repo speed test results to a file because zenity was eating the bash array I was trying to store them in.

Thanks!   :D

Yes, I believe this is something I would use but never let it write my sources list, preferring to make changes there manually, but maybe based on the results of the speed test.

Thanks for the info.

EDIT
            I was immediately asked, on launch, for the root password. I would suggest that the test could be run without root privileges and the root password only requested if the user chooses to have the script edit the sources file.
 That would of course make it a two stage process ..... 1. test and display results  2.  Write results to the sources list.

Just my personal preference ....

regards.
« Last Edit: November 02, 2009, 02:47:57 AM by JohnBoy »

Offline Texstar

  • Administrator
  • Super Villain
  • *****
  • Posts: 12657
Re: TESTING & POLL: Repo speed test GUI
« Reply #23 on: November 02, 2009, 03:13:24 AM »
Quote
I had to write the repo speed test results to a file because zenity was eating the bash array I was trying to store them in.

Thanks!   :D

Yes, I believe this is something I would use but never let it write my sources list, preferring to make changes there manually, but maybe based on the results of the speed test.

Thanks for the info.

EDIT
            I was immediately asked, on launch, for the root password. I would suggest that the test could be run without root privileges and the root password only requested if the user chooses to have the script edit the sources file.
 That would of course make it a two stage process ..... 1. test and display results  2.  Write results to the sources list.

Just my personal preference ....

regards.

I like that too.

Thanks to everyone who donates. You keep the servers running.
Follow me on Twitter for the latest development info.

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15829
  • LXDE! Coffee, Bacon and Cheesecake!
Re: TESTING & POLL: Repo speed test GUI
« Reply #24 on: November 02, 2009, 07:33:44 AM »
Quote from: Texstar
I like that too.

Me, too.


Offline travisN000

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1758
Re: TESTING & POLL: Repo speed test GUI
« Reply #25 on: November 03, 2009, 12:17:51 AM »
the following changes have been made:
--disabled re-writing of the existing /etc/apt/sources.list file
--root permission are no longer required; files are saved in $HOME/repo-speed-test
--user can select the number of public on-line repo's to keep in the new sources.list file
--local and pass repos from the old sources.list are added to the top of the new sources.list file
--local "localhost" repo's are also now preserved

The new version is attached to the first post of this thread..  Please test and post feedback!
« Last Edit: November 03, 2009, 12:29:58 AM by travisn000 »

timot

  • Guest
Re: TESTING & POLL: Repo speed test GUI
« Reply #26 on: November 03, 2009, 06:43:23 AM »
Thanks travisn000! Nice tool :)

For me the way it works now is suitable and good. I was just wondering would it be a good idea to ask user if he/she wants to just save the new sources.list file in his/her home directory or let the script modify the existing /etc/apt/sources.list file before the script ends... just my thought ::)
« Last Edit: November 03, 2009, 06:55:55 AM by timot »

Offline NoIBnds

  • Hero Member
  • *****
  • Posts: 1208
Re: TESTING & POLL: Repo speed test GUI
« Reply #27 on: November 29, 2009, 08:31:18 AM »
PS..  if you don't know how to install and test, just ask!
 ;D

OK--I am asking
Retired from Fighting Crime and or Evil for Truth, Justice, and the American Way.

Offline travisN000

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1758
Re: TESTING & POLL: Repo speed test GUI
« Reply #28 on: November 29, 2009, 11:13:52 AM »
OK--I am asking

..download the file, open the folder it was saved in, press the f4 key to open a console window at that directory location, and then type:

Code: [Select]
sh ./<name of file.. without brackets>



Offline NoIBnds

  • Hero Member
  • *****
  • Posts: 1208
Re: TESTING & POLL: Repo speed test GUI
« Reply #29 on: November 29, 2009, 11:25:56 AM »
Thank You   ;)
Retired from Fighting Crime and or Evil for Truth, Justice, and the American Way.