It is currently Sun May 19, 2013 7:43 pm

All times are UTC




Post new topic Reply to topic  [ 101 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next
Author Message
 Post subject: Re: auto netpkg check update (New name: Zen Update Tool)
PostPosted: Sun Sep 30, 2007 12:35 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
sorry, I don't know what was going on, but I have uploaded it again  ::)

_________________
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 12:52 pm 
Zenwalk Packager
Zenwalk Packager

Joined: Fri Mar 10, 2006 9:09 am
Posts: 2797
Location: Amsterdam
Downloaded & installed the package....

* I had to manually add the sudoers entry to the list...
* It's 'smiling'  ;D at me again.
* if i click it, i do not get netpkg, but the icon disappears
* it pops up a bit later again...

W.r.t. the last two: so long as you're not starting netpkg, you might want to consider not making the 'smily' disappear...

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


 Profile Send private message  
 
 Post subject: Re: auto netpkg check update (New name: Zen Update Tool)
PostPosted: Sun Sep 30, 2007 2:20 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
prfaasse wrote:
Downloaded & installed the package....

* I had to manually add the sudoers entry to the list...

I think there should be a /etc/sudoers.new. But as mentioned before, currently there seems to be a problem for netpkg dotnew to recognize the file and ask for exchange.

Quote:
* if i click it, i do not get netpkg, but the icon disappears
* it pops up a bit later again...

W.r.t. the last two: so long as you're not starting netpkg, you might want to consider not making the 'smily' disappear...


Please read the original post about the design and its reason.

_________________
Wisdom begins in wonder. -- Socrates


Last edited by infwonder on Sun Sep 30, 2007 2:40 pm, 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 2:43 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
ok, I just test it and confirm that the sudoers.new doesn't get updated because it's in the "protected_files" list in netpkg.conf, once I remove it from the list, I can update the file with netpkg dotnew...

Does that mean I can't package it this way ?

_________________
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 3:16 pm 
Master of the known universe
Master of the known universe
User avatar

Joined: Sat Mar 18, 2006 1:13 pm
Posts: 1182
i will just quote myself:
Quote:
to have netpkg asking for sudoers.new, sudoers must not be in Protected_files.
like:
Code:
#netpkg.conf.new as temp file is required to avoid problems
cat etc/netpkg.conf | sed 's/\s\etc\/sudoers\s/ /g' > etc/netpkg.conf.new
mv etc/netpkg.conf.new etc/netpkg.conf


But the good work around might be to modify the existing sudoers (instead of modifying netpkg.conf), so the doinst should be:
Code:
doinst() {
    if [ -z "$(grep 'autoUpdate.pl' etc/sudoers)" ]; then
        echo "%cdrom ALL = (root) NOPASSWD: /usr/sbin/autoUpdate.pl " >> etc/sudoers
    fi
}
doinst

You might ask JP which option is best in his opinion.

I think every thing you need is here ... ;)

_________________
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 3:41 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
guth wrote:
I think every thing you need is here ... ;)


Thank you very much for the help ;)  \!D/

_________________
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 3:59 pm 
Zenwalk Spin-offs
Zenwalk Spin-offs

Joined: Sat May 06, 2006 7:20 pm
Posts: 495
Location: Mendoza, Argentina
Just some details:

IMO it would be better to use %users group instead of %cdrom in:

guth wrote:
Code:
doinst() {
    if [ -z "$(grep 'autoUpdate.pl' etc/sudoers)" ]; then
        cp etc/sudoers etc/sudoers.new
        echo "%cdrom ALL = (root) NOPASSWD: /usr/sbin/autoUpdate.pl " >> etc/sudoers.new
    fi
}
doinst




Also the ZUT icon should be placed at /usr/share/icons/hicolor/scalable/apps and the Icon entry in ZUT.desktop should not include the full path to the icon but just the name face-glasses.

Great work!

Mauricio


Last edited by zariweb on Sun Sep 30, 2007 4:07 pm, 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 5:31 pm 
Master of the known universe
Master of the known universe
User avatar

Joined: Sat Mar 18, 2006 1:13 pm
Posts: 1182
you're right for the full path zariweb.
How ever icons aren't from this package ;)

so 2 choices:
- duplicate icons from the theme and put them in the right location
- continue using icons from the theme but being careful it exist in next ZW releases

about the group ... dunno, maybe (my 1st post with this line was more an example than anything else).

_________________
Guth
Zenwalk: Don't Panic


Last edited by guth on Sun Sep 30, 2007 5:34 pm, edited 1 time in total.

 Profile Send private message  
 
 Post subject: Re: auto netpkg check update (New name: Zen Update Tool)
PostPosted: Mon Oct 01, 2007 11:44 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
ok, repackaging :)

BTW, version 0.7 has been released  X!!

_________________
Wisdom begins in wonder. -- Socrates


 Profile Send private message  
 
 Post subject: Re: auto netpkg check update (New name: Zen Update Tool)
PostPosted: Tue Oct 02, 2007 3:54 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:
...
You might ask JP which option is best in his opinion.


Thank you, I think I'll wait until 4.8 is out because :

1. The progeam might need to be modified for 4.8  :-\
2. JP is probably pretty busy right now ...

:)

_________________
Wisdom begins in wonder. -- Socrates


 Profile Send private message  
 
 Post subject: Re: auto netpkg check update (New name: Zen Update Tool)
PostPosted: Tue Oct 02, 2007 7:04 am 
Master of the known universe
Master of the known universe
User avatar

Joined: Sat Mar 18, 2006 1:13 pm
Posts: 1182
about the 4.8:
snapshot and current have sync already, so except kernel and few other things: current = snapshot = 4.8rc.
So don't worry ;)

