Skip to content

Commit

Permalink
Added re-install option
Browse files Browse the repository at this point in the history
  • Loading branch information
silvernode committed Jan 29, 2016
1 parent 9dacf10 commit 0a63e29
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions PkgMgrs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#command binding methods for different package managers
def pacman()
$installCmd = "pacman -S"
$reinstallCmd = "pacman -S --force"
$searchCmd = "pacman -Ss"
$updateCmd = "pacman -Su"
$syncCmd = "pacman -Sy"
Expand All @@ -22,6 +23,7 @@ def pacman()

def apt_get()
$installCmd = "apt-get install"
$reinstallCmd = "apt-get install --reinstall"
$searchCmd = "apt-cache search"
$updateCmd = "apt-get upgrade"
$syncCmd = "apt-get update"
Expand All @@ -34,6 +36,7 @@ def apt_get()

def xbps_install()
$installCmd = "xbps-install"
$reinstallCmd = "xbps-install -f"
$searchCmd = "xbps-query -Rs"
$updateCmd = "xbps-install -u"
$syncCmd = "xbps-install -S"
Expand Down
8 changes: 8 additions & 0 deletions tux
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ send(pkgMgr)

#pull variables from currently loaded method, e.g pacman()
install = "#{$installCmd} #{pkgArgs}"
reinstall = "#{$reinstallCmd} #{pkgArgs}"
search = "#{$searchCmd} #{pkgArgs}"
update = "#{$updateCmd} #{pkgArgs}"
remove = "#{$removeCmd} #{pkgArgs}"
Expand All @@ -62,6 +63,12 @@ when
"get",
"install"; system ("sudo #{install}")

when
"ri",
"-ri",
"reinstall"; system ("sudo #{reinstall}")


# Search options
when
"s",
Expand Down Expand Up @@ -126,6 +133,7 @@ else
Options:
i, -S, install Install a package
ri, -ri, reinstall Reinstall a package
r, -R, remove Remove a package
c, -c, clean Remove orphan packages
s, -Ss, search Search remote repository
Expand Down

0 comments on commit 0a63e29

Please sign in to comment.