1
0
mirror of https://github.com/Jguer/yay synced 2024-07-01 07:56:37 +00:00

Compare commits

...

4 Commits

Author SHA1 Message Date
Aino L. Spring
574ac2ca48
Merge 7a4f812a5f into 9ed9b0b4e1 2024-06-20 14:23:06 +02:00
Marcus B Spencer
9ed9b0b4e1
Update README.md (#2458)
Update the README to prevent partial upgrades.

Partial upgrades are dangerous on Arch Linux.
Partial upgrades may occur when a `-y` operation is given without a corresponding `-u` operation.

Quote from the ArchWiki:
> Do not use:
> `pacman -Sy package`
> `pacman -Sy` followed by `pacman -S` package (Note the absence of `-S**u**` in the installation of the package.)
> `pacman -Syuw` (Note that `pacman -Syuw` does imply the same risks like pacman -Sy`, as it will update the pacman sync database without installing the newer packages.)

https://wiki.archlinux.org/title/System_maintenance#Partial_upgrades_are_unsupported
2024-06-20 14:15:14 +02:00
Aino Spring
7a4f812a5f
Fixed tests 2024-05-13 20:39:11 +02:00
Aino Spring
5f0ec2c4e2
Check if pkgbuild merge is possible
Sometimes aur pkgbuild repos dont contain any branches
2024-05-13 20:26:50 +02:00
4 changed files with 28 additions and 3 deletions

View File

@ -35,10 +35,10 @@ If you are migrating from another AUR helper, you can simply install Yay with th
The initial installation of Yay can be done by cloning the PKGBUILD and
building with makepkg:
We start with updating the package lists and make sure we have the `base-devel` package group installed.
We make sure we have the `base-devel` package group installed.
```sh
pacman -Sy --needed git base-devel
pacman -S --needed git base-devel
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si

View File

@ -73,6 +73,7 @@ func TestIntegrationLocalInstall(t *testing.T) {
wantCapture := []string{
"makepkg --packagelist",
"git -C testdata/jfin branch --show-current",
"git -C testdata/jfin git reset --hard HEAD",
"git -C testdata/jfin git merge --no-edit --ff",
"makepkg --packagelist",
@ -337,6 +338,7 @@ func TestIntegrationLocalInstallNeeded(t *testing.T) {
wantCapture := []string{
"makepkg --packagelist",
"git -C testdata/jfin branch --show-current",
"git -C testdata/jfin git reset --hard HEAD",
"git -C testdata/jfin git merge --no-edit --ff",
"makepkg --packagelist",
@ -510,6 +512,7 @@ func TestIntegrationLocalInstallGenerateSRCINFO(t *testing.T) {
wantCapture := []string{
"makepkg --printsrcinfo",
"makepkg --packagelist",
"git -C testdata/jfin branch --show-current",
"git -C testdata/jfin git reset --hard HEAD",
"git -C testdata/jfin git merge --no-edit --ff",
"makepkg --packagelist",
@ -795,6 +798,7 @@ func TestIntegrationLocalInstallWithDepsProvides(t *testing.T) {
}
wantCapture := []string{
"git -C testdata/cephbin branch --show-current",
"git -C testdata/cephbin git reset --hard HEAD",
"git -C testdata/cephbin git merge --no-edit --ff",
"makepkg --packagelist",
@ -923,8 +927,10 @@ func TestIntegrationLocalInstallTwoSrcInfosWithDeps(t *testing.T) {
}
wantCapture := []string{
"git -C testdata/gourou branch --show-current",
"git -C testdata/gourou git reset --hard HEAD",
"git -C testdata/gourou git merge --no-edit --ff",
"git -C testdata/libzip-git branch --show-current",
"git -C testdata/libzip-git git reset --hard HEAD",
"git -C testdata/libzip-git git merge --no-edit --ff",
"makepkg --packagelist",

View File

@ -27,9 +27,27 @@ func gitMerge(ctx context.Context, cmdBuilder exe.ICmdBuilder, dir string) error
return nil
}
func pkgbuildCanMerge(ctx context.Context, cmdBuilder exe.ICmdBuilder, dir string) (bool, error) {
stdout, stderr, err := cmdBuilder.Capture(
cmdBuilder.BuildGitCmd(ctx,
dir, "branch", "--show-current"))
if err != nil {
return false, errors.New(gotext.Get("error showing branch %s: %s", dir, stderr))
}
return stdout != "", nil
}
func mergePkgbuilds(ctx context.Context, cmdBuilder exe.ICmdBuilder, pkgbuildDirs map[string]string) error {
for _, dir := range pkgbuildDirs {
err := gitMerge(ctx, cmdBuilder, dir)
canMerge, err := pkgbuildCanMerge(ctx, cmdBuilder, dir)
if err != nil {
return err
}
if !canMerge {
continue
}
err = gitMerge(ctx, cmdBuilder, dir)
if err != nil {
return err
}

View File

@ -545,6 +545,7 @@ pkgname = python-vosk
require.NoError(t, err)
wantCapture := []string{
"/usr/bin/git -C testdata/vosk-api branch --show-current",
"/usr/bin/git -C /testdir/vosk-api reset --hard HEAD",
"/usr/bin/git -C /testdir/vosk-api merge --no-edit --ff",
"makepkg --packagelist", "makepkg --packagelist",