_________________
Guth
Zenwalk: Don't Panic


 Profile Send private message  
 
 Post subject: Re: auto netpkg check update (New name: Zen Update Tool)
PostPosted: Tue Oct 02, 2007 10:12 am 
Global Moderator
Global Moderator
User avatar

Joined: Fri Mar 10, 2006 4:46 am
Posts: 3631
Location: Still on IPv4
guth wrote:
your doinst script isn't right ...

1) in my example the first '/' in /etc/* shouldn't be there (my bad) so /etc/* become etc/*
2) in your script:
Code:
doinst() {
        cat etc/sudoers |grep "autoUpdate.pl" || echo '%cdrom ALL = (ALL) /usr/sbin/autoUpdate.pl' >> etc/sudoers.new
}

echo '%cdrom ALL = (ALL) /usr/sbin/autoUpdate.pl' >> etc/sudoers.new
is done only if etc/sudoers doesn't contain "autoUpdate.pl" already (wich is OK, this way you don't modify the rules the system admin created to use autoUpdate). That's why you don't have a sudoers.new as i guess you already had a ligne containing autoUpdate in your sudoers
But etc/sudoers.new doesn't exist before (you didn't copy sudoers to sudoers.new) so the sudoers.new (if created) contian only the line you echoed in it ... (not really good ;))

a working modified doinst:
Code:
doinst() {
    if [ -z "$(grep 'autoUpdate.pl' etc/sudoers)" ]; then
        cp etc/sudoers etc/sudoers.new
        echo "%cdrom ALL = (root) NOPASSWD: /usr/sbin/autoUpdate.pl " >> etc/sudoers.new
    fi
}
doinst



BTW: maybe you should modify binary name from autoUpdate.pl to ZUT (or zut) ;)


Grep can evaluate by itself just fine ;-)

Code:
doinst() {
    if grep 'autoUpdate.pl' etc/sudoers ; then
        echo "Sudoers file already contains correct entry."
    else
        cp etc/sudoers etc/sudoers.new
        echo "%users ALL = (root) NOPASSWD: /usr/sbin/autoUpdate.pl " >> etc/sudoers.new
    fi
}
doinst

Of course that leaves you with the output that needs to be 'converted' (hence the else).

Btw - why wrapping it in a function, would just the if construct not be enough?

_________________
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 (New name: Zen Update Tool)
PostPosted: Tue Oct 02, 2007 10:53 am 
Master of the known universe
Master of the known universe
User avatar

Joined: Sat Mar 18, 2006 1:13 pm
Posts: 1182
Code:
        echo "Sudoers file already contains correct entry."

doinst must not echo anything ... ;)

_________________
Guth
Zenwalk: Don't Panic


 Profile Send private message  
 
 Post subject: Re: auto netpkg check update (New name: Zen Update Tool)
PostPosted: Tue Oct 02, 2007 11:47 am 
Zenwalk Packager
Zenwalk Packager

Joined: Fri Mar 10, 2006 9:09 am
Posts: 2797
Location: Amsterdam
Yet another dumb question  :-\ : why is the 'check-for-upgradability' part of the utility run as 'su' at all? Surely, if run as 'normal user', it should be able to access all relevant info (in /var/log/packages & 'on-repo') read-only to decide if upgrades are available. Running netpkg to perform the actual upgrade *is* usually 'behind' a su-passwd-popup switch to 'maintenance mode'. Correct me freely, but -if upgrades are available- if i click on the 'moaner' icon i think it starts (x)netpkg immediately *without* the usual 'gimme the su-passwd' popup...

If i'm boring/misunderstanding/annoying with my questions/remarks, please tell me so: i'll 'shut up' and just see where this train is heading  ;D

NB: I quite enjoy this 'little grinner' in the bottom-right of my (kde-)screen, and think it's a quite sensible addition to zenwalk.

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


 Profile Send private message  
 
 Post subject: Re: auto netpkg check update (New name: Zen Update Tool)
PostPosted: Tue Oct 02, 2007 3: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
prfaasse wrote:
Yet another dumb question  :-\ : why is the 'check-for-upgradability' part of the utility run as 'su' at all? Surely, if run as 'normal user', it should be able to access all relevant info (in /var/log/packages & 'on-repo') read-only to decide if upgrades are available. Running netpkg to perform the actual upgrade *is* usually 'behind' a su-passwd-popup switch to 'maintenance mode'. Correct me freely, but -if upgrades are available- if i click on the 'moaner' icon i think it starts (x)netpkg immediately *without* the usual 'gimme the su-passwd' popup...


yes, in fact, I was also trying to find a way to sync and parse the PACKAGE.TXT without using netpkg... originally, I was trying to include most of the netpkg functions into ZUT, but then I discovered that there are two small programs in /usr/libexec that came with netpkg didn't include source code (at least I didn't find them, maybe I didn't look carefully...), they are:

/usr/libexec/vfilter
/usr/libexec/listbuilder

although I still can figure out how they work by reading the netpkg code, I was just too lazy to do that :P I've sent a PM to JP for the source code but he haven't respones to me. In order to allow ZUT to check updates with "netpkg list U", the program must gain root privilege

Quote:
If i'm boring/misunderstanding/annoying with my questions/remarks, please tell me so: i'll 'shut up' and just see where this train is heading  ;D

NB: I quite enjoy this 'little grinner' in the bottom-right of my (kde-)screen, and think it's a quite sensible addition to zenwalk.


Not at all! I am grateful for all kind of helps and suggestions ... ;)

( Well, maybe I was just too lazy to write things myself  :-X )

--- EDIT ---
Another reason is that I only have limited time for the project and intend to make it a small and simple one ;)

_________________
Wisdom begins in wonder. -- Socrates


Last edited by infwonder on Tue Oct 02, 2007 3:51 pm, edited 1 time in total.

 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 101 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 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: