New version, new tarball. Bug fix for regression introduced in last versions. Double

output for apt repos. Also refactored duplicated code into a function, no other changes.

Note that this version features the repo debugger tool as well, which is very helpful in
particularly non apt systems to fix issues with its handling of repo formats etc.
This commit is contained in:
inxi-svn 2014-09-27 07:11:11 +00:00
parent 4186f82694
commit 4d1ddd7de4
2 changed files with 41 additions and 68 deletions

93
inxi
View file

@ -3,8 +3,8 @@
# openbsd ftp does http # openbsd ftp does http
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### Version: 2.2.13 #### Version: 2.2.14
#### Date: 2014-09-25 #### Date: 2014-09-26
#### Patch Number: 00 #### Patch Number: 00
######################################################################## ########################################################################
#### SPECIAL THANKS #### SPECIAL THANKS
@ -9296,7 +9296,7 @@ get_repo_data()
if [[ -f $apt_file || -d $apt_file.d ]];then if [[ -f $apt_file || -d $apt_file.d ]];then
repo_files=$(ls /etc/apt/sources.list /etc/apt/sources.list.d/*.list 2>/dev/null) repo_files=$(ls /etc/apt/sources.list /etc/apt/sources.list.d/*.list 2>/dev/null)
log_function_data "apt repo files: $repo_files" log_function_data "apt repo files: $repo_files"
for repo_file in $apt_file $repo_files for repo_file in $repo_files
do do
if [[ -n $1 ]];then if [[ -n $1 ]];then
cat $repo_file &> $1/repo-data_${repo_file//\//-}.txt cat $repo_file &> $1/repo-data_${repo_file//\//-}.txt
@ -9305,14 +9305,7 @@ get_repo_data()
!/^[[:space:]]*$|^[[:space:]]*#/ { !/^[[:space:]]*$|^[[:space:]]*#/ {
print "apt sources^" repoFile "^" $0 print "apt sources^" repoFile "^" $0
}' $repo_file )" }' $repo_file )"
if [[ -n $repo_data_working ]];then get_repo_builder "$repo_data_working"
if [[ -z $REPO_DATA ]];then
REPO_DATA="$repo_data_working"
else
REPO_DATA="$REPO_DATA
$repo_data_working"
fi
fi
done done
repo_data_working='' repo_data_working=''
fi fi
@ -9392,16 +9385,8 @@ get_repo_data()
} }
} }
' $repo_file )" ' $repo_file )"
# then load the global for each file as it gets filled # then load the global for each file as it gets filled
if [[ -n $repo_data_working ]];then get_repo_builder "$repo_data_working"
if [[ -z $REPO_DATA ]];then
REPO_DATA="$repo_data_working"
else
REPO_DATA="$REPO_DATA
$repo_data_working"
fi
fi
done done
fi fi
repo_data_working='' repo_data_working=''
@ -9456,14 +9441,7 @@ $repo_data_working"
!/^[[:space:]]*$|^[[:space:]]*#/ { !/^[[:space:]]*$|^[[:space:]]*#/ {
print "slackpkg sources^" repoFile "^" $0 print "slackpkg sources^" repoFile "^" $0
}' $slackpkg_file )" }' $slackpkg_file )"
if [[ -n $repo_data_working ]];then get_repo_builder "$repo_data_working"
if [[ -z $REPO_DATA ]];then
REPO_DATA="$repo_data_working"
else
REPO_DATA="$REPO_DATA
$repo_data_working"
fi
fi
fi fi
if [[ -f $slackpkg_plus_file ]];then if [[ -f $slackpkg_plus_file ]];then
if [[ -n $1 ]];then if [[ -n $1 ]];then
@ -9493,14 +9471,7 @@ $repo_data_working"
} }
} }
}' $slackpkg_plus_file )" }' $slackpkg_plus_file )"
if [[ -n $repo_data_working ]];then get_repo_builder "$repo_data_working"
if [[ -z $REPO_DATA ]];then
REPO_DATA="$repo_data_working"
else
REPO_DATA="$REPO_DATA
$repo_data_working"
fi
fi
fi fi
repo_data_working='' repo_data_working=''
elif [[ -d $pisi_dir && -n $( type -p pisi ) ]];then elif [[ -d $pisi_dir && -n $( type -p pisi ) ]];then
@ -9589,12 +9560,7 @@ $repo_data_working"
exit exit
} }
' $ports_conf )" ' $ports_conf )"
if [[ -z $REPO_DATA ]];then get_repo_builder "$repo_data_working"
REPO_DATA="$repo_data_working"
elif [[ -n $repo_data_working ]];then
REPO_DATA="$REPO_DATA
$repo_data_working"
fi
fi fi
if [[ -f $freebsd_file ]];then if [[ -f $freebsd_file ]];then
if [[ -n $1 ]];then if [[ -n $1 ]];then
@ -9609,12 +9575,7 @@ $repo_data_working"
exit exit
} }
' $freebsd_file )" ' $freebsd_file )"
if [[ -z $REPO_DATA ]];then get_repo_builder "$repo_data_working"
REPO_DATA="$repo_data_working"
elif [[ -n $repo_data_working ]];then
REPO_DATA="$REPO_DATA
$repo_data_working"
fi
fi fi
if [[ -f $freebsd_pkg_file ]];then if [[ -f $freebsd_pkg_file ]];then
if [[ -n $1 ]];then if [[ -n $1 ]];then
@ -9630,12 +9591,7 @@ $repo_data_working"
exit exit
} }
' $freebsd_pkg_file )" ' $freebsd_pkg_file )"
if [[ -z $REPO_DATA ]];then get_repo_builder "$repo_data_working"
REPO_DATA="$repo_data_working"
elif [[ -n $repo_data_working ]];then
REPO_DATA="$REPO_DATA
$repo_data_working"
fi
fi fi
if [[ -d $bsd_pkg_dir ]];then if [[ -d $bsd_pkg_dir ]];then
@ -9675,12 +9631,7 @@ $repo_data_working"
} }
} }
' $repo_file )" ' $repo_file )"
if [[ -z $REPO_DATA ]];then get_repo_builder "$repo_data_working"
REPO_DATA="$repo_data_working"
elif [[ -n $repo_data_working ]];then
REPO_DATA="$REPO_DATA
$repo_data_working"
fi
done done
fi fi
repo_data_working='' repo_data_working=''
@ -9707,19 +9658,25 @@ $repo_data_working"
!/^[[:space:]]*$|^[[:space:]]*#/ { !/^[[:space:]]*$|^[[:space:]]*#/ {
print "NetBSD pkg servers^" repoFile "^" $0 print "NetBSD pkg servers^" repoFile "^" $0
}' $repo_file )" }' $repo_file )"
if [[ -n $repo_data_working ]];then get_repo_builder "$repo_data_working"
if [[ -z $REPO_DATA ]];then
REPO_DATA="$repo_data_working"
else
REPO_DATA="$REPO_DATA
$repo_data_working"
fi
fi
done done
repo_data_working='' repo_data_working=''
fi fi
eval $LOGFE eval $LOGFE
} }
# build the total REPO_DATA global here
# args: $1 - the repo line/s
get_repo_builder()
{
if [[ -n $1 ]];then
if [[ -z $REPO_DATA ]];then
REPO_DATA="$1"
else
REPO_DATA="$REPO_DATA
$1"
fi
fi
}
get_runlevel_data() get_runlevel_data()
{ {

View file

@ -1,3 +1,19 @@
=====================================================================================
Version: 2.2.14
Patch Version: 00
Script Date: 2014-09-26
-----------------------------------
Changes:
-----------------------------------
New version, new tarball. Bug fix for regression introduced in last versions. Double
output for apt repos. Also refactored duplicated code into a function, no other changes.
Note that this version features the repo debugger tool as well, which is very helpful in
particularly non apt systems to fix issues with its handling of repo formats etc.
-----------------------------------
-- Harald Hope - Sat, 27 Sep 2014 00:09:07 -0700
===================================================================================== =====================================================================================
Version: 2.2.13 Version: 2.2.13
Patch Version: 00 Patch Version: 00