It is currently Wed Jun 19, 2013 7:58 am

All times are UTC




Post new topic Reply to topic  [ 101 posts ]  Go to page 1, 2, 3, 4, 5 ... 7  Next
Author Message
 Post subject: auto netpkg check update (New name: Zen Update Tool)
PostPosted: Wed Sep 26, 2007 3:43 am 
Master of the known universe
Master of the known universe
User avatar

Joined: Thu Mar 29, 2007 2:34 am
Posts: 1253
Location: Taiwan
mprimrose wrote:
...

A optional panel plugin would allow those, who like to keep their systems uptodate, gain "realtime" notification of any updates and those who dont really care about it one way or another would not need to bother about installing it.  Practically speaking, a cron job that fired up the daemon to run the checks every six hours or so would be more than adequate given the normal rate of updates. The plugin would be configured to point at a particular mirror, thus allowing for the existence of two plugins;one pointing to current, the other to snapshot. Given these plugins dont actually do any installations themselves, they simply give you a heads up about what is changing in the repositories. An RSS feed could do the same, but I rather like the idea of a flashing dolphin plugin, but perhaps thats just me .

...


Well, After reading some posts. I've decided to make up the silly critics I made there before by creating something that try to address the issues.

autoUpdate.pl

----------------------

Version 0.7.5 


*Use timestamps to reduce network traffic and cputime doing "netpkg list U"
*Minor big fix
*This version require libwww-perl installed, please install it from netpkg
*Fix the issue with updated GDM package.
*Fix the compatibility with ktsuss

----------------------

Well, This little program does NOT update anything for you, instead it does certain things inspired by the quote above (well, the flashing icon hasn't been implemented yet ... ;D) Currently, it checks the default ZW repo you pointed to and report the total number of updates available. it does the notification by changing icon in the system tray (notification area) :

Image means network or program error:

right click to get menu (quit)
left click to re-queue (the icon will disappear and popup again 99 seconds later with black_list recheck)

Image means system up-to-date, the messages will be in tooltips

right click to get menu (quit)
left click to re-queue (the icon will disappear and popup again 99 seconds later with black_list recheck)

If you just leave it there at this stat, it will automatically recheck every 20 minutes.

Image means there are more then 1 package update available on the repo, the messages will be in the tooltips (it tells you the number of packages available)

right click to get menu (quit)
left click to launch xnetpkg, after that, re-queue ( 10 seconds later, with black_list recheck) the daemon.

If you just leave it there at this stat, it will automatically recheck every 60 minutes.

Since version 0.4, the "Black_list" tag in netpkg.conf get checked and memorized at startup, during the process the program uses the same list until you left click the icon and make it "re-queue" (the icon disappear). The black_list get detected again in this mode. I think this is a better way to improve performance since that most people don't change their "Black_list" tag too often. However, if you do change the "Black_list", just left click the tray icon, autoUpdate will detect your changes.

;D


Installation

I'll make it a ZW package in the future, but actually it's quite easy to install. All dependencies should be solved on the default ZW installation disc.
Just copy the perl script (make sure you have permission to execute it) to any folder in root's path. You have two ways to execute the script,


option A) Launch the script as root, point the screen to the right place:

Code:
DISPLAY=:0.0 autoUpdate.pl &


option B) (currently the better way to install) Allow gksudo execution of the script:

for example, if I (infwonder) installed the script in /usr/sbin,
add the line as root with command "visudo", it will bring up vi to edit the sudo config file:

Code:
infwonder ALL = (ALL) /usr/sbin/autoUpdate.pl


Then you can launch the program with the command of:
Code:
gksudo /usr/sbin/autoUpdate.pl



:)

NOTE

This version of the code may still have bugs, please report bugs to me ;)

Helps for GTK2-perl (or just GTK2) programming are appreciated.

HTH

Download


P.S. The new name is suggested by Borromini
Thanks for helps from all the testers  \!D/

_________________
Wisdom begins in wonder. -- Socrates


Last edited by infwonder on Mon Jul 21, 2008 9:50 am, edited 2 times in total.

 Profile Send private message  
 
 Post subject: Re: auto netpkg check update
PostPosted: Wed Sep 26, 2007 5:18 pm 
Global Moderator
Global Moderator
User avatar

Joined: Fri Mar 10, 2006 4:46 am
Posts: 3631
Location: Still on IPv4
Fancy stuff, I heard good things about this infwonder :).

Stickied it.

_________________
Leenucks - the greatest thing since evolution theory || Questions about forum etiquette? Feel free to PM me.


 Profile Send private message  
 
 Post subject: Re: auto netpkg check update
