From cc27c111f1515d066d75b6549e827926d37e55dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Tue, 19 Jul 2005 14:23:49 +0000 Subject: [PATCH] =?UTF-8?q?paket=20depolar=C4=B1=20i=C3=A7in=20bir=20yap?= =?UTF-8?q?=C4=B1land=C4=B1rma=20se=C3=A7ene=C4=9Fi=20ekle.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pisi/configfile.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/pisi/configfile.py b/pisi/configfile.py index 2966eef0..690d25ee 100644 --- a/pisi/configfile.py +++ b/pisi/configfile.py @@ -10,6 +10,9 @@ #[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 @@ -35,6 +38,10 @@ 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" @@ -49,12 +56,6 @@ class DirsDefaults: packages_dir = "/var/cache/pisi/packages" tmp_dir = "/var/tmp/pisi" -# bu bilgiyi burada tutmak mantıklı değil. bunun yerine kullanıcının -# kendi ev dizininde ayrı bir dosyada tutmak gerekiyor. Şimdilik bunu -# desteklemeyelim. Sonra hallederiz... -# class SvnDefaults: -# """Default values for [svn] section """ -# username = password = None class ConfigurationSection(object): """ConfigurationSection class defines a section in the configuration @@ -64,6 +65,8 @@ class ConfigurationSection(object): if section == "general": self.defaults = GeneralDefaults + elif section == "repos": + self.defaults = ReposDefaults elif section == "build": self.defaults = BuildDefaults elif section == "directories": @@ -99,6 +102,12 @@ class ConfigurationFile(object): generalitems = [] self.general = ConfigurationSection("general", generalitems) + try: + repositems = parser.items("repos") + except NoSectionError: + repositems = [] + self.repos = ConfigurationSection("repos", generalitems) + try: builditems = parser.items("build") except NoSectionError: