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 repo
|
||||||
print ' ', repodb.get_repo(repo).indexuri.getUri()
|
print ' ', repodb.get_repo(repo).indexuri.getUri()
|
||||||
|
|
||||||
class ListAvailable(Command):
|
# FIXME: Bu fonksiyonun başka bir şekilde implement edilmesi
|
||||||
"list-available: list the available packages in the repository"
|
# gerekiyor. Şu anda zaten çalışmıyor.
|
||||||
def __init__(self):
|
#
|
||||||
super(ListAvailable, self).__init__()
|
# 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):
|
# def run(self):
|
||||||
self.init_db()
|
# self.init_db()
|
||||||
from pisi import util
|
# from pisi import util
|
||||||
# FIXME: bu asagidaki code bayagi anlamsiz
|
# # FIXME: bu asagidaki code bayagi anlamsiz
|
||||||
# neden bir packagedb'miz var?
|
# # neden bir packagedb'miz var?
|
||||||
(repo, index) = util.repo_index()
|
# (repo, index) = util.repo_index()
|
||||||
|
|
||||||
for package in index.packages:
|
# for package in index.packages:
|
||||||
name = package.name
|
# name = package.name
|
||||||
version = package.history[0].version
|
# version = package.history[0].version
|
||||||
release = package.history[0].release
|
# release = package.history[0].release
|
||||||
|
|
||||||
print util.package_name(name, version, release)
|
# print util.package_name(name, version, release)
|
||||||
|
|
||||||
class SearchAvailable(Command):
|
class SearchAvailable(Command):
|
||||||
"search-available: search in available packages"
|
"search-available: search in available packages"
|
||||||
|
|||||||
@@ -10,9 +10,6 @@
|
|||||||
#[general]
|
#[general]
|
||||||
#destinationdirectory = /tmp
|
#destinationdirectory = /tmp
|
||||||
#
|
#
|
||||||
#[repos]
|
|
||||||
#default = http://cekirdek.uludag.org.tr/pisi/
|
|
||||||
#
|
|
||||||
#[build]
|
#[build]
|
||||||
#host = i686-pc-linux-gnu
|
#host = i686-pc-linux-gnu
|
||||||
#CFLAGS= -mcpu=i686 -O2 -pipe -fomit-frame-pointer
|
#CFLAGS= -mcpu=i686 -O2 -pipe -fomit-frame-pointer
|
||||||
@@ -40,10 +37,6 @@ class GeneralDefaults:
|
|||||||
distribution = "Pardus"
|
distribution = "Pardus"
|
||||||
distribution_release = "0.1"
|
distribution_release = "0.1"
|
||||||
|
|
||||||
class ReposDefaults:
|
|
||||||
# No default repository in the code!
|
|
||||||
pass
|
|
||||||
|
|
||||||
class BuildDefaults:
|
class BuildDefaults:
|
||||||
"""Default values for [build] section"""
|
"""Default values for [build] section"""
|
||||||
host = "i686-pc-linux-gnu"
|
host = "i686-pc-linux-gnu"
|
||||||
@@ -69,8 +62,6 @@ class ConfigurationSection(object):
|
|||||||
|
|
||||||
if section == "general":
|
if section == "general":
|
||||||
self.defaults = GeneralDefaults
|
self.defaults = GeneralDefaults
|
||||||
elif section == "repos":
|
|
||||||
self.defaults = ReposDefaults
|
|
||||||
elif section == "build":
|
elif section == "build":
|
||||||
self.defaults = BuildDefaults
|
self.defaults = BuildDefaults
|
||||||
elif section == "directories":
|
elif section == "directories":
|
||||||
@@ -116,12 +107,6 @@ class ConfigurationFile(object):
|
|||||||
generalitems = []
|
generalitems = []
|
||||||
self.general = ConfigurationSection("general", generalitems)
|
self.general = ConfigurationSection("general", generalitems)
|
||||||
|
|
||||||
try:
|
|
||||||
repositems = parser.items("repos")
|
|
||||||
except NoSectionError:
|
|
||||||
repositems = []
|
|
||||||
self.repos = ConfigurationSection("repos", repositems)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
builditems = parser.items("build")
|
builditems = parser.items("build")
|
||||||
except NoSectionError:
|
except NoSectionError:
|
||||||
|
|||||||
@@ -255,14 +255,3 @@ def partition_freespace(directory):
|
|||||||
def package_name(name, version, release):
|
def package_name(name, version, release):
|
||||||
return name + '-' + version + '-' + release + const.package_prefix
|
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