This commit is contained in:
+4
-4
@@ -191,17 +191,17 @@ class PisiBuild:
|
||||
|
||||
def run_setup_action(self):
|
||||
# Run configure, build and install phase
|
||||
ctx.ui.action(_("Setting up source...\n"))
|
||||
ctx.ui.action(_("Setting up source..."))
|
||||
self.run_action_function(ctx.const.setup_func)
|
||||
self.set_state("setupaction")
|
||||
|
||||
def run_build_action(self):
|
||||
ctx.ui.action(_("Building source...\n"))
|
||||
ctx.ui.action(_("Building source..."))
|
||||
self.run_action_function(ctx.const.build_func)
|
||||
self.set_state("buildaction")
|
||||
|
||||
def run_install_action(self):
|
||||
ctx.ui.action(_("Installing...\n"))
|
||||
ctx.ui.action(_("Installing..."))
|
||||
|
||||
# Before install make sure install_dir is clean
|
||||
if os.path.exists(self.bctx.pkg_install_dir()):
|
||||
@@ -284,7 +284,7 @@ class PisiBuild:
|
||||
compressType=patch.compressionType,
|
||||
targetDir=ctx.config.tmp_dir())
|
||||
|
||||
ctx.ui.action(_("* Applying patch: %s\n") % patch.filename)
|
||||
ctx.ui.action(_("* Applying patch: %s") % patch.filename)
|
||||
util.do_patch(self.srcDir, patchFile, level=patch.level, target=patch.target)
|
||||
|
||||
def gen_metadata_xml(self, package):
|
||||
|
||||
@@ -1,120 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright (C) 2005, TUBITAK/UEKAE
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free
|
||||
# Software Foundation; either version 2 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Please read the COPYING file.
|
||||
#
|
||||
|
||||
import socket
|
||||
import struct
|
||||
|
||||
import pisi
|
||||
|
||||
class ComarError(pisi.Error):
|
||||
pass
|
||||
|
||||
class ComarIface:
|
||||
"""A class for communicating with comard."""
|
||||
RESULT = 0
|
||||
FAIL = 1
|
||||
RESULT_START = 2
|
||||
RESULT_END = 3
|
||||
NOTIFY = 4
|
||||
__LOCALIZE = 5
|
||||
__REGISTER = 6
|
||||
__REMOVE = 7
|
||||
__CALL = 8
|
||||
|
||||
def __init__(self):
|
||||
try:
|
||||
self.sock = socket.socket(socket.AF_UNIX,socket.SOCK_STREAM)
|
||||
self.sock.connect("/tmp/comar")
|
||||
except:
|
||||
# should raise an exception here
|
||||
raise ComarError, 'Cannot connect to COMAR daemon'
|
||||
|
||||
def __pack(self, cmd, id, args):
|
||||
size = 0
|
||||
args2 = []
|
||||
# NOTE: COMAR RPC is using network byte order (big endian)
|
||||
fmt = "!ii"
|
||||
for a in args:
|
||||
a = str(a) # damn unicode
|
||||
fmt += "h%dsB" % (len(a))
|
||||
size += 2 + len(a) + 1
|
||||
args2.append(len(a))
|
||||
args2.append(a.encode("utf-8"))
|
||||
args2.append(0)
|
||||
pak = struct.pack(fmt, (cmd << 24) | size, id, *args2)
|
||||
return pak
|
||||
|
||||
def read_reply(self):
|
||||
pass
|
||||
|
||||
def localize(self, localename):
|
||||
"""Sets the language for translated replies.
|
||||
|
||||
Since comard has no way to detect caller's locale, this command
|
||||
is used for sending user's language to the comard. Afterwards,
|
||||
all the jobs started with API calls uses translated messages in
|
||||
their replies.
|
||||
|
||||
You can get the localename parameter from setlocale(NULL) call.
|
||||
"""
|
||||
pass
|
||||
|
||||
def register(self, classname, packagename, cslfile, id = 0):
|
||||
"""Registers a package script on the system model.
|
||||
"""
|
||||
pak = self.__pack(self.__REGISTER, id,
|
||||
[ classname, packagename, cslfile ]
|
||||
)
|
||||
self.sock.send(pak)
|
||||
|
||||
def remove(self, packagename, id = 0):
|
||||
"""Remove package's all scripts from system.
|
||||
"""
|
||||
pak = self.__pack(self.__REMOVE, id, [ packagename ])
|
||||
self.sock.send(pak)
|
||||
|
||||
def call(self, methodname, args, id = 0):
|
||||
"""Makes a configuration call on the system model.
|
||||
"""
|
||||
a = [ methodname ]
|
||||
a.extend(args)
|
||||
pak =self.__pack(self.__CALL, id, a)
|
||||
self.sock.send(pak)
|
||||
|
||||
def call_package(self, methodname, packagename, args, id = 0):
|
||||
"""Makes a configuration call directed to a package.
|
||||
"""
|
||||
pass
|
||||
|
||||
def call_instance(self, methodname, packagename, instancename, args, id = 0):
|
||||
# not yet decided
|
||||
pass
|
||||
|
||||
def get_packages(self, classname, id = 0):
|
||||
"""Returns registered packages for a given system model class.
|
||||
"""
|
||||
pass
|
||||
|
||||
def ask_notify(self, notifyname, id = 0):
|
||||
"""Asks for a notification event to be delivered.
|
||||
"""
|
||||
pass
|
||||
|
||||
comard = None
|
||||
|
||||
def init():
|
||||
comard = ComarIface()
|
||||
|
||||
def finalize():
|
||||
if comard:
|
||||
del comard
|
||||
|
||||
+2
-2
@@ -35,6 +35,7 @@
|
||||
import xml.dom.minidom as mdom
|
||||
from xml.parsers.expat import ExpatError
|
||||
import codecs
|
||||
import types
|
||||
|
||||
# PiSi
|
||||
import pisi
|
||||
@@ -45,8 +46,7 @@ import pisi.context as ctx
|
||||
class Error(pisi.Error):
|
||||
pass
|
||||
|
||||
import types
|
||||
|
||||
|
||||
mandatory, optional = range(2) # poor man's enum
|
||||
|
||||
# basic types
|
||||
|
||||
@@ -14,6 +14,8 @@ import xml.dom.minidom as mdom
|
||||
from xml.parsers.expat import ExpatError
|
||||
import types
|
||||
|
||||
import pisi
|
||||
import pisi.api
|
||||
from pisi import xmlfile
|
||||
from pisi.config import config
|
||||
import pisi.util as util
|
||||
@@ -21,8 +23,7 @@ from pisi.xmlext import *
|
||||
|
||||
class XmlFileTestCase(unittest.TestCase):
|
||||
def setUp(self):
|
||||
# impl = mdom.getDOMImplementation()
|
||||
pass
|
||||
pisi.api.init(False)
|
||||
|
||||
def testMetaClass(self):
|
||||
class A:
|
||||
|
||||
Reference in New Issue
Block a user