aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas C. Villa Real <lucasvr@gobolinux.org>2018-07-04 12:41:16 -0300
committerLucas C. Villa Real <lucasvr@gobolinux.org>2018-07-04 12:41:16 -0300
commit9e2877b6a4c38e6e55f65f565c6336fe58331cd2 (patch)
treebafb5257e479bec5b986e2479a34cbb0e6559cea
parent876662ecb64e392422b8c56fa52c6ec84b8f4871 (diff)
downloadThirdPartyInstallers-9e2877b6a4c38e6e55f65f565c6336fe58331cd2.tar.xz
Fallback to NamingConventions if GuessProgramCase does not find a good
camel-case alternative for the input program name.
-rwxr-xr-xbin/ThirdPartyInstaller15
1 files changed, 11 insertions, 4 deletions
diff --git a/bin/ThirdPartyInstaller b/bin/ThirdPartyInstaller
index 6c0a4ee..29732b2 100755
--- a/bin/ThirdPartyInstaller
+++ b/bin/ThirdPartyInstaller
@@ -22,6 +22,13 @@ Parse_Options "$@"
### Functions #################################################################
+function pretty_name() {
+ local program="$1"
+ local pretty=$(GuessProgramCase "$program")
+ [ "$pretty" = "$program" ] && pretty=$(NamingConventions "$program")
+ echo "$pretty"
+}
+
function fetch_package() {
local inputfile="$1"
local filename=$(basename "$inputfile")
@@ -368,7 +375,7 @@ function take_dependency_from_path() {
then
# TODO: we could now lookup the GoboLinux recipe store to find whether we
# have it or not
- echo "$(GuessProgramCase $depname)"
+ echo "$(pretty_name $depname)"
return 0
fi
fi
@@ -409,7 +416,7 @@ function lookup_pkgname() {
if [ "$depname" ]
then
local originalname=$(echo $depname | cut -d" " -f1)
- local prettyname="$(GuessProgramCase $originalname)"
+ local prettyname="$(pretty_name $originalname)"
local result=$(echo "$depname" | sed "s,$originalname,$prettyname,1")
Log_Verbose "$result"
echo "$result" && return 0
@@ -449,7 +456,7 @@ function prepare_program_entry() {
# Prepare /Programs tree and update program name (PrepareProgram may have changed its case)
if [ "$programname" = `echo "$programname" | tr '[:upper:]' '[:lower:]'` ]
- then Log_Normal "Program name is $(GuessProgramCase $programname)"
+ then Log_Normal "Program name is $(pretty_name $programname)"
else Log_Normal "Program name is $programname"
fi
@@ -545,7 +552,7 @@ then
do
depname=$(echo "$line" | awk {'print $1'})
depurl=$(echo "$line" | awk {'print $3'})
- programname="$(GuessProgramCase $depname)"
+ programname="$(pretty_name $depname)"
if ! [ -d "$goboPrograms/$programname" ]
then
Log_Normal "Installing dependency $depname from $depurl"