configfile içerisinden repo ile ilgili bölümler çıkartıldı. Repo
yönetimi artık bir veritabanı ile yapılıyor. util içerisinden artık kullanılmayan repo_index fonksiyonu çıkartıldı cli/commands içerisindeki list-available çalışmıyor. Uygun bir yöntem ile çalışır hale getirmek gerekli.
This commit is contained in:
+21
-15
@@ -260,24 +260,30 @@ class ListRepo(Command):
|
||||
print repo
|
||||
print ' ', repodb.get_repo(repo).indexuri.getUri()
|
||||
|
||||
class ListAvailable(Command):
|
||||
"list-available: list the available packages in the repository"
|
||||
def __init__(self):
|
||||
super(ListAvailable, self).__init__()
|
||||
# FIXME: Bu fonksiyonun başka bir şekilde implement edilmesi
|
||||
# gerekiyor. Şu anda zaten çalışmıyor.
|
||||
#
|
||||
# Uyarı: Eğer yaptığınız bir değişiklik bir fonksiyonu geçersiz
|
||||
# kılıyorsa, lütfen fonksiyonu comment-out edin. Ve nedenlerini yazın.
|
||||
#
|
||||
# class ListAvailable(Command):
|
||||
# "list-available: list the available packages in the repository"
|
||||
# def __init__(self):
|
||||
# super(ListAvailable, self).__init__()
|
||||
|
||||
def run(self):
|
||||
self.init_db()
|
||||
from pisi import util
|
||||
# FIXME: bu asagidaki code bayagi anlamsiz
|
||||
# neden bir packagedb'miz var?
|
||||
(repo, index) = util.repo_index()
|
||||
# def run(self):
|
||||
# self.init_db()
|
||||
# from pisi import util
|
||||
# # FIXME: bu asagidaki code bayagi anlamsiz
|
||||
# # neden bir packagedb'miz var?
|
||||
# (repo, index) = util.repo_index()
|
||||
|
||||
for package in index.packages:
|
||||
name = package.name
|
||||
version = package.history[0].version
|
||||
release = package.history[0].release
|
||||
# for package in index.packages:
|
||||
# name = package.name
|
||||
# version = package.history[0].version
|
||||
# release = package.history[0].release
|
||||
|
||||
print util.package_name(name, version, release)
|
||||
# print util.package_name(name, version, release)
|
||||
|
||||
class SearchAvailable(Command):
|
||||
"search-available: search in available packages"
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
#[general]
|
||||
#destinationdirectory = /tmp
|
||||
#
|
||||
#[repos]
|
||||
#default = http://cekirdek.uludag.org.tr/pisi/
|
||||
#
|
||||
#[build]
|
||||
#host = i686-pc-linux-gnu
|
||||
#CFLAGS= -mcpu=i686 -O2 -pipe -fomit-frame-pointer
|
||||
@@ -40,10 +37,6 @@ class GeneralDefaults:
|
||||
distribution = "Pardus"
|
||||
distribution_release = "0.1"
|
||||
|
||||
class ReposDefaults:
|
||||
# No default repository in the code!
|
||||
pass
|
||||
|
||||
class BuildDefaults:
|
||||
"""Default values for [build] section"""
|
||||
host = "i686-pc-linux-gnu"
|
||||
@@ -69,8 +62,6 @@ class ConfigurationSection(object):
|
||||
|
||||
if section == "general":
|
||||
self.defaults = GeneralDefaults
|
||||
elif section == "repos":
|
||||
self.defaults = ReposDefaults
|
||||
elif section == "build":
|
||||
self.defaults = BuildDefaults
|
||||
elif section == "directories":
|
||||
@@ -116,12 +107,6 @@ class ConfigurationFile(object):
|
||||
generalitems = []
|
||||
self.general = ConfigurationSection("general", generalitems)
|
||||
|
||||
try:
|
||||
repositems = parser.items("repos")
|
||||
except NoSectionError:
|
||||
repositems = []
|
||||
self.repos = ConfigurationSection("repos", repositems)
|
||||
|
||||
try:
|
||||
builditems = parser.items("build")
|
||||
except NoSectionError:
|
||||
|
||||
@@ -255,14 +255,3 @@ def partition_freespace(directory):
|
||||
def package_name(name, version, release):
|
||||
return name + '-' + version + '-' + release + const.package_prefix
|
||||
|
||||
def repo_index(reponame = "default"):
|
||||
"return a par (url, IndexObj) for the given repository"
|
||||
from index import Index
|
||||
|
||||
repourl = config.values.repos[reponame]
|
||||
|
||||
index = Index()
|
||||
indexpath = os.path.join(config.index_dir(),
|
||||
reponame, const.pisi_index)
|
||||
index.read(indexpath)
|
||||
return (repourl, index)
|
||||
|
||||
Reference in New Issue
Block a user