Code Monkey home page Code Monkey logo

yup's Introduction

An AUR helper and more

AUR version AUR bin version GitHub GitHub contributors

Yup helps you install packages with ease on Arch Linux

Features

  • Searching with yup [search-terms] returns most accurate results

  • Uses ncurses to display search results. This allows for mouse interaction in the terminal and easier navigation. asciicast

  • Don't want to use ncurses? Use yup -n to use non-ncurses mode

  • Want to search the AUR exclusively? Use yup -a

  • Like yay, type yup to run a system upgrade.

  • An easy to use config file located at ~/.config/yup/config.json in JSON format.

  • Want to see which packages are cluttering up your system? Run yup -Qos to get a list ordered package size.

Configuration

  • Config file found at ~/.config/yup/config.json.
  • The config file has the following options:
      {
      	SortMode:         "closest"|"none", # changes how results are sorted (more to come)
      	Ncurses:          bool, # Whether to default to ncurses or not (override by -n)
      	Update:           bool, # Whether to update the pacman repos before every sync command
      	PrintPkg:         bool, # Whether to print the PKGBUILD before install (for AUR)
      	AskPkg:           bool, # Whether to ask to edit PKGBUILD before install (only if PrintPkg is true)
      	AskRedo:          bool, # Whether to ask if you want to reselect packages before install
      	SilentUpdate:     bool, # Whether you want to be asked to edit PKGBUILD during system update (overrides PrintPkg)
      	PacmanLimit:      int,  # The number of packages parsed from pacman to be sorted and searched
      	AurLimit:         int,  # The number of packages parsed from the AUR to be sorted and searched
      	VimKeybindings:   bool, # Enabling Vim keybindings (j and k keys to go up and down)
      }
    

Usage

    yup                 Updates AUR and pacman packages (Like -Syu)
    yup <package(s)>    Searches for that packages and provides an install dialogue
Operations:
    yup {-h --help}
    yup {-V --version}
    yup {-D --database} <options> <package(s)>
    yup {-F --files}    <options> <package(s)>
    yup {-Q --query}    <options> <package(s)>
    yup {-R --remove}   <options> <package(s)>
    yup {-S --sync}     <options> <package(s)>
    yup {-T --deptest}  <options> <package(s)>
    yup {-U --upgrade}  <options> <file(s)>
Custom operations:
    yup -c              Cleans cache and unused dependencies
    yup -C              Cleans AUR cache only
    yup -a [package(s)] Operates on the AUR exclusively
    yup -n [package(s)] Runs in non-ncurses mode
    yup -Y <Yupfile>    Install packages from a Yupfile
    yup -Qos            Orders installed packages by install size

Differences between yay or trizen

  • Yup gives you the most accurate results first. As seen in the example above, yup sorts the results to bring the most accurate to the start.

  • Yupfiles are small files that allow you to batch install packages with a single command. Here's an example Yupfile

  • Yup uses ncurses. This allows users to both scroll while not displacing the bottom bar and easily navigate to certain results using more natural forms of user input.

  • Yup has an easy config file seperate to that of pacman's. This allows it to be more customisable from the get go.

  • Yup has both yup -c (for clearing all package cache) and yup yup -C (for clearing yup's cache only).

  • Yup allows you to disable ncurses mode (to normal terminal output) using yup -n temporarily or permanently by changing a value in the config file.

  • In the search menu, yup allows you to remove an installed package instantly using the R hotkey.

  • After selecting packages to install, you can revise your decision if you made a mistake.

  • Yup will soon allow you to disable any of the dialogue during install using the config menu.

Installing

From the AUR

  1. git clone https://aur.archlinux.org/yup.git
  2. cd yup
  3. makepkg -si

From the AUR (binary)

  1. git clone https://aur.archlinux.org/yup-bin.git
  2. cd yup-bin
  3. makepkg -si

From source

Make sure you have go>=1.12, ncurses and make.

  1. Clone the repo
  2. Run make
  3. Install with make install

Completions not working on zsh

  • You'll need to add compaudit && compinit to the bottom of your .zshrc

Credits

Copyright 2019 Eric Moynihan

Inspired by Jguer's yay

yup's People

Contributors

atemu avatar ballasi avatar ericm avatar gal avatar juergenhoetzel avatar sbhojani avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yup's Issues

Cannot Install via yay on Manjaro ARM (Raspberry Pi 4b)

Are you on latest version of yup?

Yes

Steps to Reproduce the Problem

Meanwhile, on my new 8GB Raspberry Pi 4b running 64-bit Manjaro Linux...

  1. ] yay yup
  2. Choose 1 --> aur/yup
  3. Yay attempts to install yup and fails with this error:
