cli install, operations'ı kullansın. kendi kendine iş yapmaya kalkmasın.
This commit is contained in:
+5
-11
@@ -113,16 +113,9 @@ class Install(Command):
|
|||||||
self.help()
|
self.help()
|
||||||
return
|
return
|
||||||
|
|
||||||
from pisi.install import Installer
|
from pisi.operations import install
|
||||||
for arg in self.args:
|
for arg in self.args:
|
||||||
url = PUrl(arg)
|
install(arg)
|
||||||
if url.isRemoteFile():
|
|
||||||
pass # bunu simdilik bosverelim, once bir calissin :)
|
|
||||||
|
|
||||||
pi = Installer(url.uri)
|
|
||||||
pi.install()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Remove(Command):
|
class Remove(Command):
|
||||||
"""remove: remove PISI packages"""
|
"""remove: remove PISI packages"""
|
||||||
@@ -138,8 +131,8 @@ class Remove(Command):
|
|||||||
self.help()
|
self.help()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
from pisi.operations import remove
|
||||||
for arg in self.args:
|
for arg in self.args:
|
||||||
from pisi.operations import remove
|
|
||||||
remove(arg)
|
remove(arg)
|
||||||
|
|
||||||
class Info(Command):
|
class Info(Command):
|
||||||
@@ -158,8 +151,9 @@ class Info(Command):
|
|||||||
|
|
||||||
def printinfo(self, arg):
|
def printinfo(self, arg):
|
||||||
import os.path
|
import os.path
|
||||||
|
from pisi.operations import info
|
||||||
|
|
||||||
if os.path.exists(arg):
|
if os.path.exists(arg):
|
||||||
from pisi.operations import info
|
|
||||||
metadata, files = info(arg)
|
metadata, files = info(arg)
|
||||||
print metadata.package
|
print metadata.package
|
||||||
|
|
||||||
|
|||||||
+11
-5
@@ -6,7 +6,7 @@ from ui import ui
|
|||||||
from package import Package
|
from package import Package
|
||||||
from installdb import installdb
|
from installdb import installdb
|
||||||
from packagedb import packagedb
|
from packagedb import packagedb
|
||||||
from os.path import join
|
from purl import PUrl
|
||||||
|
|
||||||
# all package operation interfaces are here
|
# all package operation interfaces are here
|
||||||
|
|
||||||
@@ -17,14 +17,20 @@ def remove(package_name):
|
|||||||
raise Exception('Trying to remove nonexistent package '
|
raise Exception('Trying to remove nonexistent package '
|
||||||
+ package_name)
|
+ package_name)
|
||||||
for fileinfo in installdb.files(package_name).list:
|
for fileinfo in installdb.files(package_name).list:
|
||||||
os.unlink( join(config.destdir, fileinfo.path) )
|
os.unlink( os.path.join(config.destdir, fileinfo.path) )
|
||||||
installdb.remove(package_name)
|
installdb.remove(package_name)
|
||||||
|
|
||||||
|
|
||||||
from install import Installer
|
def install(pkg_location):
|
||||||
|
from install import Installer
|
||||||
|
|
||||||
|
url = PUrl(pkg_location)
|
||||||
|
if url.isRemoteFile():
|
||||||
|
pass # bunu simdilik bosverelim, once bir calissin :)
|
||||||
|
|
||||||
|
i = Installer(url.uri)
|
||||||
|
i.install()
|
||||||
|
|
||||||
def install(package_name):
|
|
||||||
i = Installer(package_name), i.install()
|
|
||||||
|
|
||||||
def info(package_name):
|
def info(package_name):
|
||||||
package = Package(package_name)
|
package = Package(package_name)
|
||||||
|
|||||||
Reference in New Issue
Block a user