* bir takim ui kullanimlarini duzelt
* build alt komutlari optionlari build'den miras alir * test scriptlerini biraz duzelt
This commit is contained in:
+1
-1
@@ -326,7 +326,7 @@ def list_upgradable():
|
|||||||
pass
|
pass
|
||||||
#ctx.ui.info('Package %s cannot be upgraded. ' % x)
|
#ctx.ui.info('Package %s cannot be upgraded. ' % x)
|
||||||
return Ap
|
return Ap
|
||||||
|
|
||||||
def remove(A):
|
def remove(A):
|
||||||
"""remove set A of packages from system (A is a list of package names)"""
|
"""remove set A of packages from system (A is a list of package names)"""
|
||||||
|
|
||||||
|
|||||||
@@ -734,7 +734,7 @@ FIXME: this is bogus
|
|||||||
|
|
||||||
# Partial build commands
|
# Partial build commands
|
||||||
|
|
||||||
class BuildUntil(Command):
|
class BuildUntil(Build):
|
||||||
"""Run the build process partially
|
"""Run the build process partially
|
||||||
|
|
||||||
Usage: -sStateName build-until <pspec file>
|
Usage: -sStateName build-until <pspec file>
|
||||||
@@ -754,6 +754,7 @@ for you.
|
|||||||
name = ("build-until", "bu")
|
name = ("build-until", "bu")
|
||||||
|
|
||||||
def options(self):
|
def options(self):
|
||||||
|
super(BuildUntil, self).options()
|
||||||
self.parser.add_option("-s", action="store", dest="state")
|
self.parser.add_option("-s", action="store", dest="state")
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
@@ -770,7 +771,7 @@ for you.
|
|||||||
self.finalize()
|
self.finalize()
|
||||||
|
|
||||||
|
|
||||||
class BuildUnpack(Command):
|
class BuildUnpack(Build):
|
||||||
"""Unpack the source archive
|
"""Unpack the source archive
|
||||||
|
|
||||||
Usage: build-unpack <pspec file>
|
Usage: build-unpack <pspec file>
|
||||||
@@ -795,7 +796,7 @@ TODO: desc.
|
|||||||
self.finalize()
|
self.finalize()
|
||||||
|
|
||||||
|
|
||||||
class BuildSetup(Command):
|
class BuildSetup(Build):
|
||||||
"""Setup the source
|
"""Setup the source
|
||||||
|
|
||||||
Usage: build-setup <pspec file>
|
Usage: build-setup <pspec file>
|
||||||
@@ -846,7 +847,7 @@ TODO: desc.
|
|||||||
self.finalize()
|
self.finalize()
|
||||||
|
|
||||||
|
|
||||||
class BuildInstall(Command):
|
class BuildInstall(Build):
|
||||||
"""Install to the sandbox
|
"""Install to the sandbox
|
||||||
|
|
||||||
Usage: build-install <pspec file>
|
Usage: build-install <pspec file>
|
||||||
@@ -872,7 +873,7 @@ TODO: desc.
|
|||||||
self.finalize()
|
self.finalize()
|
||||||
|
|
||||||
|
|
||||||
class BuildPackage(Command):
|
class BuildPackage(Build):
|
||||||
"""Setup the source
|
"""Setup the source
|
||||||
|
|
||||||
Usage: build-build <pspec file>
|
Usage: build-build <pspec file>
|
||||||
|
|||||||
+3
-3
@@ -111,7 +111,7 @@ dependency spec"""
|
|||||||
def satisfies_dependencies(pkg, deps, sat = installed_satisfies_dep):
|
def satisfies_dependencies(pkg, deps, sat = installed_satisfies_dep):
|
||||||
for dep in deps:
|
for dep in deps:
|
||||||
if not sat(dep):
|
if not sat(dep):
|
||||||
ui.error('Package %s does not satisfy dependency %s\n' %
|
ctx.ui.error('Package %s does not satisfy dependency %s\n' %
|
||||||
(pkg,dep))
|
(pkg,dep))
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
@@ -124,11 +124,11 @@ def installable(pkg):
|
|||||||
"""calculate if pkg is installable currently
|
"""calculate if pkg is installable currently
|
||||||
which means it has to satisfy both install and runtime dependencies"""
|
which means it has to satisfy both install and runtime dependencies"""
|
||||||
if not packagedb.has_package(pkg):
|
if not packagedb.has_package(pkg):
|
||||||
ui.info("Package " + pkg + " is not present in the package database\n");
|
ctx.ui.info("Package " + pkg + " is not present in the package database\n");
|
||||||
return False
|
return False
|
||||||
elif satisfies_runtime_deps(pkg):
|
elif satisfies_runtime_deps(pkg):
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
#ui.info("package " + pkg + " does not satisfy dependencies\n");
|
#ctx.ui.info("package " + pkg + " does not satisfy dependencies\n");
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -37,9 +37,8 @@ class Package:
|
|||||||
|
|
||||||
if url.is_remote_file():
|
if url.is_remote_file():
|
||||||
from fetcher import fetch_url
|
from fetcher import fetch_url
|
||||||
from ui import ui
|
|
||||||
dest = ctx.config.packages_dir()
|
dest = ctx.config.packages_dir()
|
||||||
fetch_url(url, dest, ui.Progress)
|
fetch_url(url, dest, ctx.ui.Progress)
|
||||||
self.filepath = join(dest, url.filename())
|
self.filepath = join(dest, url.filename())
|
||||||
|
|
||||||
self.impl = archive.ArchiveZip(self.filepath, 'zip', mode)
|
self.impl = archive.ArchiveZip(self.filepath, 'zip', mode)
|
||||||
|
|||||||
@@ -75,6 +75,8 @@ class PackageDB(object):
|
|||||||
list.append(pkg)
|
list.append(pkg)
|
||||||
return list
|
return list
|
||||||
|
|
||||||
|
#TODO: list_upgrades?
|
||||||
|
|
||||||
def add_package(self, package_info):
|
def add_package(self, package_info):
|
||||||
name = str(package_info.name)
|
name = str(package_info.name)
|
||||||
self.d[name] = package_info
|
self.d[name] = package_info
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
from os.path import basename, dirname, join
|
from os.path import basename, dirname, join
|
||||||
|
|
||||||
import pisi.context as ctx
|
import pisi.context as ctx
|
||||||
from pisi.ui import ui
|
|
||||||
from pisi.uri import URI
|
from pisi.uri import URI
|
||||||
from pisi.specfile import SpecFile
|
from pisi.specfile import SpecFile
|
||||||
|
|
||||||
@@ -75,7 +74,7 @@ class SourceFetcher(object):
|
|||||||
def fetch(self, appendDest=""):
|
def fetch(self, appendDest=""):
|
||||||
from fetcher import fetch_url
|
from fetcher import fetch_url
|
||||||
|
|
||||||
ui.info("Fetching %s\n" % self.url.uri)
|
ctx.ui.info("Fetching %s\n" % self.url.uri)
|
||||||
dest = join(self.dest, appendDest)
|
dest = join(self.dest, appendDest)
|
||||||
fetch_url(self.url, dest)
|
fetch_url(self.url, dest)
|
||||||
|
|
||||||
|
|||||||
+11
-11
@@ -1,21 +1,21 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
set -x # xtrace
|
|
||||||
set -e # errexit
|
|
||||||
|
|
||||||
echo "beta functionality test script"
|
echo "beta functionality test script"
|
||||||
echo "working directory:" `pwd`
|
echo "working directory:" `pwd`
|
||||||
echo "cleaning destination dir: tmp"
|
echo "cleaning destination dir: tmp"
|
||||||
|
PATH=$PATH:.
|
||||||
|
set -x # xtrace
|
||||||
|
set -e # errexit
|
||||||
rm -rf tmp
|
rm -rf tmp
|
||||||
#echo "*** build tests"
|
#echo "*** build tests"
|
||||||
pisi-cli build https://svn.uludag.org.tr/pisi/trunk/system/base/zip/pspec.xml \
|
pisi-cli build https://svn.uludag.org.tr/pisi/trunk/system/base/zip/pspec.xml \
|
||||||
https://svn.uludag.org.tr/pisi/trunk/system/base/unzip/pspec.xml
|
https://svn.uludag.org.tr/pisi/trunk/system/base/unzip/pspec.xml
|
||||||
|
|
||||||
#partial-builds
|
#partial-builds
|
||||||
pisi-cli build-dosetup https://svn.uludag.org.tr/pisi/trunk/system/base/hdparm/pspec.xml
|
pisi-cli build-setup https://svn.uludag.org.tr/pisi/trunk/system/base/hdparm/pspec.xml
|
||||||
pisi-cli build-dobuild https://svn.uludag.org.tr/pisi/trunk/system/base/hdparm/pspec.xml
|
pisi-cli build-build https://svn.uludag.org.tr/pisi/trunk/system/base/hdparm/pspec.xml
|
||||||
pisi-cli build-doinstall https://svn.uludag.org.tr/pisi/trunk/system/base/hdparm/pspec.xml
|
pisi-cli build-install https://svn.uludag.org.tr/pisi/trunk/system/base/hdparm/pspec.xml
|
||||||
pisi-cli build-dopackage https://svn.uludag.org.tr/pisi/trunk/system/base/hdparm/pspec.xml
|
pisi-cli build-package https://svn.uludag.org.tr/pisi/trunk/system/base/hdparm/pspec.xml
|
||||||
|
|
||||||
#echo "*** repository tests"
|
#echo "*** repository tests"
|
||||||
|
|
||||||
@@ -30,11 +30,11 @@ pisi-cli build https://svn.uludag.org.tr/pisi/trunk/system/base/grep/pspec.xml \
|
|||||||
#echo "*** package ops"
|
#echo "*** package ops"
|
||||||
pisi-cli info *.pisi
|
pisi-cli info *.pisi
|
||||||
# pisi-cli list-available
|
# pisi-cli list-available
|
||||||
pisi-cli install zip
|
pisi-cli install --ignore-comar zip
|
||||||
pisi-cli list-installed
|
pisi-cli list-installed
|
||||||
pisi-cli remove unzip
|
pisi-cli remove --ignore-comar unzip
|
||||||
pisi-cli install zip*.pisi
|
pisi-cli install --ignore-comar zip*.pisi
|
||||||
pisi-cli install hdparm*.pisi flex*.pisi grep*.pisi
|
pisi-cli install --ignore-comar hdparm*.pisi flex*.pisi grep*.pisi
|
||||||
pisi-cli remove-repo repo1
|
pisi-cli remove-repo repo1
|
||||||
# pisi-cli list-available
|
# pisi-cli list-available
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ class XmlFileTestCase(unittest.TestCase):
|
|||||||
a_href = [types.StringType, xmlfile.mandatory]
|
a_href = [types.StringType, xmlfile.mandatory]
|
||||||
#t_Projects = [ [types.StringType], xmlfile.mandatory]
|
#t_Projects = [ [types.StringType], xmlfile.mandatory]
|
||||||
a = A()
|
a = A()
|
||||||
print a
|
|
||||||
self.assertEqual(a.href, None)
|
self.assertEqual(a.href, None)
|
||||||
dom = mdom.parse('tests/sandbox/a.xml')
|
dom = mdom.parse('tests/sandbox/a.xml')
|
||||||
node = getNode(dom, 'A')
|
node = getNode(dom, 'A')
|
||||||
|
|||||||
Reference in New Issue
Block a user