Added directory prefix option

This commit is contained in:
Dimitris Zlatanidis 2015-11-12 06:01:20 +02:00
parent 54ed0fe76a
commit cecc59430a
6 changed files with 20 additions and 2 deletions

View file

@ -443,7 +443,7 @@ Command Line Tool Usage
--checklist dependencies. --checklist dependencies.
-s, --sync, [repository] [package...], Sync packages. Install packages -s, --sync, [repository] [package...], Sync packages. Install packages
--resolve-off, --download-only, directly from remote repositories --resolve-off, --download-only, directly from remote repositories
--case-ins with all dependencies. --directory-prefix=[dir], --case-ins with all dependencies.
-t, --tracking, [repository] [package], Tracking package dependencies and -t, --tracking, [repository] [package], Tracking package dependencies and
--check-deps, --graph=[type], print package dependencies tree with --check-deps, --graph=[type], print package dependencies tree with
--case-ins highlight if packages is installed. --case-ins highlight if packages is installed.

View file

@ -41,6 +41,7 @@ Usage: slpkg Commands:
[-s [repository] [package...], --resolve-off, --download-only, [-s [repository] [package...], --resolve-off, --download-only,
--case-ins] --case-ins]
[-t [repository] [package], --check-deps, --graph=[type], [-t [repository] [package], --check-deps, --graph=[type],
--directory-prefix=[dir],
--case-ins] --case-ins]
[-p [repository] [package], --color=[]] [-p [repository] [package], --color=[]]
[-n [SBo package], --checklist, --case-ins] [-n [SBo package], --checklist, --case-ins]
@ -222,6 +223,8 @@ Additional options:
.PP .PP
\fB--download-only\fP : Download packages without install. \fB--download-only\fP : Download packages without install.
.PP .PP
\fB--directory-prefix=[path/to/dir/]\fP : Download packages in specific directory.
.PP
\fB--case-ins\fP : Search package name in repository with case insensitive. \fB--case-ins\fP : Search package name in repository with case insensitive.
.SS -t, --tracking, tracking dependencies .SS -t, --tracking, tracking dependencies

View file

@ -93,7 +93,7 @@ Optional arguments:
--checklist dependencies. --checklist dependencies.
-s, --sync, [repository] [package...], Sync packages. Install packages -s, --sync, [repository] [package...], Sync packages. Install packages
--resolve-off, --download-only, directly from remote repositories --resolve-off, --download-only, directly from remote repositories
--case-ins with all dependencies. --directory-prefix=[dir], --case-ins with all dependencies.
-t, --tracking, [repository] [package], Tracking package dependencies and -t, --tracking, [repository] [package], Tracking package dependencies and
--check-deps, --graph=[type], print package dependencies tree with --check-deps, --graph=[type], print package dependencies tree with
--case-ins highlight if packages is installed. --case-ins highlight if packages is installed.
@ -160,6 +160,7 @@ def usage(repo):
[-c [repository], --upgrade, --skip=[...], --resolve-off, [-c [repository], --upgrade, --skip=[...], --resolve-off,
--checklist] --checklist]
[-s [repository] [package...], --resolve-off, --download-only, [-s [repository] [package...], --resolve-off, --download-only,
--directory-prefix=[dir],
--case-ins] --case-ins]
[-t [repository] [package], --check-deps, --graph=[type], [-t [repository] [package], --check-deps, --graph=[type],
--case-ins] --case-ins]

View file

@ -58,6 +58,11 @@ class BinaryInstall(object):
self.msg = Msg() self.msg = Msg()
self.version = self.meta.slack_rel self.version = self.meta.slack_rel
self.tmp_path = self.meta.slpkg_tmp_packages self.tmp_path = self.meta.slpkg_tmp_packages
for fl in self.flag:
if fl.startswith("--directory-prefix="):
self.tmp_path = fl.split("=")[1]
if not self.tmp_path.endswith("/"):
self.tmp_path += "/"
self.dwn, self.dep_dwn = [], [] self.dwn, self.dep_dwn = [], []
self.install, self.dep_install = [], [] self.install, self.dep_install = [], []
self.comp_sum, self.dep_comp_sum = [], [] self.comp_sum, self.dep_comp_sum = [], []

View file

@ -327,9 +327,13 @@ class ArgParse(object):
additional_options = [ additional_options = [
"--resolve-off", "--resolve-off",
"--download-only", "--download-only",
"--directory-prefix=",
"--case-ins" "--case-ins"
] ]
for arg in self.args: for arg in self.args:
if arg.startswith(additional_options[2]):
flag.append(arg)
arg = ""
if arg in additional_options: if arg in additional_options:
flag.append(arg) flag.append(arg)
if len(self.args) >= 3 and self.args[0] in options: if len(self.args) >= 3 and self.args[0] in options:

View file

@ -56,6 +56,11 @@ class SBoInstall(object):
self.msg = Msg() self.msg = Msg()
self.arch = SBoArch().get() self.arch = SBoArch().get()
self.build_folder = self.meta.build_path self.build_folder = self.meta.build_path
for fl in self.flag:
if fl.startswith("--directory-prefix="):
self.build_folder = fl.split("=")[1]
if not self.build_folder.endswith("/"):
self.build_folder += "/"
self.unst = ["UNSUPPORTED", "UNTESTED"] self.unst = ["UNSUPPORTED", "UNTESTED"]
self.master_packages = [] self.master_packages = []
self.deps = [] self.deps = []