Cloning into 'yup'...
done.
Switched to a new branch 'makepkg'
==> Starting prepare()...
go get
go: downloading github.com/Jguer/go-alpm v0.0.0-20191122171459-5cffc6e8fc69
go: downloading github.com/ericm/goncurses v0.0.0-20190629180204-4f42246a7bb5
go: downloading github.com/mikkeloscar/aur v0.0.0-20190424180024-f956f121b3fa
go: downloading github.com/Morganamilo/go-srcinfo v1.0.0
# github.com/Jguer/go-alpm
../../../../../go/pkg/mod/github.com/!jguer/[email protected]/handle.go:430:10: could not determine kind of name for C.alpm_option_get_arch
../../../../../go/pkg/mod/github.com/!jguer/[email protected]/handle.go:436:10: could not determine kind of name for C.alpm_option_set_arch
make: *** [Makefile:10: build] Error 2
==> ERROR: A failure occurred in prepare().
    Aborting...
error making: yup

Other Details

  1. Running sudo yay failed with an error. Apparently you're not supposed to do this.
  2. I'm new to yay, since the cli version of pamac is not an option on this Pi, and I'm not sure how to tell if I'm actually supposed to be able to build this on an ARMv8 (64-bit) device.

Thanks!

panic after refusing to install dependencies

Are you on latest version of yup?

Yes (yup-bin 1.1.7-1)

Steps to Reproduce the Problem

  1. yup dotbare, install
  2. refuse installing ruby (Numbers of packages not to install? (eg: 1 2 3, 1-3 or ^4): 1)
  3. refuse installing ruby-rdoc rubygems (Numbers of packages not to install? (eg: 1 2 3, 1-3 or ^4): 1 2 or 1-2)
  4. slice bounds out of range

Other Details

yup dotbare
[...removed for brevity...]
==> View, see Diffs or Edit the PKGBUILD? (All or None):
==> Checking for dependencies
==> Found uninstalled Dependencies:
    1 ruby
==> Numbers of packages not to install? (eg: 1 2 3, 1-3 or ^4): 1
==> Found uninstalled Make Dependencies:
    1 ruby-rdoc  2 rubygems
==> Numbers of packages not to install? (eg: 1 2 3, 1-3 or ^4): 1-2
panic: runtime error: slice bounds out of range [2:1]

goroutine 1 [running]:
github.com/ericm/yup/sync.ParseNumbersDep({0xc00041c98c, 0xc000010018}, 0xc0004eae78)
	/home/eric/yup/sync/sync.go:232 +0x2cd
github.com/ericm/yup/sync.(*PkgBuild).Install(0xc00010c630, 0x0, 0x0)
	/home/eric/yup/sync/sync.go:458 +0x149d
github.com/ericm/yup/sync.Sync({0xc0004eb4e0, 0x1, 0x0}, 0x1, 0x0)
	/home/eric/yup/sync/sync.go:99 +0x1c5
github.com/ericm/yup/search.SortPacks({0x7ffe02d3f929, 0xc000095cb0}, {0xc00012c2c0, 0x1, 0x1})
	/home/eric/yup/search/search.go:475 +0x4bb