PostPosted: Wed Sep 26, 2007 11:04 pm 
Master of the known universe
Master of the known universe
User avatar

Joined: Thu Mar 29, 2007 2:34 am
Posts: 1253
Location: Taiwan
Thank you ;)

I am just glad to do something for Zenwalk community  l!!!

_________________
Wisdom begins in wonder. -- Socrates


Last edited by infwonder on Thu Sep 27, 2007 1:46 am, edited 1 time in total.

 Profile Send private message  
 
 Post subject: Re: auto netpkg check update
PostPosted: Thu Sep 27, 2007 6:51 am 
Master of the known universe
Master of the known universe
User avatar

Joined: Sat Mar 18, 2006 1:13 pm
Posts: 1182
a really nice add might be an option (conf file like "pkg1,pkg4,pkg42" maybe [1]) to avoid some package.
This way ones don't get "there is some package to update" and the only package to update are package the user don't wan't to update (blacklisted ones).

BTW you should create a package ...


[1]Or maybe parsing netpkg.conf "Black_list" tag ;)

_________________
Guth
Zenwalk: Don't Panic


 Profile Send private message  
 
 Post subject: Re: auto netpkg check update
PostPosted: Thu Sep 27, 2007 6:57 am 
Master of the known universe
Master of the known universe
User avatar

Joined: Thu Mar 29, 2007 2:34 am
Posts: 1253
Location: Taiwan
guth wrote:
...
Or maybe parsing netpkg.conf "Black_list" tag ;)
...


yeah, I've done some work about that. Now I am trying to optimize it for better performance.

Stay tune for a new version (and maybe a zenwalk package ?!? ) 

;D

_________________
Wisdom begins in wonder. -- Socrates


 Profile Send private message  
 
 Post subject: Re: auto netpkg check update
PostPosted: Thu Sep 27, 2007 7:27 am 
Master of the known universe
Master of the known universe
User avatar

Joined: Sat Mar 18, 2006 1:13 pm
Posts: 1182
please put the lock in: /var/run/autoupdate.lock
and about the Black_list, you might replace line 60:
Code:
chomp($list = `nice -19 netpkg list U|nice -19 grep --mmap -o -c "\[U\]" &`) && &listing;

with:
Code:
$blacklistpkgs=`nice -19 grep Black_list /etc/netpkg.conf | sed 's/.*=\s//g; s/\s/|/g'`
chomp($list = `nice -19 netpkg list U|nice -19 grep --mmap -o -c "\[U\]" |nice -19 grep -E "$blacklistpkgs" &`) && &listing;

_________________
Guth
Zenwalk: Don't Panic


 Profile Send private message  
 
 Post subject: Re: auto netpkg check update
PostPosted: Thu Sep 27, 2007 9:13 am 
Master of the known universe
Master of the known universe
User avatar

Joined: Thu Mar 29, 2007 2:34 am
Posts: 1253
Location: Taiwan
Thank you, guth, for your advices.

However, before I read your post, I've already done a new version that resolve black_list issue. Please take a look and give it a try. ;)

The lock file is now placed at /var/run

Hope you like my solution as well!

;D

_________________
Wisdom begins in wonder. -- Socrates


 Profile Send private message  
 
 Post subject: Re: auto netpkg check update
PostPosted: Thu Sep 27, 2007 12:01 pm 
Master of the known universe
Master of the known universe
User avatar

Joined: Sat Mar 18, 2006 1:13 pm
Posts: 1182
waitting for package .... ;)

_________________
Guth
Zenwalk: Don't Panic


 Profile Send private message  
 
 Post subject: Re: auto netpkg check update
PostPosted: Thu Sep 27, 2007 3:36 pm 
Master of the known universe
Master of the known universe
User avatar

Joined: Thu Mar 29, 2007 2:34 am
Posts: 1253
Location: Taiwan
I think we need more tests before making it a ZW package. I am now trying to run it 24/7 on different machines and see what will happen. Please help me test the script and report bugs to me.

Thank you in advance.

:)

_________________
Wisdom begins in wonder. -- Socrates


 Profile Send private message  
 
 Post subject: Re: auto netpkg check update
PostPosted: Thu Sep 27, 2007 5:24 pm 
Master of the known universe
Master of the known universe
User avatar

Joined: Sat Mar 18, 2006 1:13 pm
Posts: 1182
creating a ZW package doesn't mean perfect software, it just means:
- easier to use (with a nice .desktop)
- easier to install/upgrade

_________________
Guth
Zenwalk: Don't Panic


 Profile Send private message  
 
 Post subject: Re: auto netpkg check update
