From e88273ee30b68c01d11c90bab5b97303a1ccd94b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Luttringer?= Date: Wed, 12 Jun 2013 17:28:41 +0200 Subject: [PATCH] Upgrade is about repository not database Database should not be exposed to external. We should use repository most of time. --- bin/is | 12 ++++++------ completion/bash/is | 2 +- completion/zsh/_installsystems | 2 +- doc/is.1.rst | 4 ++-- installsystems/repository.py | 8 ++++---- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/bin/is b/bin/is index e43f496..0890c48 100755 --- a/bin/is +++ b/bin/is @@ -456,12 +456,12 @@ def c_unprepare_chroot(args): ''' istools.unprepare_chroot(args.path, mount=not args.no_umount) -def c_upgrade_db(args): +def c_upgrade(args): ''' - Upgrade repository's database to the current database version + Upgrade repository's to the last version ''' repoman = load_repositories(args) - repoman[args.repository].upgrade_db() + repoman[args.repository].upgrade() def c_version(args): ''' @@ -747,10 +747,10 @@ def arg_parser_init(): p.add_argument("path") p.set_defaults(func=c_unprepare_chroot) # upgrade_db command parser - p = subparser.add_parser("upgrade_db", - help=c_upgrade_db.__doc__.lower()) + p = subparser.add_parser("upgrade", + help=c_upgrade.__doc__.lower()) p.add_argument("repository", help="repository to upgrade") - p.set_defaults(func=c_upgrade_db) + p.set_defaults(func=c_upgrade) # version command parser p = subparser.add_parser("version", help=c_version.__doc__.lower()) p.set_defaults(func=c_version) diff --git a/completion/bash/is b/completion/bash/is index 34fef88..70cda20 100644 --- a/completion/bash/is +++ b/completion/bash/is @@ -188,7 +188,7 @@ _is() { [[ "$cur" == -* ]] && _opt '-h --help -m --no-mount' && return 0 _filedir -d ;; - upgrade_db) + upgrade) [[ "$cur" == -* ]] && _opt '-h --help' && return 0 _count_args (( args == 2 )) && _local_repo diff --git a/completion/zsh/_installsystems b/completion/zsh/_installsystems index c992a12..9684701 100644 --- a/completion/zsh/_installsystems +++ b/completion/zsh/_installsystems @@ -320,7 +320,7 @@ _is() { '1:path:_files -/' ) ;; - (upgrade_db) + (upgrade) args+=( '1:repo:_installsystems_local_repo' ) diff --git a/doc/is.1.rst b/doc/is.1.rst index 138427f..cd908f6 100644 --- a/doc/is.1.rst +++ b/doc/is.1.rst @@ -350,8 +350,8 @@ unprepare_chroot [-h] [-m] *path* disable unmouting of /{proc,dev,sys} -upgrade_db [-h] *repository* - Upgrade repository's database to the current database version +upgrade [-h] *repository* + Upgrade repository's to the last version version [-h] diff --git a/installsystems/repository.py b/installsystems/repository.py index d9a76de..368cab7 100644 --- a/installsystems/repository.py +++ b/installsystems/repository.py @@ -155,8 +155,8 @@ class Repository(object): because repository is not initialized ''' config = object.__getattribute__(self, "config") - # config, init, local and upgrade_db are always accessible - if name in ("init", "config", "local", "upgrade_db"): + # config, init, local and upgrade are always accessible + if name in ("init", "config", "local", "upgrade"): return object.__getattribute__(self, name) # if no db (not init or not accessible) raise error if config.offline: @@ -537,9 +537,9 @@ class Repository(object): (a[0],)).fetchall() return [ a[0] ] + [ x[0] for x in b ] - def upgrade_db(self): + def upgrade(self): if self.version == Database.version: - info("Database already up-to-date (%s)" % self.version) + info("Repository already up-to-date (%s)" % self.version) return else: arrow("Start repository upgrade") -- GitLab