Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DNF package manager #10

Closed
CleanMachine1 opened this issue Apr 16, 2022 · 7 comments
Closed

Add DNF package manager #10

CleanMachine1 opened this issue Apr 16, 2022 · 7 comments

Comments

@CleanMachine1
Copy link

Fedora Linux uses DNF

See https://docs.fedoraproject.org/en-US/quick-docs/dnf/ for some docs
however to update is sudo dnf upgrade

@Crilum
Copy link
Owner

Crilum commented Apr 16, 2022

Hey @CleanMachine1!

Do you use Fedora? I have no experience with it, and so I have no idea how to use dnf, however, I have actually been thinking about adding support for more package managers, so I am totally open to adding this functionality. Is sudo dnf upgrade eqivalent to suod apt update && sudo apt upgrade?

@CleanMachine1
Copy link
Author

I started yesterday since I had an ssd to fill, from what I can tell, sudo dnf upgrade == sudo apt update && sudo apt full-upgrade

@Crilum
Copy link
Owner

Crilum commented Apr 16, 2022

Hey, can dnf update itself like this: sudo dnf upgrade dnf? I can't test it, but I don't want to exclude the dnf package by removing it if it's used as the update argument

@Crilum
Copy link
Owner

Crilum commented Apr 16, 2022

Alright, I've added dnf in the latest commits, can you test it? Just like this:

cd /tmp
wget -q https://github.com/Crilum/update/raw/main/update
./update dnf

maybe try updating some packages too, like this:

./update dnf Some packages you've installed

If you could post the outputs, that would be amazing!

@Crilum Crilum mentioned this issue Apr 16, 2022
@CleanMachine1
Copy link
Author

I don't particuallary understand these lines
pkgs="$*"
if [[ "$pkgs" =~ "--no-grep-args" ]]; then
pkgs="$(echo $pkgs | sed -e 's/--no-grep-args//g' -e 's/--all//g' -e 's/-a//g' -e 's/--apt//g' -e 's/-A//g' -e 's/all//g' -e 's/--npm//g' -e 's/-n//g' -e 's/snaps//g' -e 's/-s//g' -e 's/--snaps//g' -e 's/-f//g' -e 's/--flatpak//g' -e 's/-d//g' -e 's/--dnf//g')"
else
pkgs="$(echo $pkgs | sed -e 's/--no-grep-args//g' -e 's/--all//g' -e 's/-a//g' -e 's/--apt//g' -e 's/apt//g' -e 's/-A//g' -e 's/all//g' -e 's/npm//g' -e 's/--npm//g' -e 's/-n//g' -e 's/snaps//g' -e 's/-s//g' -e 's/--snaps//g' -e 's/flatpak//g' -e 's/-f//g' -e 's/--flatpak//g' -e 's/dnf//g' -e 's/-d//g' -e 's/--dnf//g')"
fi

@CleanMachine1
Copy link
Author

./update: line 166: upd_upd_script: command not found

Welcome to Crilum's Update Script!
Last metadata expiration check: 0:16:24 ago
Dependencies resolved.
Nothing to do.
Complete!

I feared that it would try to mess about with Pi-Apps so I removed everything but what was needed.

@Crilum
Copy link
Owner

Crilum commented Apr 16, 2022

Ok, thanks.

./update: line 166: upd_upd_script: command not found

./update: line 166: upd_upd_script: command not found is because you removed the self-updater function, don't worry about that.

I feared that it would try to mess about with Pi-Apps so I removed everything but what was needed.

If you have Pi-Apps installed, update should only run ~/pi-apps/updater cli-yes.

I don't particuallary understand these lines

pkgs="$*"
if [[ "$pkgs" =~ "--no-grep-args" ]]; then
pkgs="$(echo $pkgs | sed -e 's/--no-grep-args//g' -e 's/--all//g' -e 's/-a//g' -e 's/--apt//g' -e 's/-A//g' -e 's/all//g' -e 's/--npm//g' -e 's/-n//g' -e 's/snaps//g' -e 's/-s//g' -e 's/--snaps//g' -e 's/-f//g' -e 's/--flatpak//g' -e 's/-d//g' -e 's/--dnf//g')"
else
pkgs="$(echo $pkgs | sed -e 's/--no-grep-args//g' -e 's/--all//g' -e 's/-a//g' -e 's/--apt//g' -e 's/apt//g' -e 's/-A//g' -e 's/all//g' -e 's/npm//g' -e 's/--npm//g' -e 's/-n//g' -e 's/snaps//g' -e 's/-s//g' -e 's/--snaps//g' -e 's/flatpak//g' -e 's/-f//g' -e 's/--flatpak//g' -e 's/dnf//g' -e 's/-d//g' -e 's/--dnf//g')"
fi

This code removes arguments from the package list ($pkgs), so you can specify specific packages to update.
If you specify --no-grep-args, and are updating apps from apt, like this: update apt yad, say, the equivalent command would be: sudo apt update && sudo apt upgrade apt yad.
If you didn't specify --no-grep-args, it would be this: sudo apt update && sudo apt upgrade yad.

@CleanMachine1 Thanks for testing for me! I'll make a release.

@Crilum Crilum closed this as completed Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants