* use a testcase class for proper API init/shutdown, if that doesn't
work, nothing will anyway :) - this new class uses the tmp dir * make the test cases that access pisi dirs, etc. derive from the new testcase class * a silly Option class in config module for those who want to give options from API. We should have default values there, too (it seems!) * several fixes in tests, remove old style config accesses etc.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE Project SYSTEM "Project-3.8.dtd">
|
<!DOCTYPE Project SYSTEM "Project-3.8.dtd">
|
||||||
<!-- Project file for project pisi -->
|
<!-- Project file for project pisi -->
|
||||||
<!-- Saved: 2005-10-26, 20:31:35 -->
|
<!-- Saved: 2005-10-27, 02:03:24 -->
|
||||||
<!-- Copyright (C) 2005 PiSi Development Team, -->
|
<!-- Copyright (C) 2005 PiSi Development Team, -->
|
||||||
<Project version="3.8">
|
<Project version="3.8">
|
||||||
<ProgLanguage mixed="0">Python</ProgLanguage>
|
<ProgLanguage mixed="0">Python</ProgLanguage>
|
||||||
@@ -364,6 +364,14 @@
|
|||||||
<Dir>tests</Dir>
|
<Dir>tests</Dir>
|
||||||
<Name>specfilenewtests.py</Name>
|
<Name>specfilenewtests.py</Name>
|
||||||
</Source>
|
</Source>
|
||||||
|
<Source>
|
||||||
|
<Dir>tests</Dir>
|
||||||
|
<Name>ootests.py</Name>
|
||||||
|
</Source>
|
||||||
|
<Source>
|
||||||
|
<Dir>tests</Dir>
|
||||||
|
<Name>testcase.py</Name>
|
||||||
|
</Source>
|
||||||
</Sources>
|
</Sources>
|
||||||
<Forms>
|
<Forms>
|
||||||
</Forms>
|
</Forms>
|
||||||
@@ -402,9 +410,9 @@
|
|||||||
</Vcs>
|
</Vcs>
|
||||||
<FiletypeAssociations>
|
<FiletypeAssociations>
|
||||||
<FiletypeAssociation pattern="*.ui.h" type="FORMS" />
|
<FiletypeAssociation pattern="*.ui.h" type="FORMS" />
|
||||||
<FiletypeAssociation pattern="*.ui" type="FORMS" />
|
|
||||||
<FiletypeAssociation pattern="*.idl" type="INTERFACES" />
|
|
||||||
<FiletypeAssociation pattern="*.py" type="SOURCES" />
|
|
||||||
<FiletypeAssociation pattern="*.ptl" type="SOURCES" />
|
<FiletypeAssociation pattern="*.ptl" type="SOURCES" />
|
||||||
|
<FiletypeAssociation pattern="*.idl" type="INTERFACES" />
|
||||||
|
<FiletypeAssociation pattern="*.ui" type="FORMS" />
|
||||||
|
<FiletypeAssociation pattern="*.py" type="SOURCES" />
|
||||||
</FiletypeAssociations>
|
</FiletypeAssociations>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
+10
-2
@@ -30,10 +30,17 @@ from pisi.util import join_path as join
|
|||||||
class Error(pisi.Error):
|
class Error(pisi.Error):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
class Options(object):
|
||||||
|
def __getattr__(self, name):
|
||||||
|
if not self.__dict__.has_key(name):
|
||||||
|
return None
|
||||||
|
else:
|
||||||
|
return self.__dict__[name]
|
||||||
|
|
||||||
class Config(object):
|
class Config(object):
|
||||||
"""Config Singleton"""
|
"""Config Singleton"""
|
||||||
|
|
||||||
def __init__(self, options = None):
|
def __init__(self, options = Options()):
|
||||||
self.options = options
|
self.options = options
|
||||||
self.values = ConfigurationFile("/etc/pisi/pisi.conf")
|
self.values = ConfigurationFile("/etc/pisi/pisi.conf")
|
||||||
|
|
||||||
@@ -56,7 +63,8 @@ class Config(object):
|
|||||||
dir = self.values.general.destinationdirectory
|
dir = self.values.general.destinationdirectory
|
||||||
import os.path
|
import os.path
|
||||||
if not os.path.exists(dir):
|
if not os.path.exists(dir):
|
||||||
raise Error, _('Destination directory %s does not exist') % dir
|
ctx.ui.warning( _('Destination directory %s does not exist. Creating it.') % dir)
|
||||||
|
os.makedirs(dir)
|
||||||
return dir
|
return dir
|
||||||
|
|
||||||
def subdir(self, path):
|
def subdir(self, path):
|
||||||
|
|||||||
@@ -10,8 +10,11 @@
|
|||||||
import unittest
|
import unittest
|
||||||
import zipfile
|
import zipfile
|
||||||
|
|
||||||
class ActionsAPITestCase(unittest.TestCase):
|
import testcase
|
||||||
|
|
||||||
|
class ActionsAPITestCase(testcase.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
testcase.TestCase.setUp(self)
|
||||||
self.f = zipfile.ZipFile("helloworld-0.1-1.pisi", "r")
|
self.f = zipfile.ZipFile("helloworld-0.1-1.pisi", "r")
|
||||||
self.filelist = []
|
self.filelist = []
|
||||||
|
|
||||||
|
|||||||
+3
-12
@@ -20,12 +20,11 @@ from pisi import sourcearchive
|
|||||||
from pisi import fetcher
|
from pisi import fetcher
|
||||||
from pisi import util
|
from pisi import util
|
||||||
from pisi.build import BuildContext
|
from pisi.build import BuildContext
|
||||||
from pisi.config import config
|
|
||||||
from pisi import uri
|
from pisi import uri
|
||||||
|
|
||||||
class ArchiveFileTestCase(unittest.TestCase):
|
import testcase
|
||||||
def setUp(self):
|
|
||||||
pisi.api.init(comar = False)
|
class ArchiveFileTestCase(testcase.TestCase):
|
||||||
|
|
||||||
def testUnpackTar(self):
|
def testUnpackTar(self):
|
||||||
bctx = BuildContext("tests/popt/pspec.xml")
|
bctx = BuildContext("tests/popt/pspec.xml")
|
||||||
@@ -52,8 +51,6 @@ class ArchiveFileTestCase(unittest.TestCase):
|
|||||||
self.assertEqual(util.sha1_file(testfile),
|
self.assertEqual(util.sha1_file(testfile),
|
||||||
"5af9dd7d754f788cf511c57ce0af3d555fed009d")
|
"5af9dd7d754f788cf511c57ce0af3d555fed009d")
|
||||||
|
|
||||||
pisi.api.finalize()
|
|
||||||
|
|
||||||
def testUnpackZip(self):
|
def testUnpackZip(self):
|
||||||
bctx = BuildContext("tests/pccts/pspec.xml")
|
bctx = BuildContext("tests/pccts/pspec.xml")
|
||||||
|
|
||||||
@@ -73,8 +70,6 @@ class ArchiveFileTestCase(unittest.TestCase):
|
|||||||
self.assertEqual(util.sha1_file(testfile),
|
self.assertEqual(util.sha1_file(testfile),
|
||||||
"f2be0f9783e84e98fe4e2b8201a8f506fcc07a4d")
|
"f2be0f9783e84e98fe4e2b8201a8f506fcc07a4d")
|
||||||
|
|
||||||
pisi.api.finalize()
|
|
||||||
|
|
||||||
# TODO: no link file in pccts package. Need to find a ZIP file
|
# TODO: no link file in pccts package. Need to find a ZIP file
|
||||||
# containing a symlink
|
# containing a symlink
|
||||||
# check for symbolic links
|
# check for symbolic links
|
||||||
@@ -97,8 +92,6 @@ class ArchiveFileTestCase(unittest.TestCase):
|
|||||||
zip.close()
|
zip.close()
|
||||||
|
|
||||||
#TODO: do some more work to test the integrity of new zip file
|
#TODO: do some more work to test the integrity of new zip file
|
||||||
|
|
||||||
pisi.api.finalize()
|
|
||||||
|
|
||||||
def testUnpackZipCond(self):
|
def testUnpackZipCond(self):
|
||||||
bctx = BuildContext("tests/pccts/pspec.xml")
|
bctx = BuildContext("tests/pccts/pspec.xml")
|
||||||
@@ -118,6 +111,4 @@ class ArchiveFileTestCase(unittest.TestCase):
|
|||||||
testfile = targetDir + "/pccts/history.txt"
|
testfile = targetDir + "/pccts/history.txt"
|
||||||
assert pathexists(testfile)
|
assert pathexists(testfile)
|
||||||
|
|
||||||
pisi.api.finalize()
|
|
||||||
|
|
||||||
suite = unittest.makeSuite(ArchiveFileTestCase)
|
suite = unittest.makeSuite(ArchiveFileTestCase)
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import unittest
|
|||||||
|
|
||||||
from pisi.configfile import ConfigurationFile
|
from pisi.configfile import ConfigurationFile
|
||||||
|
|
||||||
|
# NB: no need for pisi testcase in these things that do well without pisi init
|
||||||
class ConfigFileTestCase(unittest.TestCase):
|
class ConfigFileTestCase(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
|||||||
@@ -18,9 +18,10 @@ from pisi import fetcher
|
|||||||
from pisi import util
|
from pisi import util
|
||||||
from pisi import uri
|
from pisi import uri
|
||||||
|
|
||||||
class FetcherTestCase(unittest.TestCase):
|
import testcase
|
||||||
|
class FetcherTestCase(testcase.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
pisi.api.init(database = False, comar = False)
|
testcase.TestCase.setUp(self, database = False)
|
||||||
|
|
||||||
self.spec = SpecFile()
|
self.spec = SpecFile()
|
||||||
self.spec.read("tests/popt/pspec.xml")
|
self.spec.read("tests/popt/pspec.xml")
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import unittest
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
from pisi import graph
|
from pisi import graph
|
||||||
from pisi.config import config
|
|
||||||
|
|
||||||
class GraphTestCase(unittest.TestCase):
|
class GraphTestCase(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
|||||||
@@ -16,21 +16,16 @@ import pisi.api
|
|||||||
import pisi.installdb
|
import pisi.installdb
|
||||||
from pisi import util
|
from pisi import util
|
||||||
|
|
||||||
class InstallDBTestCase(unittest.TestCase):
|
import testcase
|
||||||
|
class InstallDBTestCase(testcase.TestCase):
|
||||||
def setUp(self):
|
|
||||||
pisi.api.init(database = True, comar = False)
|
|
||||||
|
|
||||||
|
|
||||||
def testRemoveDummy(self):
|
def testRemoveDummy(self):
|
||||||
ctx.installdb.remove('installtest')
|
ctx.installdb.remove('installtest')
|
||||||
self.assert_(not ctx.installdb.is_installed('installtest'))
|
self.assert_(not ctx.installdb.is_installed('installtest'))
|
||||||
pisi.api.finalize()
|
|
||||||
|
|
||||||
def testInstall(self):
|
def testInstall(self):
|
||||||
ctx.installdb.purge('installtest')
|
ctx.installdb.purge('installtest')
|
||||||
ctx.installdb.install('installtest', '0.1', '2', '3')
|
ctx.installdb.install('installtest', '0.1', '2', '3')
|
||||||
pisi.api.finalize()
|
|
||||||
|
|
||||||
def testRemovePurge(self):
|
def testRemovePurge(self):
|
||||||
ctx.installdb.install('installtest', '0.1', '2', '3')
|
ctx.installdb.install('installtest', '0.1', '2', '3')
|
||||||
@@ -39,6 +34,5 @@ class InstallDBTestCase(unittest.TestCase):
|
|||||||
self.assert_(ctx.installdb.is_removed('installtest'))
|
self.assert_(ctx.installdb.is_removed('installtest'))
|
||||||
ctx.installdb.purge('installtest')
|
ctx.installdb.purge('installtest')
|
||||||
self.assert_(not ctx.installdb.is_recorded('installtest'))
|
self.assert_(not ctx.installdb.is_recorded('installtest'))
|
||||||
pisi.api.finalize()
|
|
||||||
|
|
||||||
suite = unittest.makeSuite(InstallDBTestCase)
|
suite = unittest.makeSuite(InstallDBTestCase)
|
||||||
|
|||||||
@@ -13,12 +13,11 @@ import os
|
|||||||
|
|
||||||
from pisi import metadata
|
from pisi import metadata
|
||||||
from pisi import util
|
from pisi import util
|
||||||
from pisi.config import config
|
import pisi.context as ctx
|
||||||
|
|
||||||
|
import testcase
|
||||||
|
class MetaDataTestCase(testcase.TestCase):
|
||||||
|
|
||||||
class MetaDataTestCase(unittest.TestCase):
|
|
||||||
def setUp(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def testRead(self):
|
def testRead(self):
|
||||||
md = metadata.MetaData()
|
md = metadata.MetaData()
|
||||||
md.read('tests/popt/metadata.xml')
|
md.read('tests/popt/metadata.xml')
|
||||||
@@ -32,7 +31,7 @@ class MetaDataTestCase(unittest.TestCase):
|
|||||||
|
|
||||||
def testWrite(self):
|
def testWrite(self):
|
||||||
md = self.testRead()
|
md = self.testRead()
|
||||||
md.write(os.path.join(config.tmp_dir(),'metadata-test.xml' ))
|
md.write(os.path.join(ctx.config.tmp_dir(),'metadata-test.xml' ))
|
||||||
|
|
||||||
def testVerify(self):
|
def testVerify(self):
|
||||||
md = self.testRead()
|
md = self.testRead()
|
||||||
|
|||||||
@@ -17,11 +17,11 @@ from pisi.packagedb import PackageDB
|
|||||||
from pisi import util
|
from pisi import util
|
||||||
from pisi.specfile import SpecFile
|
from pisi.specfile import SpecFile
|
||||||
|
|
||||||
class PackageDBTestCase(unittest.TestCase):
|
import testcase
|
||||||
|
class PackageDBTestCase(testcase.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
pisi.api.init(comar = False)
|
testcase.TestCase.setUp(self)
|
||||||
|
|
||||||
self.spec = SpecFile()
|
self.spec = SpecFile()
|
||||||
self.spec.read('tests/popt/pspec.xml')
|
self.spec.read('tests/popt/pspec.xml')
|
||||||
|
|
||||||
@@ -32,13 +32,10 @@ class PackageDBTestCase(unittest.TestCase):
|
|||||||
self.assert_(self.pdb.has_package('popt-libs'))
|
self.assert_(self.pdb.has_package('popt-libs'))
|
||||||
# close the database and remove lock
|
# close the database and remove lock
|
||||||
self.pdb.close()
|
self.pdb.close()
|
||||||
pisi.api.finalize()
|
|
||||||
|
|
||||||
def testRemove(self):
|
def testRemove(self):
|
||||||
self.pdb.remove_package('popt-libs')
|
self.pdb.remove_package('popt-libs')
|
||||||
self.assert_(not self.pdb.has_package('popt-libs'))
|
self.assert_(not self.pdb.has_package('popt-libs'))
|
||||||
self.pdb.close()
|
self.pdb.close()
|
||||||
pisi.api.finalize()
|
|
||||||
|
|
||||||
suite = unittest.makeSuite(PackageDBTestCase)
|
suite = unittest.makeSuite(PackageDBTestCase)
|
||||||
|
|
||||||
|
|||||||
@@ -12,20 +12,21 @@ import unittest
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
from pisi import util
|
from pisi import util
|
||||||
from pisi.config import config
|
import pisi.context as ctx
|
||||||
from pisi import package
|
from pisi import package
|
||||||
|
|
||||||
|
import testcase
|
||||||
class PackageTestCase(unittest.TestCase):
|
class PackageTestCase(testcase.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
testcase.TestCase.setUp(self)
|
||||||
self.pkgName = util.package_name("testing",
|
self.pkgName = util.package_name("testing",
|
||||||
"5.1",
|
"5.1",
|
||||||
"2")
|
"2")
|
||||||
|
|
||||||
def testAddExtract(self):
|
def testAddExtract(self):
|
||||||
cur = os.getcwd()
|
cur = os.getcwd()
|
||||||
tmpdir = config.tmp_dir()
|
tmpdir = ctx.config.tmp_dir()
|
||||||
testdir = os.path.join(cur, "tests/popt")
|
testdir = os.path.join(cur, "tests/popt")
|
||||||
|
|
||||||
pkg_path = os.path.join(tmpdir, self.pkgName)
|
pkg_path = os.path.join(tmpdir, self.pkgName)
|
||||||
|
|||||||
@@ -17,10 +17,11 @@ import pisi.sourcedb
|
|||||||
from pisi import util
|
from pisi import util
|
||||||
from pisi.specfile import SpecFile
|
from pisi.specfile import SpecFile
|
||||||
|
|
||||||
class SourceDBTestCase(unittest.TestCase):
|
import testcase
|
||||||
|
class SourceDBTestCase(testcase.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
pisi.api.init(comar = False)
|
testcase.TestCase.setUp(self)
|
||||||
|
|
||||||
self.sourcedb = pisi.sourcedb.init()
|
self.sourcedb = pisi.sourcedb.init()
|
||||||
self.spec = SpecFile()
|
self.spec = SpecFile()
|
||||||
|
|||||||
@@ -12,11 +12,15 @@ import unittest
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
import pisi.specfilenew as specfile
|
import pisi.specfilenew as specfile
|
||||||
from pisi.config import config
|
import pisi.context as ctx
|
||||||
import pisi.util as util
|
import pisi.util as util
|
||||||
|
|
||||||
class SpecFileNewTestCase(unittest.TestCase):
|
import testcase
|
||||||
|
|
||||||
|
class SpecFileNewTestCase(testcase.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
testcase.TestCase.setUp(self)
|
||||||
self.spec = specfile.SpecFile()
|
self.spec = specfile.SpecFile()
|
||||||
self.spec.read("tests/popt/pspec.xml")
|
self.spec.read("tests/popt/pspec.xml")
|
||||||
|
|
||||||
@@ -72,9 +76,8 @@ class SpecFileNewTestCase(unittest.TestCase):
|
|||||||
self.fail("Failed to verify specfile")
|
self.fail("Failed to verify specfile")
|
||||||
|
|
||||||
def testCopy(self):
|
def testCopy(self):
|
||||||
util.check_dir(config.tmp_dir())
|
util.check_dir(ctx.config.tmp_dir())
|
||||||
self.spec.read("tests/popt/pspec.xml")
|
self.spec.read("tests/popt/pspec.xml")
|
||||||
self.spec.write(os.path.join(config.tmp_dir(), 'popt-copy.pspec.xml'))
|
self.spec.write(os.path.join(config.tmp_dir(), 'popt-copy.pspec.xml'))
|
||||||
|
|
||||||
|
|
||||||
suite = unittest.makeSuite(SpecFileNewTestCase)
|
suite = unittest.makeSuite(SpecFileNewTestCase)
|
||||||
|
|||||||
@@ -12,11 +12,14 @@ import unittest
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
from pisi import specfile
|
from pisi import specfile
|
||||||
from pisi.config import config
|
import pisi.context as ctx
|
||||||
import pisi.util as util
|
import pisi.util as util
|
||||||
|
|
||||||
class SpecFileTestCase(unittest.TestCase):
|
import testcase
|
||||||
|
|
||||||
|
class SpecFileTestCase(testcase.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
testcase.TestCase.setUp(self)
|
||||||
self.spec = specfile.SpecFile()
|
self.spec = specfile.SpecFile()
|
||||||
self.spec.read("tests/popt/pspec.xml")
|
self.spec.read("tests/popt/pspec.xml")
|
||||||
|
|
||||||
@@ -72,9 +75,9 @@ class SpecFileTestCase(unittest.TestCase):
|
|||||||
self.fail("Failed to verify specfile")
|
self.fail("Failed to verify specfile")
|
||||||
|
|
||||||
def testCopy(self):
|
def testCopy(self):
|
||||||
util.check_dir(config.tmp_dir())
|
|
||||||
self.spec.read("tests/popt/pspec.xml")
|
self.spec.read("tests/popt/pspec.xml")
|
||||||
self.spec.write(os.path.join(config.tmp_dir(), 'popt-copy.pspec.xml'))
|
util.check_dir(ctx.config.tmp_dir())
|
||||||
|
self.spec.write(os.path.join(ctx.config.tmp_dir(), 'popt-copy.pspec.xml'))
|
||||||
|
|
||||||
|
|
||||||
suite = unittest.makeSuite(SpecFileTestCase)
|
suite = unittest.makeSuite(SpecFileTestCase)
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
# Copyright (C) 2005, TUBITAK/UEKAE
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU General Public License as published by the Free
|
||||||
|
# Software Foundation; either version 2 of the License, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# Please read the COPYING file.
|
||||||
|
#
|
||||||
|
|
||||||
|
import unittest
|
||||||
|
import os
|
||||||
|
|
||||||
|
import pisi
|
||||||
|
import pisi.api
|
||||||
|
import pisi.util
|
||||||
|
import pisi.config
|
||||||
|
|
||||||
|
class TestCase(unittest.TestCase):
|
||||||
|
|
||||||
|
def setUp(self, comar = False, database = True):
|
||||||
|
options = pisi.config.Options()
|
||||||
|
options.destdir = 'tmp'
|
||||||
|
pisi.api.init(options = options, comar = comar, database = database)
|
||||||
|
|
||||||
|
def tearDown(self, ):
|
||||||
|
pisi.api.finalize()
|
||||||
+1
-1
@@ -15,6 +15,7 @@ from pisi import version
|
|||||||
from pisi.util import *
|
from pisi.util import *
|
||||||
|
|
||||||
class UtilTestCase(unittest.TestCase):
|
class UtilTestCase(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -32,4 +33,3 @@ class UtilTestCase(unittest.TestCase):
|
|||||||
|
|
||||||
|
|
||||||
suite = unittest.makeSuite(UtilTestCase)
|
suite = unittest.makeSuite(UtilTestCase)
|
||||||
|
|
||||||
|
|||||||
@@ -17,14 +17,13 @@ import types
|
|||||||
import pisi
|
import pisi
|
||||||
import pisi.api
|
import pisi.api
|
||||||
from pisi import xmlfile
|
from pisi import xmlfile
|
||||||
from pisi.config import config
|
import pisi.context as ctx
|
||||||
import pisi.util as util
|
import pisi.util as util
|
||||||
from pisi.xmlext import *
|
from pisi.xmlext import *
|
||||||
|
|
||||||
class XmlFileTestCase(unittest.TestCase):
|
import testcase
|
||||||
|
|
||||||
def setUp(self):
|
class XmlFileTestCase(testcase.TestCase):
|
||||||
pisi.api.init(database = False, comar = False)
|
|
||||||
|
|
||||||
def testMetaClass(self):
|
def testMetaClass(self):
|
||||||
|
|
||||||
|
|||||||
+1
-3
@@ -17,8 +17,6 @@ sys.path.append('.')
|
|||||||
import pisi.uri
|
import pisi.uri
|
||||||
import pisi.specfile
|
import pisi.specfile
|
||||||
import pisi.util as util
|
import pisi.util as util
|
||||||
|
|
||||||
from pisi.config import config
|
|
||||||
from pisi.fetcher import fetch_url
|
from pisi.fetcher import fetch_url
|
||||||
|
|
||||||
def scanPSPEC(folder):
|
def scanPSPEC(folder):
|
||||||
@@ -50,7 +48,7 @@ if __name__ == "__main__":
|
|||||||
if not isCached(URI.filename(), spec.source.archiveSHA1):
|
if not isCached(URI.filename(), spec.source.archiveSHA1):
|
||||||
print URI, " -> " , os.path.join(config.archives_dir(), URI.filename())
|
print URI, " -> " , os.path.join(config.archives_dir(), URI.filename())
|
||||||
try:
|
try:
|
||||||
fetch_url(URI, config.archives_dir())
|
fetch_url(URI, config.archives_dir())
|
||||||
except pisi.fetcher.FetchError, e:
|
except pisi.fetcher.FetchError, e:
|
||||||
print e
|
print e
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user