openSUSE Forums > Programming/Scripting » Adding smart to YaST

Go Back   openSUSE Forums > Programming/Scripting
Forums FAQ Members List Search Today's Posts Mark Forums Read


Programming/Scripting Questions about programming, bash scripts, perl, php, cron jobs, ruby, python, etc.

Reply
Page 1 of 2 1 2
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 26-Oct-2009, 06:56
Jonathan_R's Avatar
Busy Penguin
 
Join Date: Jun 2008
Posts: 479
Jonathan_R hasn't been rated much yet
Default Adding smart to YaST

I thought it might be fun if I did this. At this point, I'm just tinkering. But one could add yum or apt4rpm/synaptic as well, or even all.

I did try going to #yast they said
Quote:
<mvidner> Jonathan_R: you could add an icon to the yast control center to call some smart-gui
<Jonathan_R> well yeah
<Jonathan_R> but how would i do that
<Jonathan_R> that is a start
<Jonathan_R> it might be fun to use the yast software manager gui for the gui front end of the smart cli
<Jonathan_R> i'm just tinkering right now
<mvidner> Jonathan_R: see /usr/share/applications/YaST
<Jonathan_R> just trying to see whats possible
<bubli> mvidner: That wouldn't help. It is necessary, but not sufficient condition
<mvidner> Jonathan_R: oh. that would be hard, I think
<Jonathan_R> at this point i'd settle for something like this
<Jonathan_R> adding smart as an option
<bubli> Everything in /usr/share/applications/YaST is executed as '/sbin/yast [X-SuSE-YaST-Call]'
<Jonathan_R> so that a user could choose software manager or smart\
<bubli> while value of X-SuSE-YaST-Call must be a YaST client
<Jonathan_R> ok
<Jonathan_R> so how sould I get 1) the smart gui icon to show in software
<Jonathan_R> and 2) to get that to be called and work
So I checked all that out. The file /sbin/yast is pastebin - collaborative debugging tool which I don't see how to do as they suggest and add [X-SuSE-YaST-Call]
__________________
My site, a portal to other sites. The Complete Computer Resource: http://thecompletecomputerresource.com/

If you want packages built, ask me. I'll either do it, or get someone else to. If they are not already built.
Reply With Quote
  #2 (permalink)  
Old 26-Oct-2009, 07:21
Jonathan_R's Avatar
Busy Penguin
 
Join Date: Jun 2008
Posts: 479
Jonathan_R hasn't been rated much yet
Default Re: Adding smart to YaST

