Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ pacman -S --needed git base-devel yay
| `yay -Gp <AUR Package>` | Print to stdout PKGBUILD from ABS or AUR. |
| `yay -Ps` | Print system statistics. |
| `yay -Syu --devel` | Perform system upgrade, but also check for development package updates. |
| `yay -Syu --timeupdate` | Perform system upgrade and use PKGBUILD modification time (not version number) to determine update. |
| `yay -Wu <AUR Package>` | Unvote for package (Requires setting `AUR_USERNAME` and `AUR_PASSWORD` environment variables) (yay v11.3+) |
| `yay -Wv <AUR Package>` | Vote for package (Requires setting `AUR_USERNAME` and `AUR_PASSWORD` environment variables). (yay v11.3+) |
| `yay -Y --combinedupgrade --save` | Make combined upgrade the default mode. |
Expand Down
2 changes: 0 additions & 2 deletions cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ Permanent configuration options:
--sudoflags <flags> Pass arguments to sudo
--sudoloop Loop sudo calls in the background to avoid timeout

--timeupdate Check packages' AUR page for changes during sysupgrade

show specific options (used with -P):
-c --complete Used for completions
-d --defaultconfig Print default yay configuration
Expand Down
1 change: 0 additions & 1 deletion completions/fish
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ complete -c $progname -n "not $noopt" -l doublelineresults -d 'List each search
complete -c $progname -n "not $noopt" -l devel -d 'Check -git/-svn/-hg development version' -f
complete -c $progname -n "not $noopt" -l cleanafter -d 'Clean package sources after successful build' -f
complete -c $progname -n "not $noopt" -l keepsrc -d 'Keep pkg/ and src/ after building packages' -f
complete -c $progname -n "not $noopt" -l timeupdate -d 'Check package modification date and version' -f
complete -c $progname -n "not $noopt" -l redownload -d 'Redownload PKGBUILD of package even if up-to-date' -f
complete -c $progname -n "not $noopt" -l redownloadall -d 'Redownload PKGBUILD of package and deps even if up-to-date' -f
complete -c $progname -n "not $noopt" -l noredownload -d 'Do not redownload up-to-date PKGBUILDs' -f
Expand Down
1 change: 0 additions & 1 deletion completions/zsh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ _pacman_opts_common=(
'--devel[Check -git/-svn/-hg development version]'
'--cleanafter[Clean package sources after successful build]'
'--keepsrc[Keep pkg/ and src/ after building packages]'
'--timeupdate[Check packages modification date and version]'
'--separatesources[Separate query results by source, AUR and sync]'
'(--redownloadall --noredownload)--redownload[Always download pkgbuilds of targets]'
'(--redownload --noredownload)--redownloadall[Always download pkgbuilds of all AUR packages]'
Expand Down
5 changes: 0 additions & 5 deletions doc/yay.8
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,6 @@ instead of having to reclone the entire repo.
.B \-\-keepsrc
Keep pkg/ and src/ after building packages

.TP
.B \-\-timeupdate
During sysupgrade also compare the build time of installed packages against
the last modification time of each package's AUR page.

.TP
.B \-\-separatesources
Separate query results by source, AUR and sync
Expand Down
2 changes: 0 additions & 2 deletions pkg/settings/args.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ func (c *Configuration) handleOption(option, value string) bool {
return !boolValue
case "devel":
c.Devel = boolValue
case "timeupdate":
c.TimeUpdate = boolValue
case "topdown":
c.BottomUp = false
case "bottomup":
Expand Down
1 change: 0 additions & 1 deletion pkg/settings/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ type Configuration struct {
MaxConcurrentDownloads int `json:"maxconcurrentdownloads" ini:"MaxConcurrentDownloads"`
BottomUp bool `json:"bottomup" ini:"BottomUp"`
SudoLoop bool `json:"sudoloop" ini:"SudoLoop"`
TimeUpdate bool `json:"timeupdate" ini:"TimeUpdate"`
Devel bool `json:"devel" ini:"Devel"`
CleanAfter bool `json:"cleanAfter" ini:"CleanAfter"`
KeepSrc bool `json:"keepSrc" ini:"KeepSrc"`
Expand Down
2 changes: 0 additions & 2 deletions pkg/settings/ini_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ MaxConcurrentDownloads = 4
# Boolean options
BottomUp = true
SudoLoop = false
TimeUpdate = yes
Devel = no
CleanAfter = true
KeepSrc = false
Expand Down Expand Up @@ -154,7 +153,6 @@ DoubleConfirm = false
// Boolean options
assert.True(t, cfg.BottomUp)
assert.False(t, cfg.SudoLoop)
assert.True(t, cfg.TimeUpdate)
assert.False(t, cfg.Devel)
assert.True(t, cfg.CleanAfter)
assert.False(t, cfg.KeepSrc)
Expand Down
1 change: 0 additions & 1 deletion pkg/settings/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,6 @@ func isArg(arg string) bool {
case "afterclean", "cleanafter":
case "keepsrc":
case "devel":
case "timeupdate":
case "topdown":
case "bottomup":
case "completioninterval":
Expand Down
3 changes: 1 addition & 2 deletions pkg/settings/yay.conf
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ DiffMenu
# Behavior
CombinedUpgrade
#SudoLoop
#TimeUpdate
Provides
#Provides
#UseAsk
DoubleConfirm
Rpc
Expand Down
2 changes: 1 addition & 1 deletion pkg/upgrade/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (u *UpgradeService) upGraph(ctx context.Context, graph *topo.Graph[string,

u.AURWarnings.CalculateMissing(remoteNames, remote, aurdata)

aurUp = UpAUR(u.log, remote, aurdata, u.cfg.TimeUpdate, enableDowngrade)
aurUp = UpAUR(u.log, remote, aurdata, enableDowngrade)

if u.cfg.Devel {
u.log.OperationInfoln(gotext.Get("Checking development packages..."))
Expand Down
5 changes: 2 additions & 3 deletions pkg/upgrade/sources.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func printIgnoringPackage(log *text.Logger, pkg db.IPackage, newPkgVersion strin
// UpAUR gathers foreign packages and checks if they have new versions.
// Output: Upgrade type package list.
func UpAUR(log *text.Logger, remote map[string]db.IPackage, aurdata map[string]*query.Pkg,
timeUpdate, enableDowngrade bool,
enableDowngrade bool,
) UpSlice {
toUpgrade := UpSlice{Up: make([]Upgrade, 0), Repos: []string{"aur"}}

Expand All @@ -73,8 +73,7 @@ func UpAUR(log *text.Logger, remote map[string]db.IPackage, aurdata map[string]*
continue
}

if (timeUpdate && (int64(aurPkg.LastModified) > pkg.BuildDate().Unix())) ||
(db.VerCmp(pkg.Version(), aurPkg.Version) < 0) ||
if (db.VerCmp(pkg.Version(), aurPkg.Version) < 0) ||
(enableDowngrade && (db.VerCmp(pkg.Version(), aurPkg.Version) > 0)) {
if pkg.ShouldIgnore() {
printIgnoringPackage(log, pkg, aurPkg.Version)
Expand Down
20 changes: 6 additions & 14 deletions pkg/upgrade/sources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"os"
"strings"
"testing"
"time"

aur "github.com/Jguer/aur"
"github.com/stretchr/testify/assert"
Expand All @@ -27,7 +26,6 @@ func Test_upAUR(t *testing.T) {
type args struct {
remote map[string]alpm.Package
aurdata map[string]*aur.Pkg
timeUpdate bool
enableDowngrade bool
}
tests := []struct {
Expand All @@ -47,7 +45,6 @@ func Test_upAUR(t *testing.T) {
"hello": {Version: "2.0.0", Name: "hello"},
"ignored": {Version: "2.0.0", Name: "ignored"},
},
timeUpdate: false,
},
want: UpSlice{Repos: []string{"aur"}, Up: []Upgrade{}},
},
Expand All @@ -57,8 +54,7 @@ func Test_upAUR(t *testing.T) {
remote: map[string]alpm.Package{
"hello": &mock.Package{PName: "hello", PVersion: "2.0.0"},
},
aurdata: map[string]*aur.Pkg{"hello": {Version: "2.1.0", Name: "hello"}},
timeUpdate: false,
aurdata: map[string]*aur.Pkg{"hello": {Version: "2.1.0", Name: "hello"}},
},
want: UpSlice{Repos: []string{"aur"}, Up: []Upgrade{{Name: "hello", Repository: "aur", LocalVersion: "2.0.0", RemoteVersion: "2.1.0"}}},
},
Expand All @@ -69,7 +65,6 @@ func Test_upAUR(t *testing.T) {
"hello": &mock.Package{PName: "hello", PVersion: "2.0.0"},
},
aurdata: map[string]*aur.Pkg{"hello": {Version: "1.0.0", Name: "hello"}},
timeUpdate: false,
enableDowngrade: true,
},
want: UpSlice{Repos: []string{"aur"}, Up: []Upgrade{{Name: "hello", Repository: "aur", LocalVersion: "2.0.0", RemoteVersion: "1.0.0"}}},
Expand All @@ -81,7 +76,6 @@ func Test_upAUR(t *testing.T) {
"hello": &mock.Package{PName: "hello", PVersion: "2.0.0"},
},
aurdata: map[string]*aur.Pkg{"hello": {Version: "1.0.0", Name: "hello"}},
timeUpdate: false,
enableDowngrade: false,
},
want: UpSlice{Repos: []string{"aur"}, Up: []Upgrade{}},
Expand All @@ -102,31 +96,29 @@ func Test_upAUR(t *testing.T) {
"down": {Version: "1.0.0", Name: "down"},
"ignored": {Version: "2.0.0", Name: "ignored"},
},
timeUpdate: false,
},
want: UpSlice{Repos: []string{"aur"}, Up: []Upgrade{
{Name: "up", Repository: "aur", LocalVersion: "2.0.0", RemoteVersion: "2.1.0"},
{Name: "down", Repository: "aur", LocalVersion: "1.1.0", RemoteVersion: "1.0.0"},
}},
},
{
name: "Time Update",
name: "Ignore LastModified When Version Is Unchanged",
args: args{
remote: map[string]alpm.Package{
"hello": &mock.Package{PName: "hello", PVersion: "2.0.0", PBuildDate: time.Now()},
"hello": &mock.Package{PName: "hello", PVersion: "2.0.0"},
},
aurdata: map[string]*aur.Pkg{"hello": {Version: "2.0.0", Name: "hello", LastModified: int(time.Now().AddDate(0, 0, 2).Unix())}},
timeUpdate: true,
aurdata: map[string]*aur.Pkg{"hello": {Version: "2.0.0", Name: "hello", LastModified: 9999999999}},
},
want: UpSlice{Repos: []string{"aur"}, Up: []Upgrade{{Name: "hello", Repository: "aur", LocalVersion: "2.0.0", RemoteVersion: "2.0.0"}}},
want: UpSlice{Repos: []string{"aur"}, Up: []Upgrade{}},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()

got := UpAUR(text.NewLogger(io.Discard, os.Stderr, strings.NewReader(""), false, "test"),
tt.args.remote, tt.args.aurdata, tt.args.timeUpdate, tt.args.enableDowngrade)
tt.args.remote, tt.args.aurdata, tt.args.enableDowngrade)
assert.ElementsMatch(t, tt.want.Repos, got.Repos)
assert.ElementsMatch(t, tt.want.Up, got.Up)
assert.Equal(t, tt.want.Len(), got.Len())
Expand Down
Loading