move stuff around

This commit is contained in:
AustrianToast 2024-09-08 16:36:19 +02:00
parent 452b0e92e2
commit 81b07991aa
Signed by: AustrianToast
GPG Key ID: 1B4D0AAF6E558816
9 changed files with 59 additions and 24 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
backup

View File

@ -1,6 +1,6 @@
# Update
Update script written in Bash for Arch Linux only. Keeps all your official, aur packages and your flatpaks up to date with one simple script. It also backups a list of all your installed packages and flatpaks.
Alpm hooks for the pacman package manager. This project consists of two hooks, one for pre-transaction and the other for post-transaction.
## Installation
@ -11,17 +11,7 @@ git clone https://gitea.hopeless-cloud.xyz/AustrianToast/update.git && cd update
Before installing, please edit the config and configure it to your liking.
Then install using
```bash
make
```
## Usage
```
Usage: update [OPTION]
options:
--help displays this message
--preview shows a preview of which pkg's will be updates
--version prints out the version number
make install
```
## Contributing

28
legacy/README.md Normal file
View File

@ -0,0 +1,28 @@
# Update
Update script written in Bash for Arch Linux only. Keeps all your official, aur packages and your flatpaks up to date with one simple script. It also backups a list of all your installed packages and flatpaks.
## Installation
```bash
git clone https://gitea.hopeless-cloud.xyz/AustrianToast/update.git && cd update
```
Before installing, please edit the config and configure it to your liking.
Then install using
```bash
make
```
## Usage
```
Usage: update [OPTION]
options:
--help displays this message
--preview shows a preview of which pkg's will be updates
--version prints out the version number
```
## Contributing
Contributions are always welcome!

10
legacy/makefile Normal file
View File

@ -0,0 +1,10 @@
install:
@echo "==> Installing update into /usr/local/bin"
@sudo install -Dm755 update /usr/local/bin/update
@[[ -f ${HOME}/.config/update.conf ]] || cp update.conf ${HOME}/.config/
@echo "==> Finished."
uninstall:
@echo "==> Uninstalling update from /usr/local/bin"
@sudo rm /usr/local/bin/update ${HOME}/.config/update.conf
@echo "==> Finished."

View File

@ -1,28 +1,32 @@
IGREEN := \033[0;92m
NO_COLOR := \033[0m
help:
@echo "Usage: make [OPTION]"
@echo "Available options are:"
@echo "help"
@echo "install"
@echo "compile"
@echo "install This will also compile"
@echo "uninstall"
compile:
@echo "==> Compiling backup"
@echo -e "$(IGREEN)==> Compiling backup$(NO_COLOR)"
go build .
install: compile
@echo "==> Copying the hooks into /etc/pacman.d/hooks"
@echo -e "$(IGREEN)==> Copying the hooks into /etc/pacman.d/hooks$(NO_COLOR)"
[[ -d /etc/pacman.d/hooks ]] || sudo mkdir /etc/pacman.d/hooks
sudo cp pre_backup.hook post_backup.hook /etc/pacman.d/hooks
@echo "==> Copying backup into /usr/local/bin"
@echo -e "$(IGREEN)==> Copying backup into /usr/local/bin$(NO_COLOR)"
sudo install -Dm755 backup /usr/local/bin/backup
@echo "==> Copying the config into /etc"
@echo -e "$(IGREEN)==> Copying the config into /etc$(NO_COLOR)"
[[ -f /etc/update.toml ]] || sudo cp update.toml /etc
@echo "==> Finished."
@echo -e "$(IGREEN)==> Finished.$(NO_COLOR)"
uninstall:
@echo "==> Removing the hooks from /etc/pacman.d/hooks"
@echo -e "$(IGREEN)==> Removing the hooks from /etc/pacman.d/hooks$(NO_COLOR)"
sudo rm /etc/pacman.d/hooks/pre_backup.hook /etc/pacman.d/hooks/post_backup.hook
@echo "==> Removing backup into /usr/local/bin"
@echo -e "$(IGREEN)==> Removing backup into /usr/local/bin$(NO_COLOR)"
sudo rm /usr/local/bin/backup
@echo "==> /etc/update.toml will remain"
@echo "==> Finished."
@echo -e "$(IGREEN)==> /etc/update.toml will remain$(NO_COLOR)"
@echo -e "$(IGREEN)==> Finished.$(NO_COLOR)"

View File

@ -6,6 +6,6 @@ Type = Package
Target = *
[Action]
Description = Backing up the pacman db...
Description = Backing up a list of all packages...
When = PostTransaction
Exec = /usr/local/bin/backup post

View File

@ -1,4 +1,6 @@
# Config for update
[backup]
locations = ['/opt'] # All locations need to be an absolute path
# All locations need to be an absolute path
# Don't specify a path multiple times, else the zip will likely be broken
locations = ['/opt']