* destdir() -> dest_dir()
* fix dest_dir: - default value of destdir option is None - set it correctly to the value read from configfile if None
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Project SYSTEM "Project-3.8.dtd">
|
||||
<!-- Project file for project pisi -->
|
||||
<!-- Saved: 2005-10-05, 12:46:47 -->
|
||||
<!-- Saved: 2005-10-09, 20:14:24 -->
|
||||
<!-- Copyright (C) 2005 PiSi Development Team, -->
|
||||
<Project version="3.8">
|
||||
<ProgLanguage mixed="0">Python</ProgLanguage>
|
||||
@@ -9,7 +9,7 @@
|
||||
<Description>The package management software of Pardus distribution.
|
||||
</Description>
|
||||
<Author>PiSi Development Team</Author>
|
||||
<Emaýl></Emaýl>
|
||||
<Email></Email>
|
||||
<Sources>
|
||||
<Source>
|
||||
<Dir>tools</Dir>
|
||||
@@ -344,6 +344,10 @@
|
||||
<Dir>po</Dir>
|
||||
<Name>tr.po</Name>
|
||||
</Source>
|
||||
<Source>
|
||||
<Dir>tools</Dir>
|
||||
<Name>ChangeLogGenerator.py</Name>
|
||||
</Source>
|
||||
</Sources>
|
||||
<Forms>
|
||||
</Forms>
|
||||
@@ -382,9 +386,9 @@
|
||||
</Vcs>
|
||||
<FiletypeAssociations>
|
||||
<FiletypeAssociation pattern="*.ui.h" type="FORMS" />
|
||||
<FiletypeAssociation pattern="*.ptl" type="SOURCES" />
|
||||
<FiletypeAssociation pattern="*.idl" type="INTERFACES" />
|
||||
<FiletypeAssociation pattern="*.ui" type="FORMS" />
|
||||
<FiletypeAssociation pattern="*.idl" type="INTERFACES" />
|
||||
<FiletypeAssociation pattern="*.ptl" type="SOURCES" />
|
||||
<FiletypeAssociation pattern="*.py" type="SOURCES" />
|
||||
</FiletypeAssociations>
|
||||
</Project>
|
||||
|
||||
+1
-1
@@ -104,7 +104,7 @@ class BuildContext(object):
|
||||
packageDir = self.spec.source.name + '-' + \
|
||||
self.spec.source.version + '-' + self.spec.source.release
|
||||
from pisi.util import join_path as join
|
||||
return join( ctx.config.destdir(), ctx.config.values.dirs.tmp_dir,
|
||||
return join( ctx.config.dest_dir(), ctx.config.values.dirs.tmp_dir,
|
||||
packageDir )
|
||||
|
||||
def pkg_work_dir(self):
|
||||
|
||||
@@ -19,6 +19,7 @@ _ = __trans.ugettext
|
||||
|
||||
import pisi
|
||||
import pisi.cli
|
||||
from pisi.cli import printu
|
||||
import pisi.context as ctx
|
||||
from pisi.uri import URI
|
||||
|
||||
@@ -69,7 +70,8 @@ class Command(object):
|
||||
def commonopts(self):
|
||||
'''common options'''
|
||||
p = self.parser
|
||||
p.add_option("-D", "--destdir", action="store")
|
||||
p.add_option("-D", "--destdir", action="store", default = None,
|
||||
help = _("change the system root for pisi commands"))
|
||||
p.add_option("", "--yes-all", action="store_true",
|
||||
default=False, help = _("assume yes in all yes/no queries"))
|
||||
p.add_option("-u", "--username", action="store")
|
||||
@@ -186,7 +188,7 @@ If run without parameters, it prints the general help.""")
|
||||
def run(self):
|
||||
if not self.args:
|
||||
self.parser.set_usage(usage_text)
|
||||
ctx.ui.info(self.parser.format_help())
|
||||
printu(self.parser.format_help())
|
||||
return
|
||||
|
||||
self.init()
|
||||
|
||||
+12
-11
@@ -44,29 +44,30 @@ class Config(object):
|
||||
# x_dir: system wide directory for storing info type x
|
||||
# pkg_x_dir: per package directory for storing info type x
|
||||
|
||||
def destdir(self):
|
||||
dir = str(self.get_option('destdir'))
|
||||
if not dir:
|
||||
dir = self.values.general.destinationdirectory
|
||||
return dir
|
||||
def dest_dir(self):
|
||||
dir = self.get_option('destdir')
|
||||
if dir:
|
||||
return str(dir)
|
||||
else:
|
||||
return self.values.general.destinationdirectory
|
||||
|
||||
def lib_dir(self):
|
||||
return join(self.destdir(), self.values.dirs.lib_dir)
|
||||
return join(self.dest_dir(), self.values.dirs.lib_dir)
|
||||
|
||||
def db_dir(self):
|
||||
return join(self.destdir(), self.values.dirs.db_dir)
|
||||
return join(self.dest_dir(), self.values.dirs.db_dir)
|
||||
|
||||
def archives_dir(self):
|
||||
return join(self.destdir(), self.values.dirs.archives_dir)
|
||||
return join(self.dest_dir(), self.values.dirs.archives_dir)
|
||||
|
||||
def packages_dir(self):
|
||||
return join(self.destdir(), self.values.dirs.packages_dir)
|
||||
return join(self.dest_dir(), self.values.dirs.packages_dir)
|
||||
|
||||
def index_dir(self):
|
||||
return join(self.destdir(), self.values.dirs.index_dir)
|
||||
return join(self.dest_dir(), self.values.dirs.index_dir)
|
||||
|
||||
def tmp_dir(self):
|
||||
return join(self.destdir(), self.values.dirs.tmp_dir)
|
||||
return join(self.dest_dir(), self.values.dirs.tmp_dir)
|
||||
|
||||
# bu dizini neden kullanıyoruz? Yalnızca index.py içerisinde
|
||||
# kullanılıyor ama /var/tmp/pisi/install gibi bir dizine niye
|
||||
|
||||
+1
-1
@@ -153,7 +153,7 @@ class Installer:
|
||||
"unzip package in place"
|
||||
|
||||
ctx.ui.info(_('Extracting files'))
|
||||
self.package.extract_dir_flat('install', ctx.config.destdir())
|
||||
self.package.extract_dir_flat('install', ctx.config.dest_dir())
|
||||
|
||||
if self.reinstall:
|
||||
# remove left over files
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ import pisi.comariface as comariface
|
||||
# remove stuff
|
||||
|
||||
def remove_file(fileinfo):
|
||||
fpath = pisi.util.join_path(ctx.config.destdir(), fileinfo.path)
|
||||
fpath = pisi.util.join_path(ctx.config.dest_dir(), fileinfo.path)
|
||||
# TODO: We have to store configuration files for futher
|
||||
# usage. Currently we'are doing it like rpm does, saving
|
||||
# with a prefix and leaving the user to edit it. In the future
|
||||
|
||||
Reference in New Issue
Block a user