diff --git a/cmd.go b/cmd.go index 8c4b7b63..e3f9e217 100644 --- a/cmd.go +++ b/cmd.go @@ -31,12 +31,20 @@ func usage() { yay -G [package(s)] get pkgbuild from ABS or AUR yay --gendb generates development package DB used for updating. - New options: + Permanent configuration options: --topdown shows repository's packages first and then aur's --bottomup shows aur's packages first and then repository's - --noconfirm skip user input on package install --devel Check -git/-svn/-hg development version - --nodevel Disable development version checking`) + --nodevel Disable development version checking + --afterclean Clean package sources after successful build + --noafterclean Disable package sources cleaning after successful build + --timeupdate Check package's modification date and version + --notimeupdate Check only package version change + + New options: + --noconfirm skip user input on package install + --printconfig Prints current yay configuration + `) } func init() { @@ -155,8 +163,12 @@ func parser() (op string, options []string, packages []string, changedConfig boo if strings.HasPrefix(arg, "--") { changedConfig = true switch arg { + case "--afterclean": + config.CleanAfter = true + case "--noafterclean": + config.CleanAfter = false case "--printconfig": - fmt.Printf("%+v", config) + fmt.Printf("%#v", config) os.Exit(0) case "--gendb": err = createDevelDB() diff --git a/config.go b/config.go index cde1d4b4..a5ef658c 100644 --- a/config.go +++ b/config.go @@ -27,6 +27,7 @@ const ( // Configuration stores yay's config. type Configuration struct { BuildDir string `json:"buildDir"` + CleanAfter bool `json:"cleanAfter"` Editor string `json:"editor"` MakepkgBin string `json:"makepkgbin"` Shell string `json:"-"` @@ -41,7 +42,7 @@ type Configuration struct { Devel bool `json:"devel"` } -const version = "2.201" +const version = "2.217" // baseURL givers the AUR default address. const baseURL string = "https://aur.archlinux.org" @@ -106,6 +107,7 @@ func defaultSettings(config *Configuration) { panic(err) } config.BuildDir = fmt.Sprintf("/tmp/yaytmp-%s/", u.Uid) + config.CleanAfter = false config.Editor = "" config.Devel = false config.MakepkgBin = "/usr/bin/makepkg" diff --git a/install.go b/install.go index 216479c7..23ff8039 100644 --- a/install.go +++ b/install.go @@ -164,6 +164,10 @@ func PkgInstall(a *rpc.Pkg, flags []string) (finalmdeps []string, err error) { err = makepkgcmd.Run() if err == nil { _ = saveVCSInfo() + if config.CleanAfter { + fmt.Println("\x1b[1;32m==> CleanAfter enabled. Deleting source folder.\x1b[0m") + os.RemoveAll(dir) + } } return } diff --git a/yay.8 b/yay.8 index 743ac573..bec6753b 100644 --- a/yay.8 +++ b/yay.8 @@ -66,6 +66,41 @@ Display repository packages first and then AUR packages\&. Show AUR packages first and then repository packages\&. .RE .PP +\fB\-\-devel\fR +.RS 4 +Check -git/-svn/-hg development version\&. +.RE +.PP +\fB\-\-nodevel\fR +.RS 4 +Disable development version checking\&. +.RE +.PP +\fB\-\-afterclean\fR +.RS 4 +Clean package sources after successful build\&. +.RE +.PP +\fB\-\-noafterclean\fR +.RS 4 +Disable package sources cleaning after successful build\&. +.RE +.PP +\fB\-\-timeupdate\fR +.RS 4 +Check package's modification date and version\&. +.RE +.PP +\fB\-\-notimeupdate\fR +.RS 4 +Check only package version change\&. +.RE +.PP +\fB\-\-printconfig\fR +.RS 4 +Prints current yay configuration\&. +.RE +.PP \fB\-\-noconfirm\fR .RS 4 No user intervention needed unless a package conflict happens. This option will be passed to pacman and makepkg\&. @@ -77,97 +112,97 @@ All other options will be passed to pacman\&. .sp .RS 4 .ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -Sync and update packages from repository and AUR: -yay \-Syu -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -Check installed packages health: -yay \-Qstats -.RE -.PP -.sp -For a package called \fIname\fR: -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} + \h'-04'\(bu\h'+03'\c + .\} + .el \{\ + .sp -1 + .IP \(bu 2.3 + .\} + Sync and update packages from repository and AUR: + yay \-Syu + .RE + .sp + .RS 4 + .ie n \{\ + \h'-04'\(bu\h'+03'\c + .\} + .el \{\ + .sp -1 + .IP \(bu 2.3 + .\} + Check installed packages health: + yay \-Qstats + .RE + .PP + .sp + For a package called \fIname\fR: + .sp + .RS 4 + .ie n \{\ + \h'-04'\(bu\h'+03'\c + .\} + .el \{\ + .sp -1 + .IP \(bu 2.3 + .\} Search: yay \-Ss \fIname\fR .RE .sp .RS 4 .ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} + \h'-04'\(bu\h'+03'\c + .\} + .el \{\ + .sp -1 + .IP \(bu 2.3 + .\} Install: yay \-S \fIname\fR .RE .sp .RS 4 .ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -Install without confirmations: -yay \-S \-\-noconfirm \fIname\fR -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -Get information about a package: -yay \-Si \fIname\fR -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -Search and install using yogurt mode: -yay \fIname\fR -.RE -.SH "SEE ALSO" -.sp + \h'-04'\(bu\h'+03'\c + .\} + .el \{\ + .sp -1 + .IP \(bu 2.3 + .\} + Install without confirmations: + yay \-S \-\-noconfirm \fIname\fR + .RE + .sp + .RS 4 + .ie n \{\ + \h'-04'\(bu\h'+03'\c + .\} + .el \{\ + .sp -1 + .IP \(bu 2.3 + .\} + Get information about a package: + yay \-Si \fIname\fR + .RE + .sp + .RS 4 + .ie n \{\ + \h'-04'\(bu\h'+03'\c + .\} + .el \{\ + .sp -1 + .IP \(bu 2.3 + .\} + Search and install using yogurt mode: + yay \fIname\fR + .RE + .SH "SEE ALSO" + .sp \fBmakepkg\fR(8) -.sp + .sp \fBpacman\fR(8) -.sp + .sp \fBpacman.conf\fR(5) -.SH "AUTHORS" -.sp -Jguer + .SH "AUTHORS" + .sp + Jguer