Skip to content

Commit

Permalink
fix crackle setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuseteam committed Apr 25, 2024
1 parent ea094fe commit b90a44a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
16 changes: 10 additions & 6 deletions crackle
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ APT_CACHE="apt-cache -o Dir::Cache=$APTCACHE -o Dir::State=$APTSTATE -o Dir::Etc
[[ -z "$(ls $SCRP_DIR/bin)" && $(basename $SCRP_DIR) != "bin" ]] && err "submodule missing";
bashrc=$(grep crackle "$HOME"/.bashrc);
profile=$(grep crackle "$HOME"/.profile);
[[ -f '/root/.profile' ]] || sudo_run "touch /root/.profile";
rootprofile=$(grep crackle /root/.profile);

[[ -d "$PKG_PATH" ]] || mkdir -p "$PKG_PATH";

if ! check_cmd curl; then "$SCRP_DIR"/crackle install curl; fi
pkgsetup;
[[ -f "$CRACKLERC" ]] || {
echo "CRACKLEENV=$CRACKLEENV" > "$CRACKLERC";
Expand Down Expand Up @@ -215,11 +215,15 @@ APT_CACHE="apt-cache -o Dir::Cache=$APTCACHE -o Dir::State=$APTSTATE -o Dir::Etc
[ "$operation" = "update" ] && {
say "checking connectivity"
wget -q --spider https://ubports.com || err "no internet connection, please run crackle update later to fetch the latest package lists";
say "Updating Cracklebin"
curl --disable --progress-bar -L ${CRACKLEBIN} | tar zx --strip-components=1 -C $PKG_PREFIX/lib/crackle
say "Updating repos"
curl --disable --progress-bar -L ${CRACKLEBIN} | tar zx --directory=$APTCONFIG/preferences.d --wildcards */etc/preferences.d/* --strip-components=3
curl --disable --progress-bar -L ${CRACKLEBIN} | tar zx --directory=$APTCONFIG/sources.list.d --wildcards */etc/sources.list.d/* --strip-components=3

if check_cmd curl; then say "Updating Cracklebin"; fi
if check_cmd curl; then curl --disable --progress-bar -L ${CRACKLEBIN} | tar zx --strip-components=1 -C $PKG_PREFIX/lib/crackle; fi

if check_cmd curl; then say "Updating repos"; fi
if check_cmd curl; then curl --disable --progress-bar -L ${CRACKLEBIN} | tar zx --directory=$APTCONFIG/preferences.d --wildcards */etc/preferences.d/* --strip-components=3; fi

if check_cmd curl; then curl --disable --progress-bar -L ${CRACKLEBIN} | tar zx --directory=$APTCONFIG/sources.list.d --wildcards */etc/sources.list.d/* --strip-components=3; fi

$APT_GET "$operation"
exit 0;
}
Expand Down
8 changes: 8 additions & 0 deletions lib/pkgfunc
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ function pkgsetup(){
[[ -n "$(ls /etc/apt/trusted.gpg.d)" ]] && ln -s /etc/apt/trusted.gpg.d/* $APTCONFIG/trusted.gpg.d/;
}

[ -d "$APTSTATE/lists" ] || {
say "Fetching package lists...";
ensure "$SCRP_DIR"/crackle update
}

if ! check_cmd curl; then "$SCRP_DIR"/crackle install curl; fi

say "Setting up repos"
wget -q --spider https://ubports.com || err "no internet connection, please run crackle update later to fetch the latest package lists";
curl --disable --progress-bar -L ${CRACKLEBIN} | tar zx --directory=$APTCONFIG/preferences.d --wildcards */etc/preferences.d/* --strip-components=3
curl --disable --progress-bar -L ${CRACKLEBIN} | tar zx --directory=$APTCONFIG/sources.list.d --wildcards */etc/sources.list.d/* --strip-components=3
Expand Down

0 comments on commit b90a44a

Please sign in to comment.