Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

allow ability to select aur helper #189

Merged
merged 10 commits into from
Jan 21, 2022
Merged

allow ability to select aur helper #189

merged 10 commits into from
Jan 21, 2022

Conversation

godalming123
Copy link

@godalming123 godalming123 commented Jan 16, 2022

  • add code
  • test the code

This is a fork that adds the ability to select what aur helper you would like to use currently the options are:

  • yay
  • paru
  • none

If anyone wants any other AUR helpers please let me know.
And thanks @ChrisTitusTech for creating this awesome script!

@vic1707
Copy link
Contributor

vic1707 commented Jan 16, 2022

great option to add!
but pretty sure you'll have to modify line 43 🤔.
yay -S --noconfirm --needed - < ~/ArchTitus/pkg-files/aur-pkgs.txt

Copy link
Contributor

@khaneliman khaneliman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2-User.sh:43
Needs to be updated with new option selected

@stojshic
Copy link

I like the idea, but it might be executed maybe a little bit differently. At least it looks easy enough, and also possibly includes every AUR helper from arch?

For 2-user.sh:

git clone "https://aur.archlinux.org/$AURHELPER"
cd ~/$AURHELPER
makepkg -si --noconfirm
$AURHELPER -S --noconfirm --needed - < ~/Arch/pkg-files/aur-pkgs.txt

and for startup.sh

read -p "Please enter your desired AUR helper (paru/yay/picaur/aura/probably any other...): " aurHelper
set_option AURHELPER $aurHelper

@godalming123
Copy link
Author

2-User.sh:43
Needs to be updated with new option selected

Yes true

@godalming123
Copy link
Author

great option to add!
but pretty sure you'll have to modify line 43 🤔.
yay -S --noconfirm --needed - < ~/ArchTitus/pkg-files/aur-pkgs.txt

Also true

@godalming123
Copy link
Author

I like the idea, but it might be executed maybe a little bit differently. At least it looks easy enough, and also possibly includes every AUR helper from arch?

For 2-user.sh:

git clone "https://aur.archlinux.org/$AURHELPER"
cd ~/$AURHELPER
makepkg -si --noconfirm
$AURHELPER -S --noconfirm --needed - < ~/Arch/pkg-files/aur-pkgs.txt

and for startup.sh

read -p "Please enter your desired AUR helper (paru/yay/picaur/aura/probably any other...): " aurHelper
set_option AURHELPER $aurHelper

That is a god idea. I think I will add a installAurPackadge command and then just use that command to install the AUR packages on line 43 of 2-user.sh and to install the AUR helper but I think I will just impement this as a other option for speed sake.

@khaneliman
Copy link
Contributor

khaneliman commented Jan 16, 2022

I like the idea, but it might be executed maybe a little bit differently. At least it looks easy enough, and also possibly includes every AUR helper from arch?

For 2-user.sh:


git clone "https://aur.archlinux.org/$AURHELPER"

cd ~/$AURHELPER

makepkg -si --noconfirm

$AURHELPER -S --noconfirm --needed - < ~/Arch/pkg-files/aur-pkgs.txt

and for startup.sh


read -p "Please enter your desired AUR helper (paru/yay/picaur/aura/probably any other...): " aurHelper

set_option AURHELPER $aurHelper

I like this idea of implementation too. But, I'd recommend following a more strict input validation otherwise your just going to pass through whatever inputted name is to all referenced locations.

EDIT: But, I wouldn't say it's anything to hold up PR over in the end, can be a further enhancement. Just would recommend fixing up bug and can leave hard coded values with normal read input. Then you could enhance the validation and stuff after. Just my opinion.

@stojshic
Copy link

Yeah, I thought of that, too. This would be good for not limiting AUR helpers, but then again, it doesn't have any validation. Maybe it should check if git command actually passed and created a folder, if not, return to selection?

if [[ -d $AURHELPER ]]

If directory exists, git command worked and the script goes on, if dir does not exist, return to selection.
Again, the problem would, in this version, be if the user inputs anything that exists in the AUR, but is not AUR helper...

@khaneliman
Copy link
Contributor

Yeah, I thought of that, too. This would be good for not limiting AUR helpers, but then again, it doesn't have any validation. Maybe it should check if git command actually passed and created a folder, if not, return to selection?

if [[ -d $AURHELPER ]]

If directory exists, git command worked and the script goes on, if dir does not exist, return to selection. Again, the problem would, in this version, be if the user inputs anything that exists in the AUR, but is not AUR helper...

Yeah, I was thinking along the lines of something like #182 where I'm checking if the option is part of the list of options provided. So, we populate the list of aur helpers and make sure they choose from the list.

@godalming123
Copy link
Author

I have fixed the bug on line 42 and added checking so the user cannot enter the incorrectly and an other option.

2-user.sh Outdated Show resolved Hide resolved
@godalming123
Copy link
Author

godalming123 commented Jan 18, 2022

I managed to figure out why my script was skipping straight to the 0-preinstall.sh it was because of this 6069ac6 which I could quite easily diagnose by running the script on it's own but now I have another issue:

startup.sh: line 212: syntax error: unexpected end of file

in startup.sh
Any help?
UPADATE: I managed to fix the issue in https://github.com/godalming123/ArchTitus/commit/ff0dc59bdb6e4a3f07f62128b5542e9151f406c1

@ChrisTitusTech ChrisTitusTech merged commit 94ae02d into ChrisTitusTech:server Jan 21, 2022
@godalming123
Copy link
Author

@ChrisTitusTech I think you should undo these changes. The branch installs but doesn't install the AUR helper when I tried my branch this morning and executed just user.sh it couldn't run so it doesn't install the AUR helper as that's where it installs it.

@godalming123
Copy link
Author

@ChrisTitusTech the 681f14c commit appears to fix everything but I am still testing

@godalming123 godalming123 mentioned this pull request Feb 6, 2022
@godalming123
Copy link
Author

I have created a new PR #222 to fix the bug

@godalming123 godalming123 mentioned this pull request Feb 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants