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

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
Patch Version: 00