github.com/ericm/yup/cmd.(*Arguments).getActions(0x901a60)
	/home/eric/yup/cmd/cmd.go:222 +0x1379
github.com/ericm/yup/cmd.Execute()
	/home/eric/yup/cmd/cmd.go:102 +0x15f
main.main()
	/home/eric/yup/main.go:42 +0xef

newPacks = append(newPacks[:i], newPacks[i+1:]...)

I have not tried with other packages but looks like it's unrelated. By the way those Ruby dependencies are optional for this package:

depends=('fzf')
optdepends=(
    'tree: Provide a directory tree view when finding directory'
    'bat: Syntax highlighting when previewing files'
    'highlight: Syntax highlighting when previewing files'
    'ruby-coderay: Syntax highlighting when previewing files'       # <==
    'git-delta: Fancy git diff preview'
    'diff-so-fancy: Fancy git diff preview')

and fzf, tree, bat, git-delta were already installed.

P.S. nice work, I love TUI programs. Page up/down would be nice to have while I'm at it.

Fix range selectors

In ncurses mode, when going outside the size of results in range selection, it clears the results

(Hardcoded) background color distracting on selection screen

Are you on latest version of yup?

Yes

Steps to Reproduce the Problem

  1. Install yup
  2. Run yup in any terminal emulator with yup yay or any other parameter
  3. See selection with background too light or too dark

Other Details

Heya, thanks so much, what a good idea, I like yup and would love to use it instead of yay.
I am using Alacritty as my terminal emulator.
It has a dark background with my theme and I would expect the yup selection screen to have the same background color, similar to yay where it does not change at all. I tried in VSCode's terminal emulator and in that the background becomes black instead.

Is the background color hardcoded into yup? Can that setting be removed or made an option in the settings?

Here is a demo, the yay screen is fine, the yup screen is too light:

yup.webm

I hope you can reproduce this and take a look.
Thank you

Add support for Page Up, Page Down, Home, End keys

Are you on latest version of yup?

Yes

Steps to Reproduce the Problem

  1. run yup
  2. press page up key

Other Details

Some of us old timers still use those keys. They are right there above the arrow keys on my Model M, and can come in quite handy.

Option to automatically confirm updates of packages

Currently after every package is built there is a confirmation to install it, which is annoying because it requires being at the desk the whole update process and stops building other packages until confirmation is complete, so it'd be really useful to have an option to automatically confirm installs

Improved PKGBUILD

The prefix in the Makefile should be /usr, not /usr/local. I wasn't able to use make install as it lacks a DESTDIR variable.

pkgname=yup-git
pkgver=v0.1.8.beta.r0.g2899650
pkgrel=1
pkgdesc="Ncurses based AUR Helper with improved searching and sorting"
arch=('any')
url="https://github.com/ericm/yup"
license=('GPL3')
depends=('pacman>=5.1' 'git' 'ncurses' 'sudo')
makedepends=('go')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=('git+https://github.com/ericm/yup.git')
sha256sums=('SKIP')

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

build() {
	cd "$srcdir/${pkgname%-git}"
	make prefix=/usr
}

package() {
	cd "$srcdir/${pkgname%-git}"
	install -Dm755 "${pkgname%-git}" "$pkgdir/usr/bin/${pkgname%-git}"
	install -Dm755 completions/zsh \
		"$pkgdir/usr/share/zsh/site-functions/completions/_${pkgname%-git}"
}

sudo dependency

Why do I need to install sudo when I can use doas?
Why does yup force me to install sudo?
Can I specify an alternative to sudo?

Running `yup make` returns index out of range

[seqularise@desktop ~]$ yup make
==> Searching and sorting your query...
panic: runtime error: index out of range

