Added download packages without install

This commit is contained in:
Dimitris Zlatanidis 2015-11-12 05:11:10 +02:00
parent 0f0a123ba2
commit 54ed0fe76a
6 changed files with 20 additions and 8 deletions

View file

@ -442,8 +442,8 @@ Command Line Tool Usage
--skip=[...], --resolve--off repositories and install with all --skip=[...], --resolve--off repositories and install with all
--checklist dependencies. --checklist dependencies.
-s, --sync, [repository] [package...], Sync packages. Install packages -s, --sync, [repository] [package...], Sync packages. Install packages
--resolve-off, --case-ins directly from remote repositories --resolve-off, --download-only, directly from remote repositories
with all dependencies. --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

@ -38,7 +38,8 @@ Usage: slpkg Commands:
[-l [repository], --index, --installed] [-l [repository], --index, --installed]
[-c [repository], --upgrade, --skip=[...], --resolve-off, [-c [repository], --upgrade, --skip=[...], --resolve-off,
--checklist] --checklist]
[-s [repository] [package...], --resolve-off, --case-ins] [-s [repository] [package...], --resolve-off, --download-only,
--case-ins]
[-t [repository] [package], --check-deps, --graph=[type], [-t [repository] [package], --check-deps, --graph=[type],
--case-ins] --case-ins]
[-p [repository] [package], --color=[]] [-p [repository] [package], --color=[]]
@ -219,6 +220,8 @@ Additional options:
.PP .PP
\fB--resolve-off\fP : Switch off automatic resolve dependencies. \fB--resolve-off\fP : Switch off automatic resolve dependencies.
.PP .PP
\fB--download-only\fP : Download packages without install.
.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

@ -92,8 +92,8 @@ Optional arguments:
--skip=[...], --resolve--off repositories and install with all --skip=[...], --resolve--off repositories and install with all
--checklist dependencies. --checklist dependencies.
-s, --sync, [repository] [package...], Sync packages. Install packages -s, --sync, [repository] [package...], Sync packages. Install packages
--resolve-off, --case-ins directly from remote repositories --resolve-off, --download-only, directly from remote repositories
with all dependencies. --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.
@ -159,7 +159,8 @@ def usage(repo):
[-l [repository], --index, --installed] [-l [repository], --index, --installed]
[-c [repository], --upgrade, --skip=[...], --resolve-off, [-c [repository], --upgrade, --skip=[...], --resolve-off,
--checklist] --checklist]
[-s [repository] [package...], --resolve-off, --case-ins] [-s [repository] [package...], --resolve-off, --download-only,
--case-ins]
[-t [repository] [package], --check-deps, --graph=[type], [-t [repository] [package], --check-deps, --graph=[type],
--case-ins] --case-ins]
[-p [repository] [package], --color=[]] [-p [repository] [package], --color=[]]

View file

@ -123,6 +123,8 @@ class BinaryInstall(object):
self.install.reverse() self.install.reverse()
Download(self.tmp_path, self.dep_dwn + self.dwn, Download(self.tmp_path, self.dep_dwn + self.dwn,
self.repo).start() self.repo).start()
if "--download-only" in self.flag:
raise SystemExit()
self.dep_install = Utils().check_downloaded( self.dep_install = Utils().check_downloaded(
self.tmp_path, self.dep_install) self.tmp_path, self.dep_install)
self.install = Utils().check_downloaded( self.install = Utils().check_downloaded(

View file

@ -326,6 +326,7 @@ class ArgParse(object):
] ]
additional_options = [ additional_options = [
"--resolve-off", "--resolve-off",
"--download-only",
"--case-ins" "--case-ins"
] ]
for arg in self.args: for arg in self.args:

View file

@ -169,9 +169,12 @@ class SBoInstall(object):
def continue_to_install(self): def continue_to_install(self):
"""Continue to install ? """Continue to install ?
""" """
if self.count_uni > 0 or self.count_upg > 0: if (self.count_uni > 0 or self.count_upg > 0 or
"--download-only" in self.flag):
if self.master_packages and self.msg.answer() in ["y", "Y"]: if self.master_packages and self.msg.answer() in ["y", "Y"]:
installs, upgraded = self.build_install() installs, upgraded = self.build_install()
if "--download-only" in self.flag:
raise SystemExit()
self.msg.reference(installs, upgraded) self.msg.reference(installs, upgraded)
write_deps(self.deps_dict) write_deps(self.deps_dict)
delete(self.build_folder) delete(self.build_folder)
@ -301,7 +304,7 @@ class SBoInstall(object):
pkg = "-".join(prgnam.split("-")[:-1]) pkg = "-".join(prgnam.split("-")[:-1])
installed = "".join(find_package(prgnam, self.meta.pkg_path)) installed = "".join(find_package(prgnam, self.meta.pkg_path))
src_link = SBoGrep(pkg).source().split() src_link = SBoGrep(pkg).source().split()
if installed: if installed and "--download-only" not in self.flag:
self.msg.template(78) self.msg.template(78)
self.msg.pkg_found(prgnam) self.msg.pkg_found(prgnam)
self.msg.template(78) self.msg.template(78)
@ -317,6 +320,8 @@ class SBoInstall(object):
script = sbo_link.split("/")[-1] script = sbo_link.split("/")[-1]
dwn_srcs = sbo_link.split() + src_link dwn_srcs = sbo_link.split() + src_link
Download(self.build_folder, dwn_srcs, repo="sbo").start() Download(self.build_folder, dwn_srcs, repo="sbo").start()
if "--download-only" in self.flag:
continue
sources = self.filenames(src_link) sources = self.filenames(src_link)
BuildPackage(script, sources, self.build_folder, BuildPackage(script, sources, self.build_folder,
auto=False).build() auto=False).build()