Skip to content

Commit 34f941b

Browse files
committed
Fix problem in cache if not have translation
1 parent 650dc26 commit 34f941b

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

usr/share/biglinux/bigstore-cli/aur_cache.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,14 @@ fi
119119
wait # Wait for pacman -Qm to finish
120120

121121
# If the locale file exists, and not manual disabled the translation, use the translated description
122-
if [[ "$DisableTranslate" == "false" ]]; then
122+
if [[ "$DisableTranslate" == "false" ]] && [[ -e $localeFile ]]; then
123123

124124
awk_translate="-v localeFile=$localeFile"
125-
awk_file='awk/aur_cache_with_translate.awk'
125+
awk_file='/usr/share/biglinux/bigstore-cli/awk/aur_cache_with_translate.awk'
126126
else
127127

128128
awk_translate=''
129-
awk_file='awk/aur_cache_without_translate.awk'
129+
awk_file='/usr/share/biglinux/bigstore-cli/awk/aur_cache_without_translate.awk'
130130
fi
131131

132132
# Read translations from the translations.txt file into an associative array

usr/share/biglinux/bigstore-cli/flatpak_cache.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ fi
109109
wait
110110

111111
# If the locale file exists, and not manual disabled the translation, use the translated description
112-
if [[ "$DisableTranslate" == "false" ]]; then
112+
if [[ "$DisableTranslate" == "false" ]] && [[ -e $localeFile ]]; then
113113

114114
awk_translate="-v localeFile=$localeFile"
115-
awk_file='awk/flatpak_cache_with_translate.awk'
115+
awk_file='/usr/share/biglinux/bigstore-cli/awk/flatpak_cache_with_translate.awk'
116116
else
117117

118118
awk_translate=''
119-
awk_file='awk/flatpak_cache_without_translate.awk'
119+
awk_file='/usr/share/biglinux/bigstore-cli/awk/flatpak_cache_without_translate.awk'
120120
fi
121121

122122
# Filter all with awk
123-
awk -v installedPackages="$TmpInstalledFlatpak" -v updatePackages="$TmpUpdateFlatpak" $awk_translate -f $awk_file "$TmpAllFlatpak" | sort -u >$FileToSaveCacheFiltered
123+
awk -v installedPackages="$TmpInstalledFlatpak" -v updatePackages="$TmpUpdateFlatpak" $awk_translate -f $awk_file "$TmpAllFlatpak" | sort -u >$FileToSaveCacheFiltered

usr/share/biglinux/bigstore-cli/pacman_cache.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,18 @@ fi
9494

9595
# Function to transform the pacman output into a JSON array, using jq
9696
pacmanJson() {
97-
LANG=C pacman -Ss | jq -Rsc -f jq/pacman_cache.jq | sed 's|,{"repo":"|,\n{"repo":"|g;s|:null,|:"",|g;s|:"false",|:"",|g' # Split any package in one line and change null to "null"
97+
LANG=C pacman -Ss | jq -Rsc -f /usr/share/biglinux/bigstore-cli/jq/pacman_cache.jq | sed 's|,{"repo":"|,\n{"repo":"|g;s|:null,|:"",|g;s|:"false",|:"",|g' # Split any package in one line and change null to "null"
9898
}
9999

100100
# If the locale file exists, and not manual disabled the translation, use the translated description
101-
if [[ "$DisableTranslate" == "false" ]]; then
101+
if [[ "$DisableTranslate" == "false" ]] && [[ -e $localeFile ]]; then
102102

103103
awk_translate="-v localeFile=$localeFile"
104-
awk_file='awk/pacman_cache_with_translate.awk'
104+
awk_file='/usr/share/biglinux/bigstore-cli/awk/pacman_cache_with_translate.awk'
105105
else
106106

107107
awk_translate=''
108-
awk_file='awk/pacman_cache_without_translate.awk'
108+
awk_file='/usr/share/biglinux/bigstore-cli/awk/pacman_cache_without_translate.awk'
109109
fi
110110

111111
# To generate JSON without translation, we don't really need awk

usr/share/biglinux/bigstore-cli/snap_cache.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ fi
8484

8585
wait
8686

87-
if [[ "$DisableTranslate" == "false" ]]; then
87+
if [[ "$DisableTranslate" == "false" ]] && [[ -e $localeFile ]]; then
8888

8989
awk_translate="-v localeFile=$localeFile"
90-
awk_file='awk/snap_cache_with_translate.awk'
90+
awk_file='/usr/share/biglinux/bigstore-cli/awk/snap_cache_with_translate.awk'
9191
else
9292

9393
awk_translate=''
94-
awk_file='awk/snap_cache_without_translate.awk'
94+
awk_file='/usr/share/biglinux/bigstore-cli/awk/snap_cache_without_translate.awk'
9595
fi
9696

97-
awk -v installedPackages="$InstalledSnap" $awk_translate -f $awk_file "$AllSnapCache" | sort -u >$FileToSaveCacheFiltered
97+
awk -v installedPackages="$InstalledSnap" $awk_translate -f $awk_file "$AllSnapCache" | sort -u >$FileToSaveCacheFiltered

0 commit comments

Comments
 (0)