Skip to content

Commit

Permalink
fix owners
Browse files Browse the repository at this point in the history
  • Loading branch information
ipitio committed Dec 15, 2024
1 parent 43b807b commit 42cc271
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 21 deletions.
5 changes: 3 additions & 2 deletions owners.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<<<<<<< Updated upstream
<<<<<<< Updated upstream
=======
>>>>>>> Stashed changes
<<<<<<< Updated upstream
Expand All @@ -12,6 +13,8 @@
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
128206/chonger
128237/clicknpunch
128244/dchide01
Expand Down Expand Up @@ -67,8 +70,6 @@
132190/anodyne
128183/anthonypimplife
128264/svguerin3
=======
>>>>>>> Stashed changes
128219/hoonpark
=======
>>>>>>> Stashed changes
Expand Down
1 change: 1 addition & 0 deletions src/bkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ main() {
db_size_prev=$(get_BKG BKG_DIFF)
[ -n "$db_size_curr" ] || db_size_curr=0
[ -n "$db_size_prev" ] || db_size_prev=0
sed -i '/^<<<<<<<\|=======\|>>>>>>>/d' "$BKG_OWNERS"

if [ "$BKG_MODE" -ne 2 ]; then
if [ "$BKG_MODE" -eq 0 ] || [ "$BKG_MODE" -eq 3 ]; then
Expand Down
40 changes: 21 additions & 19 deletions src/lib/util.sh
Original file line number Diff line number Diff line change
@@ -1,32 +1,36 @@
#!/bin/bash
# Backage library
# Usage: ./lib.sh
# Dependencies: curl, jq, sqlite3, zstd, parallel
# Dependencies: git curl jq parallel sqlite3 sqlite3-pcre zstd libxml2-utils, yq
# Copyright (c) ipitio
#
# shellcheck disable=SC1090,SC1091,SC2015,SC2034

apt_install() {
sudo apt-get install -yqq git wget curl jq parallel sqlite3 sqlite3-pcre zstd libxml2-utils 2>/dev/null || apt-get install -yqq git wget curl jq parallel sqlite3 sqlite3-pcre zstd libxml2-utils
sudonot() {
sudo "$@" >/dev/null 2>&1 || "$@"
}

if ! command -v git &>/dev/null || ! command -v wget &>/dev/null || command -v curl &>/dev/null || ! command -v jq &>/dev/null || ! command -v sqlite3 &>/dev/null || ! command -v zstd &>/dev/null || ! command -v parallel &>/dev/null || ! command -v xmllint &>/dev/null || [ ! -f /usr/lib/sqlite3/pcre.so ]; then
echo "Installing dependencies..."
if ! apt_install; then
apt_install() {
apt-get install -yqq "$@" || {
apt-get update
apt_install
fi
fi
apt-get install -yqq "$@"
}
}

if ! yq -V | grep -q mikefarah; then
echo "Installing yq..."
sudo rm -f /usr/bin/yq 2>/dev/null || rm -f /usr/bin/yq
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O yq
sudo mv yq /usr/bin/yq 2>/dev/null || mv yq /usr/bin/yq
sudo chmod +x /usr/bin/yq 2>/dev/null || chmod +x /usr/bin/yq
fi
yq_install() {
mv -f /usr/bin/yq /usr/bin/yq.bak
curl -sSLNZo /usr/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
chmod +x /usr/bin/yq
}

dep_check() {
echo "Verifying dependencies..."
apt_install git curl jq parallel sqlite3 sqlite3-pcre zstd libxml2-utils
yq -V | grep -q mikefarah || yq_install
echo "Dependencies verified!"
}

echo "Dependencies verified!"
sudonot dep_check
# shellcheck disable=SC2046
source $(which env_parallel.bash)
env_parallel --session
Expand Down Expand Up @@ -379,5 +383,3 @@ ytox() {
ytoy() {
yq -oy "$1" | sed 's/"/\\"/g' >"${1%.*}.yml"
}

echo "Backage loaded"

0 comments on commit 42cc271

Please sign in to comment.