* operations'i refactor et, operations terimi binary paketler uzerinde
yapilan islemleri ifade ediyor * bir takim olaylara giriliyor yavas yavas (multi-package) * todo'yu duzenle INSANLARA TASK ASSIGN ET. alo!
This commit is contained in:
@@ -38,45 +38,44 @@ Legend:
|
|||||||
+ Package/Files
|
+ Package/Files
|
||||||
|
|
||||||
2. Alpha
|
2. Alpha
|
||||||
- incremental build
|
- incremental build (meren)
|
||||||
- generate binary release number by comparing MD5s (meren)
|
- generate binary release number by comparing MD5s (meren)
|
||||||
- keep track of successfully completed configure, make, install
|
- keep track of successfully completed configure, make, install
|
||||||
steps (necessary for large-scale builds?) (meren)
|
steps (necessary for large-scale builds?) (meren)
|
||||||
/ multi-package dependency analysis (eray)
|
/ multi-package dependency analysis (eray)
|
||||||
+ design a package operation planner
|
+ design a package operation planner
|
||||||
- install operation
|
- install operation (eray)
|
||||||
- upgrade operation
|
- upgrade operation (eray)
|
||||||
+ command line interface:
|
+ command line interface:
|
||||||
/ multi-package installation
|
|
||||||
+ pisi remove
|
+ pisi remove
|
||||||
- pisi upgrade (baris)
|
- pisi upgrade (baris)
|
||||||
+ svn-like CLI
|
+ svn-like CLI
|
||||||
- non-interactive use
|
- non-interactive use (baris)
|
||||||
/ configuration file
|
/ configuration file
|
||||||
+ define the format of the configuration file
|
+ define the format of the configuration file
|
||||||
+ extend Config module (config.py) accordingly
|
+ extend Config module (config.py) accordingly
|
||||||
- define configuration keys
|
- define configuration keys (baris - meren)
|
||||||
/ component/category
|
/ component/category
|
||||||
+ requirements
|
+ requirements
|
||||||
- xml format
|
- xml format (baris) (bunlarin class'leri yazilmali)
|
||||||
- usage
|
- usage (build process'in icine koymak baris - meren)
|
||||||
/ query
|
/ query
|
||||||
+ list of installed packages (eray)
|
+ list of installed packages (eray)
|
||||||
- comar OM information (Provides) (baris)
|
- comar OM information (Provides) (baris)
|
||||||
- refactor actionsAPI
|
- refactor actionsAPI (caglar)
|
||||||
- actionsAPI documentation
|
- actionsAPI documentation (caglar)
|
||||||
/ versioning information document (bunu ben yazmistim zaten - eray)
|
/ versioning information document (bunu ben yazmistim zaten - eray)
|
||||||
/ verify metodlari
|
/ verify metodlari
|
||||||
+ SpecFile
|
+ SpecFile
|
||||||
+ MetaData
|
+ MetaData
|
||||||
+ Files
|
+ Files
|
||||||
- Index
|
- Index (bu onemli degil)
|
||||||
- implement missing unit tests
|
- implement missing unit tests (bunlari da salliyoruz simdilik)
|
||||||
+ sourcedb
|
+ sourcedb
|
||||||
- package
|
- package
|
||||||
- configuration file
|
- configuration file
|
||||||
+ fix xml indentation (meren)
|
+ fix xml indentation (meren)
|
||||||
- define file types (doc, executable, conf, etc...)
|
- define file types (doc, executable, conf, etc...) (baris - meren)
|
||||||
+ write specfile (eray)
|
+ write specfile (eray)
|
||||||
+ file locking for database access [not tested!] (eray)
|
+ file locking for database access [not tested!] (eray)
|
||||||
+ implement file uri
|
+ implement file uri
|
||||||
|
|||||||
+7
-12
@@ -4,6 +4,7 @@ import pisi
|
|||||||
from pisi.config import config
|
from pisi.config import config
|
||||||
from pisi.purl import PUrl
|
from pisi.purl import PUrl
|
||||||
from common import *
|
from common import *
|
||||||
|
import pisi.toplevel
|
||||||
|
|
||||||
# helper functions
|
# helper functions
|
||||||
def cmdObject(cmd, fail=False):
|
def cmdObject(cmd, fail=False):
|
||||||
@@ -98,9 +99,8 @@ class Build(Command):
|
|||||||
self.help()
|
self.help()
|
||||||
return
|
return
|
||||||
|
|
||||||
from pisi.operations import build
|
|
||||||
for arg in self.args:
|
for arg in self.args:
|
||||||
build(arg, self.authInfo)
|
pisi.toplevel.build(arg, self.authInfo)
|
||||||
|
|
||||||
class Install(Command):
|
class Install(Command):
|
||||||
"""install: install PISI packages"""
|
"""install: install PISI packages"""
|
||||||
@@ -116,9 +116,7 @@ class Install(Command):
|
|||||||
self.help()
|
self.help()
|
||||||
return
|
return
|
||||||
|
|
||||||
from pisi.operations import install
|
pisi.toplevel.install(self.args)
|
||||||
for arg in self.args:
|
|
||||||
install(arg)
|
|
||||||
|
|
||||||
class Remove(Command):
|
class Remove(Command):
|
||||||
"""remove: remove PISI packages"""
|
"""remove: remove PISI packages"""
|
||||||
@@ -134,9 +132,7 @@ class Remove(Command):
|
|||||||
self.help()
|
self.help()
|
||||||
return
|
return
|
||||||
|
|
||||||
from pisi.operations import remove
|
pisi.toplevel.remove(self.args)
|
||||||
for arg in self.args:
|
|
||||||
remove(arg)
|
|
||||||
|
|
||||||
class Info(Command):
|
class Info(Command):
|
||||||
"""info: display information about a package
|
"""info: display information about a package
|
||||||
@@ -154,7 +150,7 @@ class Info(Command):
|
|||||||
|
|
||||||
def printinfo(self, arg):
|
def printinfo(self, arg):
|
||||||
import os.path
|
import os.path
|
||||||
from pisi.operations import info
|
from pisi.toplevel import info
|
||||||
|
|
||||||
if os.path.exists(arg):
|
if os.path.exists(arg):
|
||||||
metadata, files = info(arg)
|
metadata, files = info(arg)
|
||||||
@@ -170,7 +166,7 @@ class Index(Command):
|
|||||||
self.help()
|
self.help()
|
||||||
return
|
return
|
||||||
|
|
||||||
from pisi.operations import index
|
from pisi.toplevel import index
|
||||||
if len(self.args)==1:
|
if len(self.args)==1:
|
||||||
index(self.args[0])
|
index(self.args[0])
|
||||||
elif len(self.args)==0:
|
elif len(self.args)==0:
|
||||||
@@ -197,7 +193,6 @@ class UpdateDB(Command):
|
|||||||
super(UpdateDB, self).__init__()
|
super(UpdateDB, self).__init__()
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
from pisi.operations import updatedb
|
|
||||||
try:
|
try:
|
||||||
indexfile = self.args[0]
|
indexfile = self.args[0]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
@@ -205,7 +200,7 @@ class UpdateDB(Command):
|
|||||||
# configuration file
|
# configuration file
|
||||||
indexfile = None
|
indexfile = None
|
||||||
|
|
||||||
updatedb(indexfile)
|
pisi.toplevel.updatedb(indexfile)
|
||||||
|
|
||||||
|
|
||||||
class ListAvailable(Command):
|
class ListAvailable(Command):
|
||||||
|
|||||||
+15
-44
@@ -1,3 +1,5 @@
|
|||||||
|
# Package Operations: install/remove/upgrade
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from config import config
|
from config import config
|
||||||
@@ -6,13 +8,15 @@ from ui import ui
|
|||||||
from purl import PUrl
|
from purl import PUrl
|
||||||
import util
|
import util
|
||||||
|
|
||||||
# all package operation interfaces are here
|
# single package operations
|
||||||
|
|
||||||
def remove(package_name):
|
def remove(package_name):
|
||||||
"""Remove a goddamn package"""
|
"""Remove a single package"""
|
||||||
from installdb import installdb
|
from installdb import installdb
|
||||||
from comariface import removeScripts
|
from comariface import removeScripts
|
||||||
|
|
||||||
|
#TODO: check dependencies
|
||||||
|
|
||||||
ui.info('Removing package %s\n' % package_name)
|
ui.info('Removing package %s\n' % package_name)
|
||||||
if not installdb.is_installed(package_name):
|
if not installdb.is_installed(package_name):
|
||||||
raise Exception('Trying to remove nonexistent package '
|
raise Exception('Trying to remove nonexistent package '
|
||||||
@@ -30,6 +34,7 @@ def remove(package_name):
|
|||||||
installdb.remove(package_name)
|
installdb.remove(package_name)
|
||||||
removeScripts(package_name)
|
removeScripts(package_name)
|
||||||
|
|
||||||
|
# TODO: repository'den okuma isi yas burada, bu degisecek
|
||||||
def install(pkg):
|
def install(pkg):
|
||||||
url = PUrl(pkg)
|
url = PUrl(pkg)
|
||||||
# Check if we are dealing with a remote file or a real path of
|
# Check if we are dealing with a remote file or a real path of
|
||||||
@@ -63,46 +68,12 @@ def install_package(pkg_location):
|
|||||||
from install import Installer
|
from install import Installer
|
||||||
Installer(pkg_location).install()
|
Installer(pkg_location).install()
|
||||||
|
|
||||||
|
# deneme, don't remove ulan
|
||||||
|
class AtomicOperation(object):
|
||||||
|
def __init__(self, package, ignore_dep = False):
|
||||||
|
self.package = package
|
||||||
|
self.ignore_dep = ignore_dep
|
||||||
|
|
||||||
def info(package_name):
|
def run(self, package):
|
||||||
from package import Package
|
"perform an atomic package operation"
|
||||||
|
pass
|
||||||
package = Package(package_name)
|
|
||||||
package.read()
|
|
||||||
return package.metadata, package.files
|
|
||||||
|
|
||||||
|
|
||||||
def index(repo_dir = '.'):
|
|
||||||
from index import Index
|
|
||||||
|
|
||||||
ui.info('* Building index of PISI files under %s\n' % repo_dir)
|
|
||||||
index = Index()
|
|
||||||
index.index(repo_dir)
|
|
||||||
index.write(const.pisi_index)
|
|
||||||
ui.info('* Index file written\n')
|
|
||||||
|
|
||||||
def updatedb(indexfile = None, repo = "default"):
|
|
||||||
from index import Index
|
|
||||||
|
|
||||||
if not indexfile:
|
|
||||||
repos_path = config.values.repos[repo]
|
|
||||||
indexfile = os.path.join(repos_path, const.pisi_index)
|
|
||||||
|
|
||||||
ui.info('* Updating DB from index file: %s\n' % indexfile)
|
|
||||||
index = Index()
|
|
||||||
index.read(indexfile, repo)
|
|
||||||
index.update_db()
|
|
||||||
ui.info('* Package db updated.\n')
|
|
||||||
|
|
||||||
|
|
||||||
def build(pspecfile, authInfo=None):
|
|
||||||
from build import PisiBuild
|
|
||||||
|
|
||||||
url = PUrl(pspecfile)
|
|
||||||
if url.isRemoteFile():
|
|
||||||
from sourcefetcher import SourceFetcher
|
|
||||||
fs = SourceFetcher(url, authInfo)
|
|
||||||
url.uri = fs.fetch_all()
|
|
||||||
|
|
||||||
pb = PisiBuild(url.uri)
|
|
||||||
pb.build()
|
|
||||||
|
|||||||
@@ -0,0 +1,69 @@
|
|||||||
|
# top level PISI interfaces
|
||||||
|
# a facade to the entire PISI system
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
from config import config
|
||||||
|
from constants import const
|
||||||
|
from ui import ui
|
||||||
|
from purl import PUrl
|
||||||
|
import util
|
||||||
|
|
||||||
|
import operations
|
||||||
|
|
||||||
|
def install(packages):
|
||||||
|
"""install a list of packages (either files, urls, or names)"""
|
||||||
|
#TODO: this for loop is just a placeholder
|
||||||
|
for x in packages:
|
||||||
|
operations.install(x)
|
||||||
|
|
||||||
|
def remove(packages):
|
||||||
|
#TODO: this for loop is just a placeholder
|
||||||
|
for x in packages:
|
||||||
|
operations.remove(x)
|
||||||
|
|
||||||
|
|
||||||
|
def info(package_name):
|
||||||
|
from package import Package
|
||||||
|
|
||||||
|
package = Package(package_name)
|
||||||
|
package.read()
|
||||||
|
return package.metadata, package.files
|
||||||
|
|
||||||
|
|
||||||
|
def index(repo_dir = '.'):
|
||||||
|
from index import Index
|
||||||
|
|
||||||
|
ui.info('* Building index of PISI files under %s\n' % repo_dir)
|
||||||
|
index = Index()
|
||||||
|
index.index(repo_dir)
|
||||||
|
index.write(const.pisi_index)
|
||||||
|
ui.info('* Index file written\n')
|
||||||
|
|
||||||
|
|
||||||
|
def updatedb(indexfile = None, repo = "default"):
|
||||||
|
from index import Index
|
||||||
|
|
||||||
|
if not indexfile:
|
||||||
|
repos_path = config.values.repos[repo]
|
||||||
|
indexfile = os.path.join(repos_path, const.pisi_index)
|
||||||
|
|
||||||
|
ui.info('* Updating DB from index file: %s\n' % indexfile)
|
||||||
|
index = Index()
|
||||||
|
index.read(indexfile, repo)
|
||||||
|
index.update_db()
|
||||||
|
ui.info('* Package db updated.\n')
|
||||||
|
|
||||||
|
|
||||||
|
def build(pspecfile, authInfo=None):
|
||||||
|
from build import PisiBuild
|
||||||
|
|
||||||
|
url = PUrl(pspecfile)
|
||||||
|
if url.isRemoteFile():
|
||||||
|
from sourcefetcher import SourceFetcher
|
||||||
|
fs = SourceFetcher(url, authInfo)
|
||||||
|
url.uri = fs.fetch_all()
|
||||||
|
|
||||||
|
pb = PisiBuild(url.uri)
|
||||||
|
pb.build()
|
||||||
|
|
||||||
Reference in New Issue
Block a user