goroutine 20 [running]:
github.com/ericm/yup/search.Pacman(0x7ffc745429ff, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /home/seqularise/.cache/yay/yup/src/yup/search/search.go:184 +0x1372
github.com/ericm/yup/cmd.(*Arguments).getActions.func2(0x9b4f60, 0xc00007ec50, 0xc0000741e0)
        /home/seqularise/.cache/yay/yup/src/yup/cmd/cmd.go:184 +0x54
created by github.com/ericm/yup/cmd.(*Arguments).getActions
        /home/seqularise/.cache/yay/yup/src/yup/cmd/cmd.go:182 +0x7c9
[seqularise@desktop ~]$

Cannot install/update PhpStorm

Hi there, I`ve been getting these error for more then half year every time I want to update phpstorm

==> Starting package_phpstorm()...
cp: cannot stat '/home/pnagornyak/.cache/yup/phpstorm/src/PhpStorm-193.5233.101PhpStorm/': No such file or directory
==> ERROR: A failure occurred in package_phpstorm().
    Aborting...
==> exit status 4

I don`t really know what can cause such issue, but if I download PKGBUILD from AUR and just build it manually everything works, could you help me find out what is wrong here?

Hangs at checking for dependencies during update?

OS: EndeavourOS
When doing an AUR update with yup -Syua, the checking for dependencies takes a very long time, so I usually stop it, as there are no signs of progress whatsoever even after 30-45 minutes.

Does yup usually check for dependencies of all the updating applications at once, or one by one?

Figuring out which packages from the AUR need to be updated on my system works just fine:

step1yup

  1. But after that, yup seems to either hang, or perhaps should I wait for such a long time?
    step2yup2hangs

cgo compiler errors against go-alpm

Are you on latest version of yup?

Yes, I am trying to build from the aur. I've also tried the current master branch from github as well as the most recent tag

Steps to Reproduce the Problem

  1. git clone https://aur.archlinux.org/yup.git
    1.cd yup && makepkg -si
# github.com/Jguer/go-alpm/v2
/home/plyons/go/pkg/mod/github.com/!jguer/go-alpm/[email protected]/db.go:148:103: cannot use _cgo0 (variable of type *_Ctype_struct___alpm_list_t) as *_Ctype_struct__alpm_list_t value in argument to _Cfunc_alpm_find_group_pkgs
/home/plyons/go/pkg/mod/github.com/!jguer/go-alpm/[email protected]/deps.go:22:75: cannot use _cgo0 (variable of type *_Ctype_struct___alpm_handle_t) as *_Ctype_struct__alpm_handle_t value in argument to _Cfunc_alpm_find_dbs_satisfier
/home/plyons/go/pkg/mod/github.com/!jguer/go-alpm/[email protected]/deps.go:22:75: cannot use _cgo1 (variable of type *_Ctype_struct___alpm_list_t) as *_Ctype_struct__alpm_list_t value in argument to _Cfunc_alpm_find_dbs_satisfier
/home/plyons/go/pkg/mod/github.com/!jguer/go-alpm/[email protected]/deps.go:38:78: cannot use _cgo0 (variable of type *_Ctype_struct___alpm_list_t) as *_Ctype_struct__alpm_list_t value in argument to _Cfunc_alpm_find_satisfier
/home/plyons/go/pkg/mod/github.com/!jguer/go-alpm/[email protected]/package.go:69:53: cannot use _cgo0 (variable of type *_Ctype_struct___alpm_list_t) as *_Ctype_struct__alpm_list_t value in argument to _Cfunc_alpm_list_count
/home/plyons/go/pkg/mod/github.com/!jguer/go-alpm/[email protected]/package.go:70:34: cannot use _cgo0 (variable of type *_Ctype_struct___alpm_list_t) as *_Ctype_struct__alpm_list_t value in argument to _Cfunc_alpm_list_msort
make: *** [Makefile:11: build] Error 1
==> ERROR: A failure occurred in prepare().
    Aborting...

Other Details

This only recently started happening with an arch system update.

Yup -c failed when there is no unused dependencies to uninstall

The issue is in the file clean/clean.go

// Clear unused packs
output.Printf("Finding unused dependencies")
pac := exec.Command("pacman", "-Qtdq")
var packs []string
if out, err := pac.Output(); err == nil {
	for _, pack := range strings.Split(string(out), "\n") {
		if len(pack) > 1 {
			packs = append(packs, pack)
		}
	}
}

When there is no unused dependencies, packs should be empty

packs = append([]string{"pacman", "-Rns"}, packs...)
rem := exec.Command("sudo", packs...)
output.SetStd(rem)
if err := rem.Run(); err != nil {
	return err
}


return nil

This statement should be run only if packs isn't empty.

Wrong config file options in readme?

I believe that this part of documentation is not as intended :)

