about summary refs log tree commit diff
path: root/Completion/Linux/Command/_pkgtool
blob: dd112680d85fb3268462b143d49072e1e93b44ac (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#compdef installpkg upgradepkg removepkg pkgtool explodepkg makepkg 

_slackware_pkg() {
  local flags

  case "$service" in
  installpkg)
    flags=(
      '-warn[warn if files will be overwritten, but do not install]'
      '-root=[install someplace else, like /mnt]:root directory:_path_files -/'
      '-infobox[use dialog to draw an info box]'
      '-menu[confirm package installation with a menu]'
      '-ask[used with menu mode: always ask if a package should be installed regardless of what the package'\''s priority is]'
      '-priority[provide a priority for the entire package list to use instead of the priority in the tagfile]:priority list:(ADD REC OPT SKP)'
      '-tagfile[specify a different file to use for package priorities.  The default is "tagfile" in the package'\''s directory]:tagfile:_files -/'
    )

    _arguments -s \
      $flags[@] \
      '*:Slackware packages:_files -g \*.tgz'
    ;;

  removepkg)
    flags=(
      '-warn[generate  a  report  to  the  standard output about which files and directories would be removed, but does not actually remove the package.]'
      '-preserve[if specified, the complete package subtree is reconstructed in /tmp/preserved_packages/packagename.]'
      '-copy[construct a copy of the package under /tmp/preserved_packages/packagename, but don'\''t remove it.  (same effect as -warn -preserve)]'
      '-keep[save the  intermediate  files  created  by  removepkg  (delete_list,  required_files,  uniq_list,  del_link_list,  required_links, required_list).  Mostly useful for debugging purposes.]'
    )

    _arguments -s \
      $flags[@] \
      '*:Package name:_files -W /var/log/packages/ -/'
    ;;

  upgradepkg)
    flags=(
      '--install-new[the behavior is modified to install new packages in addition to upgrading existing ones.]'
      '--reinstall[upgrade all packages even if the same version is already installed.]'
      '--verbose[show all the gory details of the upgrade.]'
    )


    _arguments -s \
      $flags[@] \
      '*:Slackware packages:_files -g \*.tgz'
    ;;

    
  explodepkg)
    _arguments -s \
    '*:Slackware packages:_files -g \*.tgz'
    ;;

  makepkg)
    flags=(
      '(--linkadd -l)'{--linkadd,-l}'[moves symlinks into doinst.sh: recommended]:answer:(y n)'
      '(--chown -c)'{--chown,-c}'[resets all permissions to root:root 755 - not generally recommended]:answer:(y n)'
    )


    _arguments -s \
      $flags[@] 
    ;;



  pkgtool)
    flags=(
    '-sets[install the disk sets A, B, C. Seperate the disk set names by '\''#'\'' symbols.]'
    '-source_mounted[when this flag is present, pkgtool will not attempt to unmount and remount the source device with each disk.]'
    '-ignore_tagfile[when this flag is present, pkgtool will install every *.tgz package encountered no matter what the tagfiles say.]'
    '-tagfile[this flag is used to specify from the command line which tagfile should be used for the installation.]:tagfile:_files -/'
    '-source_dir[used  when installing multiple packages from disk sets. This is the directory in which the subdirectories for each disk are found.]:source directory:_path_files -/'
    '-target_dir[the directory where the target root directory is located. This is '/' when installing on the hard drive, or typically '\''/mnt'\''  when installing from an install disk.]:target directory:_path_files -W -/'
    '-source_device[the source device to install from. This is not used if you'\''ve provided the -source_mounted flag. It'\''s usually used when installing from floppy.]:source device:{compadd "$expl[@]" /dev/*}'
    )
    _arguments -s \
      $flags[@] 
      ;;
  esac
}

_slackware_pkg "$@"