From 22c38963d81c8952360a8fc6f9e76aeed36b8ec2 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sun, 1 Mar 2015 13:57:00 +0200 Subject: [PATCH 1/4] added bash completion file --- CHANGELOG | 6 ++++++ conf/slpkg.bash-completion | 14 ++++++++++++++ man/slpkg.8 | 3 +++ setup.py | 10 +++++++++- slackbuild/slpkg.SlackBuild | 5 +++++ 5 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 conf/slpkg.bash-completion diff --git a/CHANGELOG b/CHANGELOG index 3ee20adf..ed9dd5ab 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +Version 2.2.7 +1-3-2015 + +[Feature] - Added bash completion file. + + Version 2.2.6 26-2-2015 diff --git a/conf/slpkg.bash-completion b/conf/slpkg.bash-completion new file mode 100644 index 00000000..170a8190 --- /dev/null +++ b/conf/slpkg.bash-completion @@ -0,0 +1,14 @@ +_slpkg() +{ + local cur + cur=${COMP_WORDS[COMP_CWORD]} + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W "--help --version update upgrade repo-add repo-remove repo-list repo-info slpkg --list --add --remove --build --install --build-install --config --index --installed --upgrade --color" -- $cur )) + + else + _filedir + fi +} + +complete -F _slpkg slpkg diff --git a/man/slpkg.8 b/man/slpkg.8 index bfc61ff5..5920312d 100644 --- a/man/slpkg.8 +++ b/man/slpkg.8 @@ -295,6 +295,9 @@ For example: /etc/slpkg/custom-repositories List of custom repositories +/etc/bash_completion.d/slpkg.bash-completion + Bash completion file + /var/log/slpkg ChangeLog.txt repositories files SlackBuilds logs and dependencies files diff --git a/setup.py b/setup.py index 131b3e55..4b70653d 100755 --- a/setup.py +++ b/setup.py @@ -80,7 +80,15 @@ if "install" in sys.argv: f_out.close() f_in.close() shutil.copy2(gzip_man, man_path) - os.chmod(man_path, int("444", 8)) + + bash_completion = "/etc/bash_completion.d/" + completion_file = "conf/slpkg.bash-completion" + if not os.path.exists(bash_completion): + os.makedirs(bash_completion) + print("Installing '{0}' bash completion file".format( + completion_file.split('/')[1])) + shutil.copy2(completion_file, bash_completion) + os.chmod(bash_completion + completion_file.split('/')[1], 744) conf_file = [ 'conf/slpkg.conf', diff --git a/slackbuild/slpkg.SlackBuild b/slackbuild/slpkg.SlackBuild index 614a7ce8..6537e1f2 100755 --- a/slackbuild/slpkg.SlackBuild +++ b/slackbuild/slpkg.SlackBuild @@ -92,6 +92,11 @@ for file in $CONFIGS; do install -D -m0644 conf/$file $PKG/etc/slpkg/${file}.new done +# install bash completion file +mkdir -p $PKG/etc/bash_completion.d +install -D -m0744 conf/${PRGNAM}.bash-completion \ + $PKG/etc/bash_completion.d/${PRGNAM}.bash-completion + # install man page mkdir -p $PKG/usr/man/man8 gzip -9 man/$PRGNAM.8 From 76996f6d53045f7744fabc2c492298af7f6c18b2 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Mon, 2 Mar 2015 14:38:06 +0200 Subject: [PATCH 2/4] added fish completion file --- CHANGELOG | 4 ++-- conf/slpkg.fish | 25 +++++++++++++++++++++++++ man/slpkg.8 | 3 --- setup.py | 18 ++++++++++++------ slackbuild/slpkg.SlackBuild | 6 ++++++ 5 files changed, 45 insertions(+), 11 deletions(-) create mode 100644 conf/slpkg.fish diff --git a/CHANGELOG b/CHANGELOG index ed9dd5ab..04d3fe26 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,8 +1,8 @@ Version 2.2.7 -1-3-2015 +2-3-2015 [Feature] - Added bash completion file. - + - Added fish completion file. Version 2.2.6 26-2-2015 diff --git a/conf/slpkg.fish b/conf/slpkg.fish new file mode 100644 index 00000000..a2604828 --- /dev/null +++ b/conf/slpkg.fish @@ -0,0 +1,25 @@ +complete --command slpkg --long-option help --short-option h --description 'show this help message and exit' +complete --command slpkg --long-option version --short-option v --description 'print version and exit' +complete --command slpkg --long-option '' --short-option a --description 'auto build SBo packages' +complete --command slpkg --long-option '' --short-option b --description 'add, remove packages in blacklist' +complete --command slpkg --long-option '' --short-option q --description 'add, remove SBo packages in queue' +complete --command slpkg --long-option '' --short-option g --description 'configuration file management' +complete --command slpkg --long-option '' --short-option l --description 'list of repositories packages' +complete --command slpkg --long-option '' --short-option c --description 'check for updated packages' +complete --command slpkg --long-option '' --short-option s --description 'download, build & install packages' +complete --command slpkg --long-option '' --short-option t --description 'package tracking dependencies' +complete --command slpkg --long-option '' --short-option p --description 'print package description' +complete --command slpkg --long-option '' --short-option n --description 'view SBo packages through network' +complete --command slpkg --long-option '' --short-option f --description 'find installed packages' +complete --command slpkg --long-option '' --short-option i --description 'install binary packages' +complete --command slpkg --long-option '' --short-option u --description 'upgrade binary packages' +complete --command slpkg --long-option '' --short-option o --description 'reinstall binary packages' +complete --command slpkg --long-option '' --short-option r --description 'remove binary packages' +complete --command slpkg --long-option '' --short-option d --description 'display the contents' +complete --command slpkg --long-option add --short-option '' --description 'additional options for blacklist and queue' +complete --command slpkg --long-option remove --short-option '' --description 'additional options for blacklist and queue' +complete --command slpkg --long-option list --short-option '' --description 'additional options for blacklist and queue' +complete --command slpkg --long-option build --short-option '' --description 'additional options for queue' +complete --command slpkg --long-option install --short-option '' --description 'additional options for queue' +complete --command slpkg --long-option build-install --short-option '' --description 'additional options for queue' +complete --command slpkg --long-option config --short-option '' --description 'additional options for configuration file management' diff --git a/man/slpkg.8 b/man/slpkg.8 index 5920312d..bfc61ff5 100644 --- a/man/slpkg.8 +++ b/man/slpkg.8 @@ -295,9 +295,6 @@ For example: /etc/slpkg/custom-repositories List of custom repositories -/etc/bash_completion.d/slpkg.bash-completion - Bash completion file - /var/log/slpkg ChangeLog.txt repositories files SlackBuilds logs and dependencies files diff --git a/setup.py b/setup.py index 4b70653d..9643c549 100755 --- a/setup.py +++ b/setup.py @@ -82,14 +82,20 @@ if "install" in sys.argv: shutil.copy2(gzip_man, man_path) bash_completion = "/etc/bash_completion.d/" - completion_file = "conf/slpkg.bash-completion" + fish_completion = "/etc/fish/completions/" + completion_file = [ + 'conf/slpkg.bash-completion', + 'conf/slpkg.fish' + ] if not os.path.exists(bash_completion): os.makedirs(bash_completion) - print("Installing '{0}' bash completion file".format( - completion_file.split('/')[1])) - shutil.copy2(completion_file, bash_completion) - os.chmod(bash_completion + completion_file.split('/')[1], 744) - + print("Installing '{0}' file".format(completion_file[0].split('/')[1])) + shutil.copy2(completion_file[0], bash_completion) + os.chmod(bash_completion + completion_file[0].split('/')[1], 744) + if os.path.exists(fish_completion): + print("Installing '{0}' file".format(completion_file[1].split('/')[1])) + shutil.copy2(completion_file[1], fish_completion) + os.chmod(fish_completion + completion_file[1].split('/')[1], 744) conf_file = [ 'conf/slpkg.conf', 'conf/blacklist', diff --git a/slackbuild/slpkg.SlackBuild b/slackbuild/slpkg.SlackBuild index 6537e1f2..e2bab4a8 100755 --- a/slackbuild/slpkg.SlackBuild +++ b/slackbuild/slpkg.SlackBuild @@ -97,6 +97,12 @@ mkdir -p $PKG/etc/bash_completion.d install -D -m0744 conf/${PRGNAM}.bash-completion \ $PKG/etc/bash_completion.d/${PRGNAM}.bash-completion +# install fish completion file +if [ -d "/etc/fish/completions" ]; then + install -D -m0744 conf/${PRGNAM}.fish \ + $PKG/etc/fish/completions/${PRGNAM}.fish +fi + # install man page mkdir -p $PKG/usr/man/man8 gzip -9 man/$PRGNAM.8 From fe7cd7faf519f85b085ddbb6c74604d63b0f458d Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Wed, 18 Mar 2015 22:02:41 +0200 Subject: [PATCH 3/4] synchronization issues when upgrading SBo repository --- slpkg/binary/install.py | 2 +- slpkg/sbo/slackbuild.py | 12 +++++++----- slpkg/slack/patches.py | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/slpkg/binary/install.py b/slpkg/binary/install.py index edd40e7f..39bc1f07 100644 --- a/slpkg/binary/install.py +++ b/slpkg/binary/install.py @@ -253,7 +253,7 @@ class BinaryInstall(object): " " * (18-len(pkg_split[1])), pkg_split[2], " " * (8-len(pkg_split[2])), pkg_split[3], " " * (7-len(pkg_split[3])), repo, - comp, " K")) + comp, " K")).rstrip() return [pkg_sum, upg_sum, uni_sum] def top_view(self): diff --git a/slpkg/sbo/slackbuild.py b/slpkg/sbo/slackbuild.py index 087bf701..56061cd0 100644 --- a/slpkg/sbo/slackbuild.py +++ b/slpkg/sbo/slackbuild.py @@ -92,7 +92,7 @@ class SBoInstall(object): self.dependencies, dep_src = self.sbo_version_source( self.one_for_all(self.deps)) Msg().done() - self.master_packages = self.clear_masters() + self.master_packages, self.pkg_ver = self.clear_masters() if self.package_found: print("\nThe following packages will be automatically " "installed or upgraded \nwith new version:\n") @@ -165,11 +165,13 @@ class SBoInstall(object): Clear master slackbuilds if already exist in dependencies or if added to install two or more times ''' - slackbuilds = [] - for mas in Utils().remove_dbs(self.master_packages): + slackbuilds, version = [], [] + for mas, ver in zip(Utils().remove_dbs(self.master_packages), + self.pkg_ver): if mas not in self.dependencies: slackbuilds.append(mas) - return slackbuilds + version.append(ver) + return slackbuilds, version def matching(self, sbo_not_found): ''' @@ -246,7 +248,7 @@ class SBoInstall(object): " " * (24-len(args[1])), args[2], " " * (18-len(args[2])), args[3], " " * (15-len(args[3])), "", - "", "SBo", "", "")) + "", "SBo", "", "")).rstrip() def tag(self, sbo, count_ins, count_upg, count_uni): ''' diff --git a/slpkg/slack/patches.py b/slpkg/slack/patches.py index f771f914..664e82e3 100644 --- a/slpkg/slack/patches.py +++ b/slpkg/slack/patches.py @@ -146,7 +146,7 @@ class Patches(object): " " * (18-len(pkg_split[1])), pkg_split[2], " " * (8-len(pkg_split[2])), pkg_split[3], " " * (7-len(pkg_split[3])), "Slack", - size, " K")) + size, " K")).rstrip() def upgrade(self): ''' From 5e674528b5795f69c2008127f7aa2069bf7c95d9 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Wed, 18 Mar 2015 22:10:44 +0200 Subject: [PATCH 4/4] update to version 2.2.7 --- CHANGELOG | 4 +++- PKG-INFO | 2 +- README.rst | 6 +++--- slpkg/__metadata__.py | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 04d3fe26..1b1a9141 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,8 +1,10 @@ Version 2.2.7 -2-3-2015 +18-3-2015 [Feature] - Added bash completion file. - Added fish completion file. +[Updated] - Fix synchronization issues when upgrading SBo repository. + - Fix remove to the right spaces on view. Version 2.2.6 26-2-2015 diff --git a/PKG-INFO b/PKG-INFO index 441e824c..28937bc2 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: slpkg -Version: 2.2.6 +Version: 2.2.7 Author: dslackw Author-email: d zlatanidis at gmail com Maintainer: dslackw diff --git a/README.rst b/README.rst index 4faef2a1..9ae4fb2b 100644 --- a/README.rst +++ b/README.rst @@ -32,7 +32,7 @@ .. contents:: Table of Contents: -Slpkg +About ----- Slpkg is a software package manager that installs, updates, and removes packages on Slackware @@ -172,8 +172,8 @@ Untar the archive and run install.sh script: .. code-block:: bash - $ tar xvf slpkg-2.2.6.tar.gz - $ cd slpkg-2.2.6 + $ tar xvf slpkg-2.2.7.tar.gz + $ cd slpkg-2.2.7 $ ./install.sh Using pip: diff --git a/slpkg/__metadata__.py b/slpkg/__metadata__.py index 8e468ad7..12f03a3f 100644 --- a/slpkg/__metadata__.py +++ b/slpkg/__metadata__.py @@ -87,7 +87,7 @@ class MetaData(object): __all__ = "slpkg" __author__ = "dslackw" - __version_info__ = (2, 2, 6) + __version_info__ = (2, 2, 7) __version__ = "{0}.{1}.{2}".format(*__version_info__) __license__ = "GNU General Public License v3 (GPLv3)" __email__ = "d.zlatanidis@gmail.com"