Author Topic: Converting our in House Scripts to PerlGTK  (Read 12849 times)

Offline Mark342

  • Sr. Member
  • ****
  • Posts: 334
Re: Converting our in House Scripts to PerlGTK
« Reply #75 on: August 29, 2010, 12:06:40 PM »
Neal, it seems the apt upgrade simulation failed with an error.
This line:
Code: [Select]
E: Conf Broken libjpeg62Is the output of apt.
I currently only check for errors with apt update.
I will modify it check for errors with apt upgrade too.
Also, I've modified it to check if the summaries element is undefined.

Really bad oversight on my part.
Especially since I encountered the same problem.
I guess I forgot to fix it.  ::)

Neal, do you know what the cause of this error is?
It is the same as the output of apt-get -s dist-upgrade.
How does synaptic handle issues like this?
Also, which should be used, upgrade or dist-upgrade?

New version has been uploaded, get it at the same link.

Leiche, yes that would be best, but I don't know how to package yet so this will have to do for now.
« Last Edit: August 29, 2010, 12:23:19 PM by Mark342 »
Anything worth doing is worth overdoing.

Registered Linux user #493318
Register yourself here: Linux Counter

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Converting our in House Scripts to PerlGTK
« Reply #76 on: August 29, 2010, 12:29:21 PM »
I'll see if I can create an RPM.

Offline Mark342

  • Sr. Member
  • ****
  • Posts: 334
Re: Converting our in House Scripts to PerlGTK
« Reply #77 on: August 29, 2010, 04:12:03 PM »
There might be one of those off-by-one errors in the "next update" thing.  It's showing the bubble that says the next update is last month(july) of this year.  (am going with default settings)


Lol, I can't believe I didn't notice that. :D
Time is knda tricky because the perl function localtime() and the Date:Calc module use different numbers to represent the date.
For instance: localtime() uses 0,1,2,3,4,5,6 for the day of the week and Date::Calc uses 1,2,3,4,5,6,7.

I've fixed it now.  :)

http://www.box.net/shared/43eu9hsllj
Anything worth doing is worth overdoing.

Registered Linux user #493318
Register yourself here: Linux Counter

Offline travisN000

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1758
Re: Converting our in House Scripts to PerlGTK
« Reply #78 on: August 31, 2010, 11:26:51 AM »
What it needs:
  • More Configuration Options? (Need some suggestions)


...some very cool things are happening here!  I wish I had more time to read the code and learn from you guys.. ..kids and work are keeping me very busy!


The one option that I can see for this that I would immediately miss is the ability to have update-notifier use synaptic for updates (it sounds like you are using apt-get?).  It would also be nice to have options for how visible synaptic is (ie, normal/full mode, hide main window but display user prompts/progress, or hide the main window and confirmation/progress dialogs.)

I like to suppress the main synaptic window so that only the confirmation dialog for updates/changes and progress are displayed (I like not having synaptic take over my entire screen for a simple / routine update :P ), but I still like to see the progress dialog.

Some users would like to have synaptic run in "invisible mode":
...an idea as an option:

[ x ] Invisible install with Synaptic

 
Code: [Select]
synaptic --dist-upgrade-mode --non-interactive --hide-main-window -o Synaptic::AskRelated=true


..using synaptic instead of apt-get also maintains the integrity of synpatic's built in history features.




On a semi-related note..

..working with the original update-notifier script and some of the problems that arose with updates before Tex's return, I found that using synaptic is a much safer / easier than using apt-get for the update process; I think it is also preferred by Tex.  It is a lot of work to try and handle all the errors that can pop up with apt-get ..it has many, many different exit status codes depending on the nature of the problem it experiences, and it becomes difficult to relay this info to the user in a useful way.  

In the current update notifier I tried to catch the "held package" condition during the (apt based) update check because many people were getting into trouble for ignoring it in synaptic, but I think my "DO NOT UPDATE" warning was a little to scary for some... I'm still not sure what is the best way to deal with these type of situations.


Anyway, I look forward to seeing the progress of these projects; Keep up the good work!
 ;D
« Last Edit: August 31, 2010, 02:05:49 PM by travisn000 »

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Converting our in House Scripts to PerlGTK
« Reply #79 on: September 02, 2010, 06:25:59 AM »
That looks good, ongoto. :)

Offline slax

  • Sr. Member
  • ****
  • Posts: 391
    • PCLinuxOS Gnome Edition
Re: Converting our in House Scripts to PerlGTK
« Reply #80 on: September 02, 2010, 09:24:17 AM »
+1  ;)



Offline Mark342

  • Sr. Member
  • ****
  • Posts: 334
Re: Converting our in House Scripts to PerlGTK
« Reply #81 on: September 02, 2010, 07:15:56 PM »
It looks really nice ongoto.  ;)

Just two minor suggestions:
What is the difference between "Update synaptic source" and "Replace system list"?
You might want to change these labels to something less ambiguous.

