Mercurial > hg > Members > kono > nitros9-code
annotate scripts/mkdskindex @ 3295:6b7a7b233925 default tip
makefile: Allow PORTS with level1/2 mix
https://sourceforge.net/p/nitros9/feature-requests/10/
author | Tormod Volden <debian.tormod@gmail.com> |
---|---|
date | Tue, 19 Apr 2022 18:12:17 +0200 |
parents | 7c917d36ea68 |
children |
rev | line source |
---|---|
3186
7c917d36ea68
Use any available perl for running mkdskindex
Bill Pierce <merlinious999@gmail.com>
parents:
3155
diff
changeset
|
1 #!perl |
2512 | 2 |
3 # generate pretty index.html from directory of .dsks | |
4 # AAW 4/5/10 | |
5 | |
6 | |
7 $dirtoget=$ARGV[0]; | |
8 | |
9 opendir(DSKD, $dirtoget) || die("Cannot open directory"); | |
10 | |
11 @dsks=readdir(DSKD); | |
12 | |
13 &header; | |
14 | |
15 print "<TABLE class=tab1>"; | |
16 | |
17 print "<TR id='header'><TD class='h1'>File</td><TD class='h1'>Name</td><TD class='h1'>Size</td><TD class='h1'>Created</td><TD class='h1'>Sectors</td><TD class='h1'>Format</td></tr>"; | |
18 | |
19 foreach $dsk (sort @dsks) | |
20 { | |
21 | |
3155
96af4bcea625
scripts/mkdskindex: Tag .img (other) and .DSK (RSDOS) images
Tormod Volden <debian.tormod@gmail.com>
parents:
2962
diff
changeset
|
22 if ($dsk =~ m/.*\.(dsk|img|DSK)$/) |
2512 | 23 { |
24 @os9id = `os9 id $dirtoget/$dsk`; | |
25 | |
26 foreach $line (@os9id) | |
27 { | |
28 if ($line =~ m/Disk\sname\s+:\s+(.*)/) | |
29 { | |
30 $name = $1; | |
31 } | |
32 elsif ($line =~ m/Disk\sformat\s+:.*\((.*)\)/) | |
33 { | |
34 $format = $1; | |
35 } | |
36 elsif ($line =~ m/Creation\sdate\s+:\s+(.*)/) | |
37 { | |
38 $created = $1; | |
39 } | |
40 elsif ($line =~ m/Total\ssectors\s+:\s+(.*)/) | |
41 { | |
42 $sectors = $1; | |
43 } | |
44 | |
45 | |
46 } | |
47 | |
2934
0bd529f1d860
Update mkdskimage script to recognize DW images
Tormod Volden <debian.tormod@gmail.com>
parents:
2898
diff
changeset
|
48 if ($dsk =~ m/_dw[\._]/) |
2512 | 49 { |
50 $format = "DriveWire 3/4"; | |
51 } | |
52 | |
2760
a711c2eecbbd
Updated mkdskindex to correct state that the becker disks are a DriveWire 3/4 disk rather than being a standard floppy disk image.
drencor-xeen
parents:
2512
diff
changeset
|
53 if ($dsk =~ m/_becker[\._]/) |
a711c2eecbbd
Updated mkdskindex to correct state that the becker disks are a DriveWire 3/4 disk rather than being a standard floppy disk image.
drencor-xeen
parents:
2512
diff
changeset
|
54 { |
a711c2eecbbd
Updated mkdskindex to correct state that the becker disks are a DriveWire 3/4 disk rather than being a standard floppy disk image.
drencor-xeen
parents:
2512
diff
changeset
|
55 $format = "DriveWire 3/4"; |
a711c2eecbbd
Updated mkdskindex to correct state that the becker disks are a DriveWire 3/4 disk rather than being a standard floppy disk image.
drencor-xeen
parents:
2512
diff
changeset
|
56 } |
a711c2eecbbd
Updated mkdskindex to correct state that the becker disks are a DriveWire 3/4 disk rather than being a standard floppy disk image.
drencor-xeen
parents:
2512
diff
changeset
|
57 |
2860
8bd3a42345b2
mkdskindex: Detect and tag CoCo SDC disk images
Tormod Volden <debian.tormod@gmail.com>
parents:
2774
diff
changeset
|
58 if ($dsk =~ m/_cocosdc[\._]/) |
8bd3a42345b2
mkdskindex: Detect and tag CoCo SDC disk images
Tormod Volden <debian.tormod@gmail.com>
parents:
2774
diff
changeset
|
59 { |
8bd3a42345b2
mkdskindex: Detect and tag CoCo SDC disk images
Tormod Volden <debian.tormod@gmail.com>
parents:
2774
diff
changeset
|
60 $format = "CoCo SDC"; |
8bd3a42345b2
mkdskindex: Detect and tag CoCo SDC disk images
Tormod Volden <debian.tormod@gmail.com>
parents:
2774
diff
changeset
|
61 } |
8bd3a42345b2
mkdskindex: Detect and tag CoCo SDC disk images
Tormod Volden <debian.tormod@gmail.com>
parents:
2774
diff
changeset
|
62 |
3155
96af4bcea625
scripts/mkdskindex: Tag .img (other) and .DSK (RSDOS) images
Tormod Volden <debian.tormod@gmail.com>
parents:
2962
diff
changeset
|
63 if ($dsk =~ m/.*\.img/) |
96af4bcea625
scripts/mkdskindex: Tag .img (other) and .DSK (RSDOS) images
Tormod Volden <debian.tormod@gmail.com>
parents:
2962
diff
changeset
|
64 { |
96af4bcea625
scripts/mkdskindex: Tag .img (other) and .DSK (RSDOS) images
Tormod Volden <debian.tormod@gmail.com>
parents:
2962
diff
changeset
|
65 $format = "Other disk image"; |
96af4bcea625
scripts/mkdskindex: Tag .img (other) and .DSK (RSDOS) images
Tormod Volden <debian.tormod@gmail.com>
parents:
2962
diff
changeset
|
66 } |
96af4bcea625
scripts/mkdskindex: Tag .img (other) and .DSK (RSDOS) images
Tormod Volden <debian.tormod@gmail.com>
parents:
2962
diff
changeset
|
67 |
96af4bcea625
scripts/mkdskindex: Tag .img (other) and .DSK (RSDOS) images
Tormod Volden <debian.tormod@gmail.com>
parents:
2962
diff
changeset
|
68 if ($dsk =~ m/.*\.DSK/) |
96af4bcea625
scripts/mkdskindex: Tag .img (other) and .DSK (RSDOS) images
Tormod Volden <debian.tormod@gmail.com>
parents:
2962
diff
changeset
|
69 { |
96af4bcea625
scripts/mkdskindex: Tag .img (other) and .DSK (RSDOS) images
Tormod Volden <debian.tormod@gmail.com>
parents:
2962
diff
changeset
|
70 $format = "RSDOS"; |
96af4bcea625
scripts/mkdskindex: Tag .img (other) and .DSK (RSDOS) images
Tormod Volden <debian.tormod@gmail.com>
parents:
2962
diff
changeset
|
71 $created = "-"; |
96af4bcea625
scripts/mkdskindex: Tag .img (other) and .DSK (RSDOS) images
Tormod Volden <debian.tormod@gmail.com>
parents:
2962
diff
changeset
|
72 $sectors = "-"; |
96af4bcea625
scripts/mkdskindex: Tag .img (other) and .DSK (RSDOS) images
Tormod Volden <debian.tormod@gmail.com>
parents:
2962
diff
changeset
|
73 } |
96af4bcea625
scripts/mkdskindex: Tag .img (other) and .DSK (RSDOS) images
Tormod Volden <debian.tormod@gmail.com>
parents:
2962
diff
changeset
|
74 |
2512 | 75 $size = -s "$dirtoget/$dsk"; |
76 | |
77 $size = int($size / 1024) . "k"; | |
78 | |
79 print "<TR class='r1'>"; | |
80 print "<td class='d1'><A HREF=$dsk>$dsk</A></td>"; | |
81 print "<TD class='d1'>$name</td>"; | |
82 print "<TD class='d1'>$size</td>"; | |
83 print "<td class='d1'>$created</td>"; | |
84 print "<td class='d1'>$sectors</td>"; | |
85 print "<TD class='d1'>$format</TD>"; | |
86 print "</tr>\r\n"; | |
87 | |
88 } | |
3155
96af4bcea625
scripts/mkdskindex: Tag .img (other) and .DSK (RSDOS) images
Tormod Volden <debian.tormod@gmail.com>
parents:
2962
diff
changeset
|
89 |
96af4bcea625
scripts/mkdskindex: Tag .img (other) and .DSK (RSDOS) images
Tormod Volden <debian.tormod@gmail.com>
parents:
2962
diff
changeset
|
90 if ($dsk eq "ReadMe") |
96af4bcea625
scripts/mkdskindex: Tag .img (other) and .DSK (RSDOS) images
Tormod Volden <debian.tormod@gmail.com>
parents:
2962
diff
changeset
|
91 { |
96af4bcea625
scripts/mkdskindex: Tag .img (other) and .DSK (RSDOS) images
Tormod Volden <debian.tormod@gmail.com>
parents:
2962
diff
changeset
|
92 print "<td class='d1'><A HREF=$dsk>$dsk</A></td>"; |
96af4bcea625
scripts/mkdskindex: Tag .img (other) and .DSK (RSDOS) images
Tormod Volden <debian.tormod@gmail.com>
parents:
2962
diff
changeset
|
93 print "\r\n"; |
96af4bcea625
scripts/mkdskindex: Tag .img (other) and .DSK (RSDOS) images
Tormod Volden <debian.tormod@gmail.com>
parents:
2962
diff
changeset
|
94 } |
2512 | 95 } |
96 | |
97 print "</TABLE>"; | |
98 | |
99 &footer; | |
100 | |
101 closedir(DSKD); | |
102 | |
103 | |
104 | |
105 | |
106 | |
107 sub header | |
108 { | |
109 print "<HTML><HEAD><TITLE>Latest disk images</TITLE>"; | |
110 | |
111 print '<style type="text/css">'; | |
112 | |
113 print 'body { margin: 0px; padding 0px; }'; | |
114 print 'td.h1 { font-family: arial; padding: 5px; padding-right: 10px; font-size:12px; color: #FFFFFF; background-color: #444444; }'; | |
115 print 'td.d1 { font-family: arial; padding: 5px; padding-right: 10px; font-size:12px; }'; | |
116 print 'table.tab1 { margin: 10px; border-collapse:collapse;}'; | |
117 | |
118 print 'h4 { font-family: arial; padding: 10px;}'; | |
119 | |
120 print "</style>"; | |
121 | |
122 print "</HEAD><BODY>"; | |
123 print "<H4>NitrOS-9: Latest disk images</h4>"; | |
124 | |
125 } | |
126 | |
127 | |
128 sub footer | |
129 { | |
130 print "</BODY></HTML>"; | |
131 | |
132 | |
133 } |