aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-06-10 05:04:53 +0300
committerkaotisk <kaotisk@arching-kaos.org>2024-06-10 05:04:53 +0300
commitab7cbfd693c6251f6c1bc427eb9a65b1dbee159e (patch)
tree9d979ce5dbdb758af25b29b35cb186746ce81adf
parentaa64da01c0ade0973fc67ec0e670a37af2002ae7 (diff)
downloadarching-kaos-tools-ab7cbfd693c6251f6c1bc427eb9a65b1dbee159e.tar.gz
arching-kaos-tools-ab7cbfd693c6251f6c1bc427eb9a65b1dbee159e.tar.bz2
arching-kaos-tools-ab7cbfd693c6251f6c1bc427eb9a65b1dbee159e.zip
bugfix??
-rwxr-xr-xlib/_ak_zblock23
1 files changed, 11 insertions, 12 deletions
diff --git a/lib/_ak_zblock b/lib/_ak_zblock
index 324d3aa..8a83479 100755
--- a/lib/_ak_zblock
+++ b/lib/_ak_zblock
@@ -26,6 +26,7 @@ _ak_zblock_show(){
else
entrance="$(cat $AK_ZLATEST)"
fi
+ zblock=$entrance
# ak-enter -l 1 "$entrance" > "$AK_CACHEDIR/fzblocks/$entrance"
# Check if $zblock exists as variable
if [ ! -v $zblock ]
@@ -630,28 +631,26 @@ _ak_zblock_cache(){
then
mkdir $AK_CACHEDIR/fzblocks
fi
+ FZBLOCKSDIR="$AK_CACHEDIR/fzblocks"
if [ ! -z "$1" ] && [ -n "$1" ]
then
if [ -f "$AK_ZBLOCKDIR/$1" ] && [ "$(du -b $AK_ZBLOCKDIR/$1 | awk '{ print $1 }')" != "0" ]
then
- if [ "$(sha512sum $AK_ZBLOCKDIR/$1 | awk '{ print $1 }')" == "$(_ak_zblock_show $1 | sha512sum | awk '{ print $1 }')" ]
+ # if [ "$(sha512sum $AK_ZBLOCKDIR/$1 | awk '{ print $1 }')" == "$(_ak_zblock_show $1 | sha512sum | awk '{ print $1 }')" ]
+ if [ ! -f $FZBLOCKSDIR/$1 ]
then
- logit "INFO" "Cache already there and updated"
- else
- logit "INFO" "Updating cache"
- _ak_zblock_show "$1" > $AK_CACHEDIR/fzblocks/$1
+ logit "INFO" "No cache found. Caching..."
+ _ak_zblock_show "$1" > $FZBLOCKSDIR/$1
fi
- logit "INFO" "No cache found. Caching..."
- _ak_zblock_show "$1"
- if [ $? -ne "0" ]
+ if [ ! -f $FZBLOCKSDIR/$1 ]
then
- logit "ERROR" "_ak_zblock_show failed..."
- exit 2
+ logit "INFO" "Caching failed..."
+ exit 1
fi
- _ak_zblock_show "$1" > $AK_CACHEDIR/fzblocks/$1
+ cat $FZBLOCKSDIR/$1
else
- _ak_zblock_show "$1" > $AK_CACHEDIR/fzblocks/$1
+ _ak_zblock_show "$1" > $FZBLOCKSDIR/$1
if [ $? -ne "0" ]
then
logit "ERROR" "_ak_zblock_show failed..."