Skip to content

Commit

Permalink
Merge pull request #22 from excalibur1234/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
excalibur1234 authored Sep 7, 2017
2 parents d6adf33 + 147c836 commit e767628
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 91 deletions.
7 changes: 3 additions & 4 deletions PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
# Maintainer: excalibur1234 @forum.manjaro.org

pkgname=pacui
pkgver=1.6.1
pkgrel=2
pkgver=1.7
pkgrel=1
pkgdesc="Bash script providing advanced Pacman and Pacaur/Yaourt functionality in a simple UI"
arch=(any)
url="https://github.com/excalibur1234/$pkgname"
license=('GPL3')
depends=('expac' 'wget' 'sudo' 'fzf')
conflicts=("$pkgname-git" 'pacli-simple')
replaces=('pacli-simple')
conflicts=("pacui-git")
optdepends=('pacaur: Needed for AUR support. If installed, it gets used by default over Yaourt.'
'yaourt: Needed for AUR support.'
'pacman-mirrors: Needed for Manjaro mirror support'
Expand Down
22 changes: 12 additions & 10 deletions PKGBUILD_AUR
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
# Maintainer: excalibur1234 @forum.manjaro.org

_pkgname=pacui
pkgname=$_pkgname-git
pkgver=1.6.1
pkgrel=2
pkgname=pacui
pkgver=1.7
pkgrel=1
pkgdesc="Bash script providing advanced Pacman and Pacaur/Yaourt functionality in a simple UI"
arch=(any)
url="https://github.com/excalibur1234/pacui"
url="https://github.com/excalibur1234/$pkgname"
license=('GPL3')
depends=('expac' 'wget' 'sudo' 'fzf')
makedepends=('git')
conflicts=("$_pkgname" 'pacli-simple-git')
replaces=('pacli-simple-git')
conflicts=("pacui-git" 'pacli-simple-git')
optdepends=('pacaur: Needed for AUR support. If installed, it gets used by default over Yaourt.'
'yaourt: Needed for AUR support.'
'pacman-mirrors: Needed for Manjaro mirror support'
'reflector: Needed for Arch Linux mirror support'
'downgrade: Needed for hidden "downgrade" option.')
source=("$_pkgname::git+https://github.com/excalibur1234/$_pkgname.git")
md5sums=('SKIP')
source=("$pkgname::git+https://github.com/excalibur1234/$pkgname.git")
md5sums=('1a36034db48ce0d93fa350e031534ee6')

# how to update md5sum:
# 1. do "updpkgsums" inside the folder with PKGBUILD file
# 2. delete .tar.gz file

package () {
cd "$srcdir"
install -Dm755 "$srcdir/$_pkgname/pacui" "$pkgdir/usr/bin/pacui"
install -Dm755 "$srcdir/$pkgname/pacui" "$pkgdir/usr/bin/pacui"
}
30 changes: 30 additions & 0 deletions PKGBUILD_AUR-git
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Maintainer: excalibur1234 @forum.manjaro.org

_pkgname=pacui
pkgname=$_pkgname-git
pkgver=1.6.1.r52.gf15de67
pkgrel=1
pkgdesc="Bash script providing advanced Pacman and Pacaur/Yaourt functionality in a simple UI"
arch=(any)
url="https://github.com/excalibur1234/$_pkgname"
license=('GPL3')
depends=('expac' 'wget' 'sudo' 'fzf')
makedepends=('git')
conflicts=("$_pkgname" 'pacli-simple-git')
optdepends=('pacaur: Needed for AUR support. If installed, it gets used by default over Yaourt.'
'yaourt: Needed for AUR support.'
'pacman-mirrors: Needed for Manjaro mirror support'
'reflector: Needed for Arch Linux mirror support'
'downgrade: Needed for hidden "downgrade" option.')
source=("$_pkgname::git+https://github.com/excalibur1234/$_pkgname.git")
md5sums=('SKIP')

pkgver() {
cd "$srcdir/$_pkgname"
git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

package () {
cd "$srcdir"
install -Dm755 "$srcdir/$_pkgname/pacui" "$pkgdir/usr/bin/pacui"
}
78 changes: 1 addition & 77 deletions pacui
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

# ANSI Escape sequences used in this script:
# \e[31m # red text
# \e[36m # cyan text
# \e[41m # red background
# \e[0m \033[0m # non-colored, non-bold text without background color (second possiblity has to be used in "awk")
# \e[1m \033[1m # bold text (second possiblity has to be used in "awk")
Expand Down Expand Up @@ -1057,54 +1058,6 @@ function func_la
# =======================


function func_info
{
# check, whether file /tmp/pacui-packages already exists (the ! negates the result)
if [[ ! -e /tmp/pacui-packages ]]
then
# write package list of repositories to /tmp/pacui-packages: download AUR package list to /tmp/aur/packages.gz, unzip it to /tmp/aur/packages, and add it to the bottom of /tmp/pacui-packages.
pacman -Slq > /tmp/pacui-packages

# download AUR package list (only when not already downloaded), unzip it to /tmp/aur/packages, and add it to the bottom of /tmp/pacui-packages-install.
if [[ ! -e /tmp/aur/packages ]]
then
wget -P /tmp/aur/ https://aur.archlinux.org/packages.gz &>/dev/null && gunzip -f /tmp/aur/packages.gz
fi
cat /tmp/aur/packages | grep -v "#" >> /tmp/pacui-packages
fi

# the following command lets you search through the file "/tmp/pacui-packages" with fzf and save your selection in "pkg"
local pkg
pkg=$( sort -k1,1 -u /tmp/pacui-packages | fzf-tmux -e +s -i -1 --query="$input2" --cycle --reverse --margin=4%,1%,1%,2% --inline-info --header="Press ENTER to display info. Press ESC or CTRL+C to quit." --prompt='Enter string to filter displayed list of packages > ')

# only run the command inside the if-statement, if $pkg variable is not empty - this happens when fzf is quit with ESC or CTRL+C
if [[ -n $pkg ]]
then
# next, it is checked, whether "pkg" is part of a list of all installed packages (pacman -Qq).
if ( pacman -Qq "$pkg" 2>/dev/null )
then

if [[ ! -e /usr/bin/pacaur ]] # checks, whether file "pacaur" does not exist
then
yaourt -Qii "$pkg" # execute this command when "pkg" is already installed on system
else
pacaur -Qii "$pkg" --color always
fi

else

if [[ ! -e /usr/bin/pacaur ]] # checks, whether file "pacaur" does not exist
then
yaourt -Sii "$pkg" # execute this command when "pkg" is not installed on system
else
pacaur -Sii "$pkg" --color always | grep -v "::" # grep command removes errors being displayed in pacaur
fi

fi
fi
}


function func_ls
{
# list all packages on local system sorted by their installed size using "expac" and "sort".
Expand All @@ -1114,12 +1067,6 @@ function func_ls
}


function func_log
{
tail -5000 /var/log/pacman.log | fzf-tmux -m -e +s -i --tac --reverse --margin=4%,1%,1%,1% --inline-info --header="Navigate with PageUp / PageDown Keys. Press ESC or CTRL+C to quit." --prompt='Enter string to filter displayed logs > ' > /tmp/pacui-log
}


function func_d
{
# write package list of system repositories to /tmp/pacui-packages-local. then add all installed packages to the bottom of /tmp/pacui-packages-local.
Expand Down Expand Up @@ -1205,9 +1152,7 @@ function func_h
echo -e " pacui ua - Force \e[1mU\e[0mpdate \e[1mA\e[0mUR"
echo -e " pacui la - \e[1mL\e[0mist Installed from \e[1mA\e[0mUR"
echo
echo -e " pacui info - Package \e[1mInfo\e[0mrmation"
echo -e " pacui ls - \e[1mL\e[0mist Packages by \e[1mS\e[0mize"
echo -e " pacui log - Pacman \e[1mLog\e[0m"
echo -e " pacui d - \e[1mD\e[0mowngrade Packages"
echo -e " pacui a - Search + Install from \e[1mA\e[0mUR"
echo
Expand Down Expand Up @@ -1486,22 +1431,11 @@ This command lists all installed packages, which are from the AUR or which were
If you want a list of all installed packages use REMOVE PACKAGES + DEPS as described in this Help Page.
\e[1mPACKAGE INFORMATION
\e[36m"yaourt -Sii <PACKAGE NAME>"\e[0m or \e[36m"yaourt -Qii <PACKAGE NAME>"
This command displays a lot of information about <PACKAGE NAME>. Different pieces of information get displayed depending on package source (system repository or AUR) and package state (installed or not installed).
\e[1mLIST PACKAGES BY SIZE
\e[36m"expac -Q '%m - %n %v' | sort -n -r "
This command lists packages on your system sorted by their installation size. Both explicitly installed packages and dependencies are displayed. Important system packages part of the "base" or "base-devel" group are not displayed. Please note that all selected lines (toggle selection with your TAB key) will get added to file /tmp/pacui-ls.
\e[1mPACMAN LOG
\e[36m"tail -5000 /var/log/pacman.log"
The Pacman Log contains all updates, installations, and removals (also in the AUR) you have done. Whenever something breaks on your system (e.g. after an udpate), but you do not remember anymore which packages were changed recently (e.g. during the last update), take a look at your Pacman Log and find out. Then, ROLL BACK SYSTEM, and downgrade the packages you think might be broken.
This command displays the last 5000 lines of your Pacman Log and makes it searchable with fzf. Please note that all selected lines (toggle selection with your TAB key) will get added to file /tmp/pacui-log.
\e[1mDOWNGRADE PACKAGES
\e[36m"downgrade <PACKAGE NAME>"
Manjaro and Arch Linux use a rolling release development model. This means ALL packages on your system continuously get updated to the latest version. If the latest version of a packages does not work on your system, you can downgrade that package to an earlier, working version.
Expand Down Expand Up @@ -1765,20 +1699,10 @@ do
;;


info|information)
func_info
echo
echo " Package information displayed. To return to PacUI press ENTER "
read
;;
ls|listsizes)
func_ls
echo
;;
log)
func_log
echo
;;
d|down|downgrade)
func_d
echo
Expand Down

0 comments on commit e767628

Please sign in to comment.