version -> 0.4.6

fix for pkg_summary4view: doesn't depend on input fields order.
   fix for pkg_src_summary: PKGNAME and PKGPATH are printed first.
This commit is contained in:
Aleksey Cheusov 2008-04-13 12:03:20 +00:00 committed by Thomas Klausner
parent f4ec04e21a
commit 30d85ba675
4 changed files with 34 additions and 16 deletions

View file

@ -1 +1 @@
VERSION= 0.4.5
VERSION= 0.4.6

View file

@ -1,3 +1,8 @@
Version 0.4.6, by Aleksey Cheusov, Sun, 13 Apr 2008 14:56:41 +0300
fix for pkg_summary4view: doesn't depend on input fields order.
fix for pkg_src_summary: PKGNAME and PKGPATH are printed first.
Version 0.4.5, by Aleksey Cheusov, Sat, 13 Apr 2008 00:43:22 +0300
Both pkg_micro_src_summary and pkg_src_summary generate

View file

@ -42,6 +42,7 @@ mkdir -m 700 "$tmp_dir"
tmpfn=$tmp_dir/pkgdirs2info.txt
errsfn=$tmp_dir/errors.txt
summaryfn=$tmp_dir/summary.txt
############################################################
summary_data2summary (){
@ -79,7 +80,7 @@ summary_data2summary (){
$1 = $2 = ""
print hdr substr($0, 3)
}'
}' "$@"
}
cd_and_print_summary_data (){
@ -90,13 +91,15 @@ cd_and_print_summary_data (){
generate_summary (){
# general information
if cd_and_print_summary_data $1 > "$tmpfn" 2>"$errsfn" &&
cat "$tmpfn" | summary_data2summary 2>>"$errsfn";
summary_data2summary "$tmpfn" 2>>"$errsfn" > "$summaryfn";
then
pkgname=`awk '$1 == "index" {print $3}' "$tmpfn"`
pkgpath=`awk '$1 == "index" {print $2}' "$tmpfn"`
echo "PKGNAME=$pkgname"
echo "PKGPATH=$pkgpath"
cat "$summaryfn"
# not expanding PLIST yet
plist_fn=$1/PLIST
if test -f $plist_fn; then

View file

@ -21,10 +21,12 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
function spaces (n){
function spaces (n, ret){
ret = ""
while (n-- > 0){
printf " "
ret = ret " "
}
return ret
}
BEGIN {
@ -38,12 +40,16 @@ BEGIN {
NF == 0 {
print
last_field = ""
last_field = ""
printf "%s", accu
accu = ""
to_be_printed = 0
next
}
/^PKGNAME=/ {
print "-----------------------------------------------------------"
to_be_printed = 1
}
{
@ -56,28 +62,28 @@ NF == 0 {
#
if (field == "DEPENDS" || field == "BUILD_DEPENDS"){
printf "%s:", field
accu = accu field ":"
if ($0 !~ /^( |\t)*$/)
spaces(offset - length(field) - 1)
accu = accu spaces(offset - length(field) - 1)
print $1
accu = accu $1 "\n"
for (i=2; i <= NF; ++i){
spaces(offset)
print $i
accu = accu spaces(offset)
accu = accu $i "\n"
}
next
}else if (field in special) {
if (field != prev_field) {
print field ":"
accu = accu field ":"
}
printf " "
accu = accu " "
}else{
printf "%s:", field
accu = accu field ":"
if ($0 !~ /^( |\t)*$/)
spaces(offset - length(field) - 1)
accu = accu spaces(offset - length(field) - 1)
}
#
@ -85,5 +91,9 @@ NF == 0 {
}
{
print $0
accu = accu $0 "\n"
if (to_be_printed){
printf "%s", accu
accu = ""
}
}