diff --git a/bin/talimatname_indeks.sh b/bin/talimatname_indeks.sh new file mode 100755 index 000000000..3b68806e8 --- /dev/null +++ b/bin/talimatname_indeks.sh @@ -0,0 +1,67 @@ +#!/bin/sh + +if [ -z $1 ];then + echo "kullanım: $0 > index.html" + exit 1 +fi + +paketdepo="http://paketler.milislinux.org" +dosya=/tmp/paket_konumlar +[ -f $dosya ] && rm -rf $dosya +find /root/talimatname/temel/* -type d > $dosya +find /root/talimatname/genel/*/* -type d >> $dosya + +echo "" +echo '' +echo '' +echo '' +echo '' +echo '' +echo '' +echo '' +echo '' +echo '' +echo '' +echo '' +echo '' +echo '' +echo '' + +echo '' + +while IFS='' read -r konum || [[ -n "$konum" ]]; do + + echo "" + + # Grup + grup=$(grep -ri "# Grup:" $konum/talimat | cut -d ':' -f2-) + echo "" + + # İsim + isim=$(basename $konum) + echo "" + + # Surum-Devir + surum=$(grep -ri ^"surum=" $konum/talimat | cut -d '=' -f2-) + devir=$(grep -ri ^"devir=" $konum/talimat | cut -d '=' -f2-) + echo "" + + # Tanım + tanim=$(grep -ri "# Tanım:" $konum/talimat | cut -d ':' -f2-) + echo "" + + # Url + url=$(grep -ri "# Url:" $konum/talimat | cut -d ':' -f2-) + echo "" + + # İndir + echo "" + # %23 = # + + echo "" +done < "$dosya" + +echo '' +echo "
GrupisimSürümAçıklamaUrlPaket Adresi
$grup$isim$surum-$devir$tanim$urlindir
" +echo "" + diff --git a/bin/talimatname_indeks_yap b/bin/talimatname_indeks_yap deleted file mode 100755 index 8c2e62939..000000000 --- a/bin/talimatname_indeks_yap +++ /dev/null @@ -1,313 +0,0 @@ -#!/usr/bin/perl -w - -our $version = "1.0.4"; - -######################################################################## -# -# portspage (http://www.karsikkopuu.net/crux/scripts/) -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# 2017 milis linux talimatnamesine uyarlama - milisarge -######################################################################## - -use strict; - -our %options = -( - title => "Milis Linux Talimatnamesi", - timestamp_accuracy => 1, - date_from_file => 0, -); - -sub print_usage -{ - print <) - { - if ($_ =~ /^#\s*(.*?):\s*(.*)$/) - { - my $key = $1; - my $value = $2; - $value =~ s//>/g; - $value =~ s/&/&/g; - $parsed{$key} = $value; - } - elsif ($_ =~ /^version=(.*)$/) - { - $parsed{version} = $1; - } - elsif ($_ =~ /^release=(.*)$/) - { - $parsed{release} = $1; - } - } - close (FILE); - } - - return { %parsed }; -} - -sub main -{ - my %db; - - parse_args(); - - if (!$options{directory}) - { - print_usage(); - return 0; - } - - foreach my $file (recurse_tree($options{directory})) - { - if ($file =~ q:.*/(.*)/talimat$:) - { - $db{$1} = parse_pkgfile("$file"); - } - } - - print < - - - - - - -EOH - - print " $options{title}\n"; - - print < - body - { - font-family: Verdana, sans-serif; - font-size: 85%; - padding: 2em; - } - a - { - color: black; - } - table - { - border: solid #CAD4E9 1px; - font-size: 85%; - } - td - { - padding: 6px; - } - tr.header - { - background-color: #CAD4E9; - } - tr.odd - { - background-color: #ECF0F7; - } - tr.even - { - background-color: #F7F9FC; - } - - - - -EOH - - print "

$options{title}

\n"; - - if ($options{header}) - { - open(FILE, $options{header}) or die "Couldn't open header file"; - while () - { - print " " . $_; - } - close(FILE); - } - - print " \n"; - print " "; - if ($options{timestamp_accuracy} > 0) - { - print ""; - } - print "\n"; - our $odd = "odd"; - my $count = 0; - foreach my $port (sort keys %db) - { - $count++; - print " "; - - if ($options{timestamp_accuracy} > 0) - { - my $date; - - if ($options{date_from_file}) - { - my @files = recurse_tree("$options{directory}/$port"); - my @dates; - foreach my $file (@files) - { - push (@dates, (stat($file))[9]); - } - @dates = sort @dates; - $date = $dates[$#dates]; - - } - elsif ($options{date_from_pkgfile}) - { - $date = (stat("$options{directory}/$port/talimat"))[9]; - } - else - { - $date = (stat("$options{directory}/$port"))[9]; - } - - print ""; - } - - print "\n"; - - if ($odd eq "odd") { $odd = "even"; } - else { $odd = "odd"; } - } - print "
TalimatSürümAçıklamaSon değişiklik
"; - $db{$port}{URL} ? print "$port" : print "$port"; - print "$db{$port}{version}-$db{$port}{release}"; - print $db{$port}{Description} if $db{$port}{Description}; - print "" . isotime($date, $options{timestamp_accuracy}) . "
\n"; - print "

$count talimat

\n"; - - if ($options{footer}) - { - open(FILE, $options{footer}) or die "Couldn't open footer file"; - while () - { - print " " . $_; - } - close(FILE); - } - - print < - -EOH - - return 0; -} - -sub isotime -{ - my $time = (shift or time); - my $accuracy = (shift or 2); - my @t = gmtime ($time); - my $year = $t[5] + 1900; - my $month = sprintf("%02d", $t[4] + 1); - my $day = sprintf("%02d", $t[3]); - - if ($accuracy == 1) - { - return "$year-$month-$day"; - } - - return "$year-$month-$day " . sprintf("%02d:%02d:%02d UTC", $t[2], $t[1], $t[0]); -} - -exit(main()); - -# End of file