[sbopkg-users] bash-completion

Igor Murzov intergalactic.anonymous at gmail.com
Fri Jan 28 16:56:46 UTC 2011


> Very nice! I am very happy with that!

Here is updated version:

https://github.com/GArik/bash-completion/raw/slackware/completions/slackpkg

you can specify disk sets or filenames for 'install' and other actions.

> Can I put it inside slackpkg under "docs" directory?
> Or are you sending it to upstream?

Of course, you can do whatever you want with it )  I can try to contact 
mantainers of bash-completion and ask 'em to pull all slackware related 
completions.

But there is some known issues:
* Options for pkgtool are inaccurate.
* No version completion available for slapt-src.

I'll fix second issue someday ) But the first one requires patching pkgtools.
If you have some time, please review pkgtool script and man page.
In man page:
-----------------------------------------
--ignore_tagfiles
--source_mounted
--source_dir
-----------------------------------------

in /sbin/pkgtool:
-----------------------------------------
# Here, we read the list of arguments passed to the pkgtool script.
if [ $# -gt 0 ]; then # there are arguments to the command
 while [ $# -gt 0 ]; do
  case "$1" in
...
  -source_mounted | --source-mounted)
   SOURCE_MOUNTED="always" ; shift 1 ;;
  -ignore_tagfiles | --ignore-tagfiles)
   ASK="never" ; shift 1 ;;
  -tagfile | --tagfile)
   USETAG=$2 ; shift 2 ;;
  -source_dir | --source_dir)
...
-----------------------------------------

You can see that there is '--ignore_tagfiles' and '--ignore-tagfiles',  '--
source_mounted' and '--source-mounted' in different places. It would be great 
if you'll fix this.

Another spotted issues with pkgtools:
* No *) case within while loop where options are parsed. As the result pkgtool 
goes to infinite loop if any unknown option supplied.
* rpm2txz fails to convert rpms if there is a space character in file path. 
(patches are attached -- one for rpm2tgz and one for makepkg)

Some issues with slackpkg-2.81.1:
* slackpkg search  mentioned twice in man page.
* slackpkg search|file-search  seems to not actually accept any filenames
  Maybe you meant that one can search for filenames with file-search, then you 
  should remove leading slash from filenames.
-----------------------------------------
┌─[ /usr/bin ] [ root at garik ]
└─# slackpkg file-search $(readlink -f ../bin/cc | cut -c2-)

Looking for usr/bin/gcc-4.5.2 in package list. Please wait... DONE

The list below shows the packages that contains "usr/bin/gcc-4\.5\.2" file.

[ installed ] - gcc-4.5.2-i486-1

You can search specific packages using "slackpkg search package".

-----------------------------------------


-- Igor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0010-Quote-package-names.patch
Type: text/x-patch
Size: 941 bytes
Desc: not available
URL: <http://sbopkg.org/pipermail/sbopkg-users/attachments/20110128/00708a49/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: makepkg.patch
Type: text/x-patch
Size: 411 bytes
Desc: not available
URL: <http://sbopkg.org/pipermail/sbopkg-users/attachments/20110128/00708a49/attachment-0001.bin>


More information about the sbopkg-users mailing list