So apparently ya need to add this code
Code:
{ // begin

//===================================================================
// Start smart either Text (commandline) or GUI mode
//-------------------------------------------------------------------
integer status = 0;

if (UI::TextMode())
{
        y2milestone("Running smart in command line mode.");
    Popup::Error(_("Cannot run smart in text-mode"));
        status = (integer)UI::RunInTerminal("/usr/bin/smart");
}
else
{
        y2milestone("Running smart in GUI mode.");
        status = (integer)SCR::Execute(.target.bash, "/usr/bin/smart");
}

y2milestone("smart finished with exit code: <%1>", status);
if (status == 0) {
        return `next;
}
return `nil;

}
and put it here /usr/share/YaST2/clients The same would be true for yum or synaptic. As far as the icons, add an icon to YaST control centre you'll need 1) create .new .desktop file alike to those already present in /usr/share/applications/YaST2

I hope this helps someone other than me. It was fun.

Much thanks to bubli in #yast for writing the ycp code and helping me with this.
__________________
My site, a portal to other sites. The Complete Computer Resource: http://thecompletecomputerresource.com/

If you want packages built, ask me. I'll either do it, or get someone else to. If they are not already built.
Reply With Quote
  #3 (permalink)  
Old 26-Oct-2009, 08:10
Jonathan_R's Avatar
Busy Penguin
 
Join Date: Jun 2008
Posts: 479
Jonathan_R hasn't been rated much yet
Default Re: Adding smart to YaST

Actually, I had to do some debugging. The code looks like this
Code:
{ // begin

//===================================================================
// Start smart either Text (commandline) or GUI mode
//-------------------------------------------------------------------
integer status = 0;

if (UI::TextMode())
{
        y2milestone("Running smart in command line mode.");
    // Popup::Error(_("Cannot run smart in text-mode"));
        status = (integer)UI::RunInTerminal("/usr/bin/smart --shell");
}
else
{
        y2milestone("Running smart in GUI mode.");
    // Popup::Error(_("Cannot run smart in GUI-mode"));
        status = (integer)SCR::Execute(.target.bash, "/usr/bin/smart --gui");
}

y2milestone("smart finished with exit code: <%1>", status);
if (status == 0) {
        return `next;
}
return `nil;

}
By default, it brings up the smart gui. Now as I said, you can modify this so that you could have yumex or synaptic if you wanted.
__________________
My site, a portal to other sites. The Complete Computer Resource: http://thecompletecomputerresource.com/

If you want packages built, ask me. I'll either do it, or get someone else to. If they are not already built.
Reply With Quote
  #4 (permalink)  
Old 26-Oct-2009, 09:04
palladium
Guest
 
Posts: n/a
Default Re: Adding smart to YaST

> By default, it brings up the smart gui. Now as I said, you can modify
> this so that you could have yumex or synaptic if you wanted.


i think what you have done has a lot of 'neat' appeal, but i wonder
what is the added benefit of having YaST launch smart, rather than
directly placing smart in the menu system and click on it instead of
YaST..

or, you could make a menu item which launched a window where you could
then have an icon to choose between:

YaST
Smart
Yumex (whatever that is)
Synaptic/Apt
a root powered CLI
whatever...

--
palladium
Reply With Quote
  #5 (permalink)  
Old 26-Oct-2009, 09:22
Jonathan_R's Avatar
Busy Penguin
 
Join Date: Jun 2008
Posts: 479
Jonathan_R hasn't been rated much yet
Default Re: Adding smart to YaST

Quote:
Originally Posted by palladium View Post
> By default, it brings up the smart gui. Now as I said, you can modify
> this so that you could have yumex or synaptic if you wanted.


i think what you have done has a lot of 'neat' appeal, but i wonder
what is the added benefit of having YaST launch smart, rather than
directly placing smart in the menu system and click on it instead of
YaST..

or, you could make a menu item which launched a window where you could
then have an icon to choose between:

YaST
Smart
Yumex (whatever that is)
Synaptic/Apt
a root powered CLI
whatever...

--
palladium

I'm not sure what you mean by "window where you could
then have an icon" Here is what it looks like on my end
__________________
My site, a portal to other sites. The Complete Computer Resource: http://thecompletecomputerresource.com/

If you want packages built, ask me. I'll either do it, or get someone else to. If they are not already built.
Reply With Quote
  #6 (permalink)  
Old 26-Oct-2009, 10:14
Jonathan_R's Avatar
Busy Penguin
 
Join Date: Jun 2008
Posts: 479
Jonathan_R hasn't been rated much yet
Default Re: Adding smart to YaST

I had to put the smart icon in /usr/share/YaST2/theme/openSUSE/icons/32x32 to get it to show up in YaST. The smart.desktop file looks like this
Code:
[Desktop Entry]

Type=Application
Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Software;

X-KDE-ModuleType=Library
X-KDE-RootOnly=true
X-KDE-HasReadOnlyMode=true
X-KDE-Library=yast2
X-SuSE-YaST-Call=smart

X-SuSE-YaST-Group=Software
X-SuSE-YaST-Argument=
X-SuSE-YaST-RootOnly=true
X-SuSE-YaST-AutoInst=
X-SuSE-YaST-Geometry=
X-SuSE-YaST-AutoInstResource=

Icon=smart
Exec=/sbin/yast2 smart

Name=Smart Package Manager
GenericName=A next generation package manager written in python that functions on multiple distributions
X-KDE-SubstituteUID=true
StartupNotify=true
For more info on ycp see http://forgeftp.novell.com/yast/doc/...Reference.html
__________________
My site, a portal to other sites. The Complete Computer Resource: http://thecompletecomputerresource.com/

If you want packages built, ask me. I'll either do it, or get someone else to. If they are not already built.
Reply With Quote
  #7 (permalink)  
Old 26-Oct-2009, 15:57
Jonathan_R's Avatar
Busy Penguin
 
Join Date: Jun 2008
Posts: 479
Jonathan_R hasn't been rated much yet
Default Re: Adding smart to YaST

@palladium

Yes, I am aware. Infact, I have smart as a quick launch on my bottom pannel.
__________________
My site, a portal to other sites. The Complete Computer Resource: http://thecompletecomputerresource.com/

If you want packages built, ask me. I'll either do it, or get someone else to. If they are not already built.
Reply With Quote
  #8 (permalink)  
Old 26-Oct-2009, 18:03
Jonathan_R's Avatar
Busy Penguin
 
Join Date: Jun 2008
Posts: 479
Jonathan_R hasn't been rated much yet
Default Re: Adding smart to YaST

Just as a point of interest, you can use the script, modify it of course, to put any admin app into YaST. Guarddog, firestarter, cups, and so on. Now you know how to make YaST into whatever you want.
__________________
My site, a portal to other sites. The Complete Computer Resource: http://thecompletecomputerresource.com/

If you want packages built, ask me. I'll either do it, or get someone else to. If they are not already built.
Reply With Quote
  #9 (permalink)  
Old 26-Oct-2009, 18:09
swerdna's Avatar
Global Moderator
 
Join Date: Mar 2008
Location: Oz
Posts: 4,879
swerdna is a reputation jewel in the roughswerdna is a reputation jewel in the roughswerdna is a reputation jewel in the roughswerdna is a reputation jewel in the roughswerdna is a reputation jewel in the rough
Default Re: Adding smart to YaST

Pretty impressive Jonathan_R. And easier to grasp without the side issues of the missing posts.
__________________
Drop in and visit some time.
Reply With Quote
  #10 (permalink)  
Old 26-Oct-2009, 18:12
malcolmlewis's Avatar
Global Moderator
 
Join Date: Jun 2008
Location: Podunk
Posts: 4,701
malcolmlewis has great reputationmalcolmlewis has great reputationmalcolmlewis has great reputationmalcolmlewis has great reputationmalcolmlewis has great reputationmalcolmlewis has great reputation
Default Re: Adding smart to YaST

Quote:
Originally Posted by Jonathan R
Just as a point of interest, you can use the script, modify it of
course, to put any admin app into YaST. Guarddog, firestarter, cups, and
so on. Now you know how to make YaST into whatever you want.
Hi
I'm assuming the X reference can be changed for the GTK/Gnome version?

--
Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.29-0.1-default
up 17 days 5:40, 3 users, load average: 0.06, 0.02, 0.00
GPU GeForce 8600 GTS Silent - CUDA Driver Version: 190.18

Reply With Quote
Reply
Page 1 of 2 1 2

Bookmarks


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2