-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from archetipico/main
Add cache system close #31
- Loading branch information
Showing
15 changed files
with
138 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
src/utils/.cache | ||
src/utils/.md5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
#!/bin/bash | ||
|
||
SRC=$(dirname "$(readlink -f "$0")") | ||
source $SRC/utils/global.sh | ||
|
||
PWR=$(source $SRC/utils/checkpwr.sh) | ||
PKG="flatpak" | ||
|
||
printf "${GREEN}\nPackage manager detected: ${RED}Using $PKG${NORMAL}" | ||
|
||
printProgress "flatpak update: starting" | ||
sudo $PKG update | ||
$PWR $PKG update | ||
printProgress "flatpak update: completed" | ||
|
||
printProgress "flatpak repair: starting" | ||
sudo $PKG repair | ||
$PWR $PKG repair | ||
printProgress "flatpak repair: completed" | ||
|
||
printProgress "flatpak uninstall unused extensions: starting" | ||
sudo $PKG uninstall --unused | ||
$PWR $PKG uninstall --unused | ||
printProgress "flatpak uninstall unused extensions: completed" | ||
|
||
printf "\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
#!/bin/bash | ||
|
||
SRC=$(dirname "$(readlink -f "$0")") | ||
source $SRC/utils/global.sh | ||
|
||
PWR=$(source $SRC/utils/checkpwr.sh) | ||
|
||
printf "${GREEN}\nPackage manager detected: ${RED}Using snap${NORMAL}" | ||
|
||
printProgress "snap refresh: starting" | ||
sudo snap refresh | ||
$PWR snap refresh | ||
printProgress "snap refresh: completed" | ||
|
||
printf "\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
#!/bin/bash | ||
|
||
source $(dirname "$(readlink -f "$0")")/utils/global.sh | ||
SRC=$(dirname "$(readlink -f "$0")") | ||
source $SRC/utils/global.sh | ||
|
||
PWR=$(source $SRC/utils/checkpwr.sh) | ||
PKG="pkg" | ||
|
||
printf "${GREEN}\nPackage manager detected: ${RED}Using $PKG${NORMAL}" | ||
|
||
printProgress "update: starting" | ||
$PKG update | ||
$PWR $PKG update | ||
printProgress "update: completed" | ||
|
||
printProgress "upgrade: starting" | ||
$PKG upgrade | ||
$PWR $PKG upgrade | ||
printProgress "upgrade: completed" | ||
|
||
printProgress "autoclean: starting" | ||
$PKG autoclean | ||
$PWR $PKG autoclean | ||
printProgress "autoclean: completed" | ||
|
||
printf "\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,30 @@ | ||
#!/bin/bash | ||
|
||
src_path=$(dirname "$(readlink -f "$0")") | ||
source "$src_path"/utils/global.sh | ||
|
||
printf "${LOGO}" | ||
if [[ $(stty size | awk '{print $2}') -ge 69 ]]; then | ||
cat "$src_path"/utils/.logo | ||
fi | ||
printf "Running on: $(uname -rs)\n${NORMAL}" | ||
|
||
# termux | ||
if [[ $(command -v pkg) ]]; then | ||
source "$src_path"/package/termux.sh | ||
source "$src_path"/utils/trash.sh | ||
exit 0; | ||
#gentoo | ||
elif [[ $(command -v emerge) ]]; then | ||
source "$src_path"/package/gentoo.sh | ||
source "$src_path"/utils/trash.sh | ||
exit 0; | ||
fi | ||
|
||
# check privileges | ||
source "$src_path"/utils/privileges.sh | ||
|
||
# snap | ||
if [[ $(command -v snap) ]]; then | ||
source "$src_path"/package/snap.sh | ||
fi | ||
|
||
# flatpak | ||
if [[ $(command -v flatpak) ]]; then | ||
source "$src_path"/package/flatpak.sh | ||
SRC=$(dirname "$(readlink -f "$0")") | ||
source $SRC/utils/global.sh | ||
|
||
if [[ -f "$SRC/utils/.cache" ]]; then | ||
HASH=$(md5sum "$SRC/utils/.cache" | cut -d " " -f1) | ||
if [[ $HASH != $(cat $SRC/utils/.md5) ]]; then | ||
md5sum $SRC/utils/.cache | cut -d " " -f1 > $SRC/utils/.md5 | ||
fi | ||
else | ||
$SRC/utils/cachegen.sh > $SRC/utils/.cache | ||
md5sum $SRC/utils/.cache | cut -d " " -f1 > $SRC/utils/.md5 | ||
chmod 775 $SRC/utils/.cache | ||
fi | ||
chmod 775 $SRC/utils/.md5 | ||
|
||
# debian | ||
if [[ $(command -v apt-get) ]]; then | ||
source "$src_path"/package/debian.sh | ||
# rpm | ||
elif [[ $(command -v yum) ]]; then | ||
source "$src_path"/package/rpm.sh | ||
# arch | ||
elif [[ $(command -v pacman) ]]; then | ||
source "$src_path"/package/archlinux.sh | ||
# not found | ||
else | ||
printf "${RED}System not supported${NORMAL}" | ||
printf "$LOGO" | ||
if [[ $(stty size | awk '{print $2}') -ge 69 ]]; then | ||
cat $SRC/utils/.logo | ||
fi | ||
printf "Running on: $(uname -rs)\n$NORMAL" | ||
|
||
# check trash | ||
source "$src_path"/utils/trash.sh | ||
while read line; do | ||
if [[ "$line" != "" ]]; then | ||
source $SRC/$line.sh; | ||
fi | ||
done < $SRC/utils/.cache | ||
|
||
printf "\n" | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
|
||
### generates default caches ### | ||
OUT="" | ||
|
||
OUT+="utils/privileges\n" | ||
|
||
# arch | ||
if [[ $(command -v pacman) ]]; then | ||
OUT+="package/archlinux\n" | ||
fi | ||
|
||
# debian | ||
if [[ $(command -v apt-get) ]]; then | ||
OUT+="package/debian\n" | ||
fi | ||
|
||
# flatpak | ||
if [[ $(command -v flatpak) ]]; then | ||
OUT+="package/flatpak\n" | ||
fi | ||
|
||
#gentoo | ||
if [[ $(command -v emerge) ]]; then | ||
OUT+="package/gentoo\n" | ||
fi | ||
|
||
# rpm | ||
if [[ $(command -v yum) ]]; then | ||
OUT+="package/rpm\n" | ||
fi | ||
|
||
# snap | ||
if [[ $(command -v snap) ]]; then | ||
OUT+="package/snap\n" | ||
fi | ||
|
||
# termux | ||
if [[ $(command -v pkg) ]]; then | ||
OUT+="package/termux\n" | ||
fi | ||
|
||
OUT+="utils/trash" | ||
|
||
echo -e "$OUT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
PWR="" | ||
if [[ $(grep -c "utils/privileges" $(dirname "$(readlink -f "$0")")/utils/.cache) -gt 0 ]]; then | ||
PWR="sudo" | ||
fi | ||
|
||
echo "$PWR" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.