PostPosted: Thu Sep 27, 2007 5:31 pm 
Master of the known universe
Master of the known universe
User avatar

Joined: Thu Mar 29, 2007 2:34 am
Posts: 1253
Location: Taiwan
I see.
But I have one more question about making this into a package:

If I follow the installation mentioned above in my package, which requires me to modified /etc/sudoers. Is this ok ? I saw that /etc/sudoers is in the "protected_files" section in netpkg.conf, does this mean the .old files will be shift back when the package uninstall ?

Maybe using SUID on this script is a better solution? What do you think?

Thnk you in advance !

H!!!

_________________
Wisdom begins in wonder. -- Socrates


 Profile Send private message  
 
 Post subject: Re: auto netpkg check update
PostPosted: Thu Sep 27, 2007 8:13 pm 
Master of the known universe
Master of the known universe
User avatar

Joined: Sat Mar 18, 2006 1:13 pm
Posts: 1182
you might create a doinst.sh with a content like:
Code:
isalreadyhere=$(grep autoUpdate /etc/sudoers);
if [ -z "$isalreadyhere" ]; then
    cp /etc/sudoers /etc/sudoers.new
    echo "%cdrom ALL = (root) NOPASSWD: /usr/sbin/autoUpdate.pl " >> /etc/sudoers.new
fi

not tested but i guess you got the idea ;)

_________________
Guth
Zenwalk: Don't Panic


 Profile Send private message  
 
 Post subject: Re: auto netpkg check update (New name: Zen Update Tool)
PostPosted: Sun Sep 30, 2007 7:53 am 
Master of the known universe
Master of the known universe
User avatar

Joined: Thu Mar 29, 2007 2:34 am
Posts: 1253
Location: Taiwan
sorry, guth, I 've tried your suggestion and built a package for ZUT, but after installation (with zenpkg), when I do "dotnew", the sudoers.new didn't showup in the list. Is this because I didn't install the package through netpkg? or should I change the "protected_Files" tag ? What should I do to allow the modified /etc/sudoers.new be detected by netpkg dotnew ?

Thank you in advance

H!!!

_________________
Wisdom begins in wonder. -- Socrates


 Profile Send private message  
 
 Post subject: Re: auto netpkg check update (New name: Zen Update Tool)
PostPosted: Sun Sep 30, 2007 9:31 am 
Zenwalk Packager
Zenwalk Packager

Joined: Fri Mar 10, 2006 9:09 am
Posts: 2797
Location: Amsterdam
Reporting: the thing works with kde... I seem to have two upgradable packages....

Some remarks:

- the util reports two upgradable packages, but netpkg has a different view of things it has more
  than those, and not all of those are blacklisted... (do you want details?)
- if i click on the icon, netpkg starts, but the icon 'disappears' once netpkg is running/stopped...

Probably due to my incompetence.... I started the app from a root-console...

Trace:

prf[~]$ su
Password:
root[prf]# visudo
root[prf]# cp patches/autoUpdate.pl /usr/sbin/
root[prf]# chown root:root /usr/sbin/autoUpdate.pl
root[prf]# DISPLAY=:0.0
root[prf]# chmod a+x /usr/sbin/autoUpdate.pl
root[prf]# /usr/sbin/autoUpdate.pl

>> click on the icon, get xnetpkg... exit xnetpkg...
root[prf]# Cleaning temporary files and saving meta information

>> icon disappeared, i attempt to re-run the autoUpdate...

/usr/sbin/autoUpdate.pl
already running, if not, please delete /var/run/autoupdate.lock

root[prf]# rm /var/run/autoupdate.lock
root[prf]# /usr/sbin/autoUpdate.pl

>> icon back in the system tray


Attachments:
snapshot1.png
snapshot1.png [ 5.66 KiB | Viewed 1676 times ]

_________________
In case of panic: scream and run in circles!


Last edited by prfaasse on Sun Sep 30, 2007 9:40 am, edited 1 time in total.
 Profile Send private message  
 
 Post subject: Re: auto netpkg check update (New name: Zen Update Tool)
PostPosted: Sun Sep 30, 2007 10:02 am 
Master of the known universe
Master of the known universe
User avatar

Joined: Sat Mar 18, 2006 1:13 pm
Posts: 1182
can you post a link to the package ? (just to check myself whithout redoing the all stuff ;))

_________________
Guth
Zenwalk: Don't Panic


 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 101 posts ]  Go to page 1, 2, 3, 4, 5 ... 7  Next

All times are UTC


 Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
 
cron