From a71784684c4ab974d470211414f36476e551f421 Mon Sep 17 00:00:00 2001 From: morganamilo Date: Mon, 4 Jun 2018 19:16:43 +0100 Subject: [PATCH 1/4] Add new options to usage --- cmd.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cmd.go b/cmd.go index ad6dd4da..1fe1cdcf 100644 --- a/cmd.go +++ b/cmd.go @@ -35,6 +35,9 @@ New operations: yay {-P --print} [options] yay {-G --getpkgbuild} [package(s)] +New options: + --repo Assume targets are from the repositories + -a --aur Assume targets are from the AUR Permanent configuration options: --save Causes the following options to be saved back to the config file when used @@ -53,7 +56,7 @@ Permanent configuration options: --config pacman.conf file to use --requestsplitn Max amount of packages to query per AUR request - --sortby Sort AUR results by a specific field during search + --sortby Sort AUR results by a specific field during search --answerclean Set a predetermined answer for the clean build menu --answeredit Set a predetermined answer for the edit pkgbuild menu --answerupgrade Set a predetermined answer for the upgrade menu @@ -70,6 +73,8 @@ Permanent configuration options: --nodevel Do not check development packages --gitclone Use git clone for PKGBUILD retrieval --nogitclone Never use git clone for PKGBUILD retrieval + --showdiffs Show diffs for build files + --noshowdiffs Always show the entire PKGBUILD --rebuild Always build target packages --rebuildall Always build all AUR packages --norebuild Skip package build if in cache and up to date @@ -77,6 +82,10 @@ Permanent configuration options: --redownload Always download pkgbuilds of targets --noredownload Skip pkgbuild download if in cache and up to date --redownloadall Always download pkgbuilds of all AUR packages + --provides Look for matching provders when searching for packages + --noprovides Just look for packages by pkgname + --pgpfetch Prompt to import PGP keys from PKGBUILDs + --nopgpfetch Don't prompt to import PGP keys --sudoloop Loop sudo calls in the background to avoid timeout --nosudoloop Do not loop sudo calls in the background From 63509365c1c061e2fd3fe7b429cc27922d0b048c Mon Sep 17 00:00:00 2001 From: morganamilo Date: Mon, 4 Jun 2018 19:22:16 +0100 Subject: [PATCH 2/4] Add less not always paging to the faq --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 28e6b90a..85a46d13 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,12 @@ Currently yay Depends on: * Yay does not display colored output. How do I fix it? Make sure you have the `Color` option in your `/etc/pacman.conf` [#123](https://github.com/Jguer/yay/issues/123) +* Sometimes diffs are printed to the terminal and other times they are pages + via less. How do I fix this? + Yay uses `git diff` to display diffs, by default git tells less to not page + if the output can fit one terminal length. This can be overridden by + exporting your own flags `export LESS=SRX`. + ## Examples of Custom Operations * `yay ` presents package selection menu From 6c22d5987cef7711f47eda1f191fcbd1c083b590 Mon Sep 17 00:00:00 2001 From: morganamilo Date: Mon, 4 Jun 2018 20:00:01 +0100 Subject: [PATCH 3/4] Update man page --- doc/yay.8 | 104 ++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 78 insertions(+), 26 deletions(-) diff --git a/doc/yay.8 b/doc/yay.8 index 74bc218c..9b65a740 100644 --- a/doc/yay.8 +++ b/doc/yay.8 @@ -1,5 +1,5 @@ '\" t -.TH "YAY" "8" "2018-02-29" "Yay v3\&.460+" "Yay Manual" +.TH "YAY" "8" "2018\-06\-04" "Yay v6\&.784+" "Yay Manual" .nh .ad l .SH "NAME" @@ -20,29 +20,29 @@ This manpage only covers options unique to Yay\&. For other options see \fBpacman(8)\fR\&. .SH "YAY OPERATIONS" .PP -\fB\-Y, --yay\fR +\fB\-Y, \-\-yay\fR .RS 4 Perform yay specific operations\&. This is the default if no other operation is selected\&. .RE .PP -\fB\-P, --print\fR +\fB\-P, \-\-print\fR .RS 4 Perform yay specific print operations\&. .RE .PP -\fB\-G, --getpkgbuild\fR +\fB\-G, \-\-getpkgbuild\fR .RS 4 Downloads PKGBUILD from ABS or AUR\&. .RE .PP -If no arguments are provided 'yay -Syu' will be performed\&. +If no arguments are provided 'yay \-Syu' will be performed\&. .RE .PP -If no operation is selected -Y will be assumed\&. +If no operation is selected \-Y will be assumed\&. .SH "EXTENDED PACMAN OPERATIONS" .PP -\fB\-S, -Si, -Ss, -Su, -Sc, -Qu\fR +\fB\-S, \-Si, \-Ss, \-Su, \-Sc, \-Qu\fR .RS 4 These operations are extended to support both AUR and repo packages\&. .RE @@ -58,9 +58,23 @@ sources or built packages but will keep already downloaded vcs sources\&. \fB\-R\fR .RS 4 Yay will also remove cached data about devel packages\&. - .RE -.SH "YAY OPTIONS (APPLY TO -Y AND --YAY)" +.SH "NEW OPTIONS" +.PP +\fB \-\-repo\fR +.RS 4 +Assume all targets are from the repositories\&. Aditionally Actions such as +sysupgrade will only act on repository packages\&. +.RE +\fB\-a \-\-aur\fR +.RS 4 +Assume all targets are from the AUR\&. Aditionally Actions such as +sysupgrade will only act on AUR packages\&. + +Note that dependency resolving will still act as normal and include repository +packages\&. +.RE +.SH "YAY OPTIONS (APPLY TO \-Y AND \-\-YAY)" .PP \fB\fR .RS 4 @@ -80,7 +94,7 @@ used when migrating to Yay from another AUR helper. .RS 4 Remove unneeded dependencies\&. .RE -.SH "PRINT OPTIONS (APPLY TO -P AND --PRINT)" +.SH "PRINT OPTIONS (APPLY TO \-P AND \-\-PRINT)" \fB\-c \-\-complete\fR .RS 4 Print a list of all AUR and repo packages\&. This is to allow shell completion @@ -105,30 +119,30 @@ Print current yay configuration\&. \fB\-n \-\-numberupgrades\fR .RS 4 Print number of packages that need to be updated\&. Note this does not perform -a database refresh\&. Run \fByay -Sy\fR Before this for an up to date result\&. +a database refresh\&. Run \fByay \-Sy\fR Before this for an up to date result\&. .RE .PP \fB\-s \-\-stats\fR .RS 4 Displays information about installed packages and system health\&. If there are -orphaned, out-of-date or packages that no longer exist on the AUR warnings will +orphaned, out\-of\-date or packages that no longer exist on the AUR warnings will be displayed\&. .RE .PP \fB\-u \-\-upgrades\fR .RS 4 Print Names of packages that need to be updated\&. Note this does not perform -a database refresh\&. Run \fByay -Sy\fR Before this for an up to date result\&. +a database refresh\&. Run \fByay \-Sy\fR Before this for an up to date result\&. .RE .PP -\fB\-w --news\fR +\fB\-w \-\-news\fR .RS 4 Print new news from the Archlinux homepage\&. News is considered new if it is newer than the build date of all native packages\&. Pass this twice to show all avaliable news\&. .RE .PP -\fB\-q --quiet\fR +\fB\-q \-\-quiet\fR .RS 4 Only show titles when printing news\&. .RE @@ -271,9 +285,9 @@ Do not check for development packages updates during sysupgrade\&. \fB\-\-gitclone\fR .RS 4 Use git to download and update PKGBUILDs\&. PKGBUILDs previously downloaded -using tarball will continue to use tarballs until the package is clean built\&. -Similarly, PKGBUILDs managed with git will continue to use git until the package -is clean built.\&. +using tarball will continue to use tarballs until the package is clean +built\&. Similarly, PKGBUILDs managed with git will continue to use git until +the package is clean built.\&. .RE .PP \fB\-\-nogitclone\fR @@ -282,6 +296,18 @@ Download and update PKGBUILDs using tarballs\&. The above conditions about previously installed packages still apply\&. .RE .PP +\fB\-\-showdiffs\fR +.RS 4 +Show diffs for build files\&. Diffs are shown via \fBgit diff\fR which uses +less by default\&. This behaviour can be changed via git's config, the +\fB$GIT_PAGER\fR or \fB$PAGER\fR environment variables\&. +.RE +.PP +\fB\-\-noshowdiffs\fR +.RS 4 +Show diffs for build files\&. Files will be opened by the editor\%. +.RE +.PP \fB\-\-afterclean\fR .RS 4 Remove package sources after successful Install\&. @@ -320,6 +346,32 @@ When downloading pkgbuilds if the pkgbuild is found in cache and is equal or newer than the AUR's version use that instead of downloading a new one\&. .RE .PP +\fB\-\-provides\fR +.RS 4 +Look for matching providers when searching for AUR packages\&. When multiple +providers are found a menu will appear prompting you to pick one\&. This +increases dependency resolve time although this should not be noticable\&. +.RE +.PP +\fB\-\-noprovides\fR +.RS 4 +Do not look for matching providers when searching for AUR packages\&. If +multiple providers happen to be found the menu will still apear\&. +.RE +.PP +\fB\-\-pgpfetch\fR +.RS 4 +Prompt to import unknown PGP keys from the \fBvalidpgpkeys\fR field of each +PKGBUILD. +.RE +.PP +\fB\-\-pgpfetch\fR +.RS 4 +Do not prompt to import unknown PGP keys\&. This is likley to cause a build +failiure unless using options such as \fB\-\-skippgpcheck\fR or a customized +gpg config\%. +.RE +.PP \fB\-\-rebuild\fR .RS 4 Always build target packages even when a copy is available in cache\&. @@ -378,37 +430,37 @@ yay \fIfoo\fR Search and install from the repos and the \fBAUR\fR\ using yogurt mode\&. .RE .PP -yay -Syu +yay \-Syu .RS 4 Update package list and upgrade all currently installed repo and \fBAUR\fR\&. .RE .PP -yay -S \fIfoo\fR +yay \-S \fIfoo\fR .RS 4 Installs package \fIfoo\fR from the repos or the \fBAUR\fR\&. .RE .PP -yay -Ss \fIfoo\fR +yay \-Ss \fIfoo\fR .RS 4 Searches for package \fIfoo\fR on the repos or the \fBAUR\fR\&. .RE .PP -yay -Si \fIfoo\fR +yay \-Si \fIfoo\fR .RS 4 Gets information about package \fIfoo\fR from the repos or the \fBAUR\fR\&. .RE .PP -yay -S \fIfoo\fR --mflags "--skipchecksums --skippgpcheck" +yay \-S \fIfoo\fR \-\-mflags "\-\-skipchecksums \-\-skippgpcheck" .RS 4 Installs \fIfoo\fR while skipping checksums and pgp checks\&. .RE .PP -yay --devel --save +yay \-\-devel \-\-save .RS 4 Sets devel to true in the config\&. .RE .PP -yay -P --stats +yay \-P \-\-stats .RS 4 Shows statistics for installed packages and system health\&. .RE @@ -448,7 +500,7 @@ and built packages from those packages\&. \fBPACMAN.CONF\fR .RS 4 Yay uses Pacman's config file to set certain pacman options either through -go-alpm or Yay itself. Options inherited include most libalpm options and +go\-alpm or Yay itself. Options inherited include most libalpm options and pacman options\&. .PP Notably \fBDatabases\fR, \fBColor\fR and \fB*Path/*Dir\fR options are used\&. From bad0af1a8a0c713fb920e3df07cf7b5167ab73ef Mon Sep 17 00:00:00 2001 From: morganamilo Date: Mon, 4 Jun 2018 20:12:26 +0100 Subject: [PATCH 4/4] Fix typos --- depPool.go | 18 +++++++++--------- doc/yay.8 | 10 +++++----- vcs.go | 4 ++-- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/depPool.go b/depPool.go index 2b87ca64..ef6ee0a1 100644 --- a/depPool.go +++ b/depPool.go @@ -92,7 +92,7 @@ func (dp *depPool) ResolveTargets(pkgs []string) error { // skip targets already satisfied // even if the user enters db/pkg and aur/pkg the latter will - // still get skiped even if it's from a different database to + // still get skipped even if it's from a different database to // the one specified // this is how pacman behaves if dp.hasPackage(target.DepString()) { @@ -109,7 +109,7 @@ func (dp *depPool) ResolveTargets(pkgs []string) error { continue } - // if theres a different priefix only look in that repo + // If there'ss a different priefix only look in that repo if target.Db != "" { singleDb, err = alpmHandle.SyncDbByName(target.Db) if err != nil { @@ -128,11 +128,11 @@ func (dp *depPool) ResolveTargets(pkgs []string) error { continue } else { //check for groups - //currently we dont resolve the packages in a group + //currently we don't resolve the packages in a group //only check if the group exists //would be better to check the groups from singleDb if - //the user specified a db but theres no easy way to do - //it without making alpm_lists so dont bother for now + //the user specified a db but there's no easy way to do + //it without making alpm_lists so don't bother for now //db/group is probably a rare use case group, err := dp.SyncDb.PkgCachebyGroup(target.Name) if err == nil { @@ -167,7 +167,7 @@ func (dp *depPool) ResolveTargets(pkgs []string) error { // // For example if you were to -S yay then yay -Ss would give: // yay-git yay-bin yay realyog pacui pacui-git ruby-yard -// These packages will all be added to the cache incase they are needed later +// These packages will all be added to the cache in case they are needed later // Ofcouse only the first three packages provide yay, the rest are just false // positives. // @@ -315,7 +315,7 @@ func (dp *depPool) resolveAURPackages(pkgs stringSet, explicit bool) error { } //assume it's in the aur - //ditch the versioning because the RPC cant handle it + //ditch the versioning because the RPC can't handle it newAURPackages.set(dep) } @@ -376,8 +376,8 @@ func (dp *depPool) findSatisfierAur(dep string) *rpc.Pkg { // This is mostly used to promote packages from the cache // to the Install list -// Provide a pacman style provider menu if theres more than one candidate -// This acts slightly differenly from Pacman, It will give +// Provide a pacman style provider menu if there's more than one candidate +// This acts slightly differently from Pacman, It will give // a menu even if a package with a matching name exists. I believe this // method is better because most of the time you are choosing between // foo and foo-git. diff --git a/doc/yay.8 b/doc/yay.8 index 9b65a740..642fae28 100644 --- a/doc/yay.8 +++ b/doc/yay.8 @@ -63,12 +63,12 @@ Yay will also remove cached data about devel packages\&. .PP \fB \-\-repo\fR .RS 4 -Assume all targets are from the repositories\&. Aditionally Actions such as +Assume all targets are from the repositories\&. Additionally Actions such as sysupgrade will only act on repository packages\&. .RE \fB\-a \-\-aur\fR .RS 4 -Assume all targets are from the AUR\&. Aditionally Actions such as +Assume all targets are from the AUR\&. Additionally Actions such as sysupgrade will only act on AUR packages\&. Note that dependency resolving will still act as normal and include repository @@ -139,7 +139,7 @@ a database refresh\&. Run \fByay \-Sy\fR Before this for an up to date result\&. .RS 4 Print new news from the Archlinux homepage\&. News is considered new if it is newer than the build date of all native packages\&. Pass this twice to show all -avaliable news\&. +available news\&. .RE .PP \fB\-q \-\-quiet\fR @@ -350,13 +350,13 @@ newer than the AUR's version use that instead of downloading a new one\&. .RS 4 Look for matching providers when searching for AUR packages\&. When multiple providers are found a menu will appear prompting you to pick one\&. This -increases dependency resolve time although this should not be noticable\&. +increases dependency resolve time although this should not be noticeable\&. .RE .PP \fB\-\-noprovides\fR .RS 4 Do not look for matching providers when searching for AUR packages\&. If -multiple providers happen to be found the menu will still apear\&. +multiple providers happen to be found the menu will still appear\&. .RE .PP \fB\-\-pgpfetch\fR diff --git a/vcs.go b/vcs.go index e64b32cf..e9b695b7 100644 --- a/vcs.go +++ b/vcs.go @@ -18,7 +18,7 @@ type vcsInfo map[string]shaInfos type shaInfos map[string]shaInfo type shaInfo struct { Protocols []string `json:"protocols"` - Brach string `json:"branch"` + Branch string `json:"branch"` SHA string `json:"sha"` } @@ -180,7 +180,7 @@ func (infos shaInfos) needsUpdate() bool { hasUpdate := make(chan struct{}) checkHash := func(url string, info shaInfo) { - hash := getCommit(url, info.Brach, info.Protocols) + hash := getCommit(url, info.Branch, info.Protocols) if hash != "" && hash != info.SHA { hasUpdate <- struct{}{} } else {