Az önce çekirdek listesinde bahsettiğim, uzak depodan paket kurmak
için. Bunun üzerinde sonra konuşuruz tekrar. Ama şu anki hali ile çalışıyor. baris@kompiter ~/svn/internal/trunk/pisi $ ./pisi-cli list-repo baris@kompiter ~/svn/internal/trunk/pisi $ ./pisi-cli add-repo cekirdek http://cekirdek.uludag.org.tr/pisi/pisi-index.xml baris@kompiter ~/svn/internal/trunk/pisi $ ./pisi-cli list-repo cekirdek http://cekirdek.uludag.org.tr/pisi/pisi-index.xml baris@kompiter ~/svn/internal/trunk/pisi $ ./pisi-cli update-repo cekirdek * Updating repository: cekirdek pisi-index.xml 100% 0.00 B/s * Package db updated. baris@kompiter ~/svn/internal/trunk/pisi $ ./pisi-cli install net-tools ['net-tools'] Name: net-tools Summary: Standard Linux networking tools Description: Standard Linux networking tools digraph G { net-tools[ net-tools(1.60,1) ]; } ['net-tools'] Package URI: http://cekirdek.uludag.org.tr/pisi/net-tools-1.60-1.pisi net-tools-1.60-1.pisi 100% 26.43 KB/s Extracting files Storing files.xml Storing metadata.xml Storing comar/interface.py Registering COMAR script interface.py baris@kompiter ~/svn/internal/trunk/pisi $
This commit is contained in:
+5
-3
@@ -58,7 +58,7 @@ class Index(XmlFile):
|
||||
for fn in files:
|
||||
if fn.endswith(const.package_prefix):
|
||||
ui.info('Adding ' + fn + ' to package index\n')
|
||||
self.add_package(os.path.join(root, fn))
|
||||
self.add_package(os.path.join(root, fn), repo_uri)
|
||||
|
||||
def update_db(self, repo):
|
||||
pkgdb = packagedb.get_db(repo)
|
||||
@@ -66,7 +66,7 @@ class Index(XmlFile):
|
||||
for pkg in self.packages:
|
||||
pkgdb.add_package(pkg)
|
||||
|
||||
def add_package(self, path):
|
||||
def add_package(self, path, repo_uri):
|
||||
package = Package(path, 'r')
|
||||
# extract control files
|
||||
util.clean_dir(config.install_dir())
|
||||
@@ -75,7 +75,9 @@ class Index(XmlFile):
|
||||
md = metadata.MetaData()
|
||||
md.read(os.path.join(config.install_dir(), const.metadata_xml))
|
||||
# TODO: in the future we'll do all of this with purl/pfile/&helpers
|
||||
md.package.packageURI = path
|
||||
# After that, we'll remove the ugly repo_uri parameter from this
|
||||
# function.
|
||||
md.package.packageURI = util.removepathprefix(repo_uri, path)
|
||||
# check package semantics
|
||||
if md.verify():
|
||||
self.packages.append(md.package)
|
||||
|
||||
+15
-3
@@ -57,10 +57,22 @@ def install_single_name(name):
|
||||
# find package in repository
|
||||
repo = packagedb.which_repo(name)
|
||||
if repo:
|
||||
# TODO: Allright this is ugly, but works. Eventually, we'll
|
||||
# change this...
|
||||
from repodb import repodb
|
||||
repo = repodb.get_repo(repo)
|
||||
pkg = packagedb.get_package(name)
|
||||
ui.info("Installing %s from repository %s\n" %(name, repo))
|
||||
ui.debug("Package URI: %s\n" % pkg.packageURI)
|
||||
install_single_file(pkg.packageURI)
|
||||
|
||||
if repo.indexuri.isLocalFile():
|
||||
pkg_path = pkg.packageURI
|
||||
else:
|
||||
pkg_path = os.path.join(os.path.dirname(repo.indexuri.getUri()),
|
||||
pkg.packageURI)
|
||||
|
||||
ui.debug("Package URI: %s\n" % pkg_path)
|
||||
|
||||
# Package will handle remote file for us!
|
||||
install_single_file(pkg_path)
|
||||
else:
|
||||
ui.error("Package %s not found in the repository file.\n" % pkg)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user