Also, I've noticed that most (if not all) programs capitalize the first letter in every word of a label that's used in a widget so you might want to do the same.
I'm planning to do this in the next release of the update notifier.

Other then that, this looking good! Great work!

=====
Ongoto:I don't know if you've already done this, but it would be nice if you could post your updated switch-themes script.
If you do, we can finish gezSwitch4 (I'm going to add GNU gettext support for translations) and it can be packaged.  ;D

Everyone: In gezSwitch4, some text has markup like this:
Code: [Select]
<span size='large'>Ready to install $choice</span>\n\nThis will take some time\nPlease wait ...Should we use the entire thing as a single translatable string, or do we chop it up to eliminate the markup?
I'm thinking that we should use the whole thing since translation is largely based on context.

Everyone: No, I'm not abandoning update-notifier :P, infact, I've added travis's suggestion (still need to test it, and hopefully this will fix the errors you sometimes get when checking for updates), added functionality to the enable/disable options, fixed (yet another) "Next update" time bug,  and now you don't have to wait for the next update check for your "update interval" changes to take effect.  ;D
« Last Edit: September 02, 2010, 07:23:49 PM by Mark342 »
Anything worth doing is worth overdoing.

Registered Linux user #493318
Register yourself here: Linux Counter

Offline travisN000

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1758
Re: Converting our in House Scripts to PerlGTK
« Reply #82 on: September 02, 2010, 09:51:05 PM »
Everyone: No, I'm not abandoning update-notifier :P, infact, I've added travis's suggestion (still need to test it, and hopefully this will fix the errors you sometimes get when checking for updates), added functionality to the enable/disable options, fixed (yet another) "Next update" time bug,  and now you don't have to wait for the next update check for your "update interval" changes to take effect.  ;D

I was just perusing the last code posted for update notifier and another settings request that was once made to me came to mind...  apparently much of the world doesn't format date & time the same as we in the good ol' US of A...  I'm sure all those those that don't would like to have the option to have it displayed in their way (..maybe it is possible to detect system settings?)

..just a thought.
 ;)




It looks really nice ongoto.  ;)

Just two minor suggestions:
What is the difference between "Update synaptic source" and "Replace system list"?
You might want to change these labels to something less ambiguous.
+1  ;D
« Last Edit: September 02, 2010, 09:58:47 PM by travisn000 »

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Converting our in House Scripts to PerlGTK
« Reply #83 on: September 03, 2010, 01:09:08 AM »
Quote
Everyone: In gezSwitch4, some text has markup like this:
Code: [Select]
<span size='large'>Ready to install $choice</span>\n\nThis will take some time\nPlease wait ...
Should we use the entire thing as a single translatable string, or do we chop it up to eliminate the markup?
I'm thinking that we should use the whole thing since translation is largely based on context.

I agree. The whole thing should be used.


Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Converting our in House Scripts to PerlGTK
« Reply #84 on: September 03, 2010, 06:28:16 AM »
Perhaps --
"Update synaptic source" could be "Start and Reload Synaptic"?
"Update synaptic source" could be "Create New Sources List"?


Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Converting our in House Scripts to PerlGTK
« Reply #85 on: September 03, 2010, 11:54:49 AM »
hi neal

That would work.  This may also be a good place for a popup dialog, instead, asking the user if he wants to launch synaptic now or later.  That might be a better way to go to insure he gets the message.


Yes, that would be much better, I think.

Quote
Uploaded my copy of  gezSwitch4.
Changes include what I mentioned above plus I wrote a sub to keep /etc/sysconfig/bootsplash up-to-date.
I also wrote a shell script (/usr/local/bin/gswitch-themes) to replace switch-themes.  I put a link in /usr/sbin/gswitch-themes for command line users and updated the README and the installer.
So switch-themes is completely out of the picture now. (as far as gezSwitch4 is concerned)

http://www.box.net/shared/0p2fvtk1px


Great! I'll install this and run it right away. :)

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Converting our in House Scripts to PerlGTK
« Reply #86 on: September 03, 2010, 12:10:32 PM »
I'm liking it. :D

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Converting our in House Scripts to PerlGTK
« Reply #87 on: September 05, 2010, 04:15:12 AM »
I'm not clear on what you want done here. (maybe it's too early in the morning)

Do you want (lines 445 and 446)
Code: [Select]
sub write_cfg() {
my ($choice, $cfg_file) = @_;

replaced with
Code: [Select]
sub write_cfg() {
my ($choice, $cfg_file) = @_;
substInFile { s/^THEME=.*\n/THEME=$choice\n/ } $cfg_file;
return 0;
}

and a blank line added after line 436?


Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Converting our in House Scripts to PerlGTK
« Reply #88 on: September 05, 2010, 04:46:08 AM »
Okay. Thanks. :)

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Converting our in House Scripts to PerlGTK
« Reply #89 on: September 05, 2010, 05:44:22 AM »
Okay. I added
Code: [Select]
use MDK::Common; to line 38.