From c0edb589bd18ba5d8204dfc4a6539f398ab92286 Mon Sep 17 00:00:00 2001 From: milisbir Date: Wed, 13 Dec 2017 16:05:54 +0200 Subject: [PATCH] mps-html --- bin/mps | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/bin/mps b/bin/mps index dc5fb103c..10aa9e77b 100755 --- a/bin/mps +++ b/bin/mps @@ -271,7 +271,7 @@ paket_bilgi(){ if [ "$2" ]; then cikti="$2" fi - if [ $cikti == "--json" ];then + if [ $cikti == "--html" ];then _yaz="echo" _yaz_uyari="echo" _yaz_son="
" @@ -286,13 +286,13 @@ paket_bilgi(){ if [ "$kkont" = "kurulu" ];then paket="$1" satir=`sed -n '1p' < $VT/"$paket"/META` - $_yaz "ADI :" ${satir:1:${#satir}-1} $_yaz_son + $_yaz "ADI :" ${satir:1:${#satir}-1} #$_yaz_son satir=`sed -n '2p' < $VT/"$paket"/META` - $_yaz "TANIM :" ${satir:1:${#satir}-1} $_yaz_son + $_yaz "TANIM :" ${satir:1:${#satir}-1} #$_yaz_son satir=`sed -n '3p' < $VT/"$paket"/META` - $_yaz "URL :" ${satir:1:${#satir}-1} $_yaz_son + $_yaz "URL :" ${satir:1:${#satir}-1} #$_yaz_son satir=`sed -n '5p' < $VT/"$paket"/META` - $_yaz "PAKETÇİ :" ${satir:1:${#satir}-1} $_yaz_son + $_yaz "PAKETÇİ :" ${satir:1:${#satir}-1} #$_yaz_son satir=`sed -n '6p' < $VT/"$paket"/META` satir=${satir:1:${#satir}-1} printf -v boyut '%d\n' "$satir" 2>/dev/null @@ -303,17 +303,17 @@ paket_bilgi(){ boyut=$(($boyut/1024/1024)) _ek="mb" fi - $_yaz "KUR BOYUT :" "$boyut $_ek (tahmini)" $_yaz_son + $_yaz "KUR BOYUT :" "$boyut $_ek (tahmini)" #$_yaz_son satir=`sed -n '7p' < $VT/"$paket"/META` - $_yaz "SÜRÜM :" ${satir:1:${#satir}-1} $_yaz_son + $_yaz "SÜRÜM :" ${satir:1:${#satir}-1} #$_yaz_son satir=`sed -n '8p' < $VT/"$paket"/META` - $_yaz "DEVİR :" ${satir:1:${#satir}-1} $_yaz_son + $_yaz "DEVİR :" ${satir:1:${#satir}-1} #$_yaz_son satir=`sed -n '9p' < $VT/"$paket"/META` - $_yaz "PAKETLENME :" `date -d @${satir:1:${#satir}-1}` $_yaz_son + $_yaz "PAKETLENME :" `date -d @${satir:1:${#satir}-1}` #$_yaz_son satir=`sed -n '10p' < $VT/"$paket"/META` - $_yaz "MİMARİ :" ${satir:1:${#satir}-1} $_yaz_son + $_yaz "MİMARİ :" ${satir:1:${#satir}-1} #$_yaz_son satir=`sed -n '11p' < $VT/"$paket"/META` - $_yaz "GRUP :" ${satir:1:${#satir}-1} $_yaz_son + $_yaz "GRUP :" ${satir:1:${#satir}-1} #$_yaz_son elif [ "$kkont" = "degil" ];then $_yaz_uyari "$1 $_paket_kurulu_degil" else @@ -321,6 +321,22 @@ paket_bilgi(){ fi } +paket_bilgi_html(){ + _dosya=$1 + icerik="" + while IFS='' read -r satir || [[ -n "$line" ]]; do + icerik+="" + _sutun_baslik="$(echo $satir | cut -d':' -f1)" + _sutun_deger="$(echo $satir | cut -d':' -f2)" + icerik+="" + icerik+="" + #[ '${_sutun_baslik}' <> '${_sutun_deger}' ] && icerik+="" + icerik+="" + done < "$_dosya" + icerik+="
$_sutun_baslik$_sutun_deger$_sutun_deger
" + echo "$icerik" > $_dosya.html +} + yeniden_paketle(){ cd $1 bsdtar -r -f ../"$1".mps .META @@ -2501,6 +2517,7 @@ ayarlar() { if [ $2 ];then touch "/tmp/mps_paket_bilgi_$2" paket_bilgi "$2" "$3" | tee "/tmp/mps_paket_bilgi_$2" + [ $2 = "--html" ]; paket_bilgi_html "/tmp/mps_paket_bilgi_$2" else ryaz 31 "paket ismi eksik" exit 1