Configuration

  • Config file found at ~/.config/yup/config.json.
  • The config file has the following options:
    {
    )
    )
    d
    )
    )
    l
    )
    d
    d
    )
    }
    
    

Viewing diffs for a package with update fails

I recently tried out yup and just used it do do updates.

After printing the PKGBUILD of a package which has an available update it asks me what to do. I chose see Diff by pressing D after which it generated the following output:

==> View, see Diffs or Edit the PKGBUILD? (All or None): D
fatal: ambiguous argument '@~..@': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
==> Continue?:

It should be noted that the directory yup tries to do the diff in was previously managed by yay as that is my current main package manager.

Yup shows AUR packages to "downgrade"

YUP will show packages that were locally built (newer) than their AUR counterparts and ask if you want to "update" those packages:
image

Using YAY, it will show that the local packages are newer, but will not prompt to update.
image

It would nice to be able to either set a config option or have a similar experience to YAY.

I like YUP! MUCH easier to search AUR.

Thanks!

not able to get correct path of split packages

pkgbase is handbrake-git

LC_ALL=C yup -S handbrake-gtk-git                                                                                                                                                                    jan@royal-ts
==> Installing handbrake-gtk-git 1:1.2.0.r377.ga5590df40-1 from the AUR
==> PKGBUILD:
cat: PKGBUILD: No such file or directory

==> View, see Diffs or Edit the PKGBUILD? (All or None): n
==> Checking for dependencies
==> Unable to read file: .SRCINFO: open .SRCINFO: no such file or directory

sure yup is looking for/handbrake-gtk-git not /handbrake-git

Some AUR packages are in to update instead of previous section

I have multiple packages installed from AUR which are offered for update every time I run yup but IMHO they shouldn't.

I.e. in todays output:

==> Checking for AUR updates...

==> Found 2 local package(s) that are newer than their AUR package
    numix-icon-theme-pack-git  r6767-1 has AUR version r6086-1
    ttf-consolas-with-yahei-powerline-git  r.-1 has AUR version r14.b6e9163-1

==> Found 7 AUR package(s) to update:
    1   mbsync-git 946.cab1460-1 -> 912.95d18e2-1
    2   mu-git 1.4.7.119.g6cea9fcd-1 -> 1.3.6.114.g0dced59c-1
    3   qutebrowser-git 1.13.1.r269.gcee5d0b0d-1 -> 1.13.0.r2.gcb15192cd-1
    4   screenkey-git 1.1.r12.ge812693-1 -> 1.1.r5.g467662b-1
    5   ttf-iosevka-ss05 3.3.0-1 -> 3.3.1-1
    6   ttf-iosevka-term-ss05 3.2.2-1 -> 3.3.1-1
    7   ttf-nerd-fonts-hack-complete-git 20200723-1 -> 20180330-1

I believe that 1, 2, 3, 4 and 7 are more recent then AUR versions and should be in "found X local pcakges that are newer" section.

If I'm right, it seems that newerVersion function might be to blame:

func newerVersion(oldVersion, newVersion string) bool {

I'm not really fluent in Go and I'm not sure if I'm correct so no pull request (at least for now).

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.