2008-09-05 07:24:38 -07:00
|
|
|
#!/usr/bin/python
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
|
|
|
# Copyright (C) 2008 Tim Lauridsen <timlau@fedoraproject.org>
|
2008-09-17 02:49:13 -07:00
|
|
|
# Copyright (C) 2008 Richard Hughes <richard@hughsie.com>
|
2008-09-05 07:24:38 -07:00
|
|
|
|
|
|
|
# Dispacher script to run pk commands from stdin
|
|
|
|
|
|
|
|
import sys
|
2008-09-17 02:49:13 -07:00
|
|
|
from packagekit.backend import *
|
2008-09-05 07:24:38 -07:00
|
|
|
|
2008-09-17 02:49:13 -07:00
|
|
|
class PackageKitYumBackend(PackageKitBaseBackend):
|
|
|
|
def __init__(self,args,lock=True):
|
|
|
|
PackageKitBaseBackend.__init__(self,args)
|
|
|
|
|
|
|
|
def search_name(self,filters,key):
|
2008-09-17 02:24:33 -07:00
|
|
|
# check we escape spaces properly
|
2008-09-17 02:49:13 -07:00
|
|
|
if key == 'power manager':
|
|
|
|
self.package("polkit;0.0.1;i386;data",INFO_AVAILABLE,"PolicyKit daemon")
|
2008-09-05 08:49:19 -07:00
|
|
|
|
|
|
|
def main():
|
2008-09-17 02:49:13 -07:00
|
|
|
backend = PackageKitYumBackend('',lock=True)
|
|
|
|
backend.dispatcher(sys.argv[1:])
|
2008-09-05 08:49:19 -07:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|
2008-09-05 07:24:38 -07:00
|
|
|
|