Added content to index.html and a subroutine called file_tests
authorJeremiah Foster <jeremiah@test.maemo.org>
Tue, 19 May 2009 17:58:25 +0000 (20:58 +0300)
committerJeremiah Foster <jeremiah@test.maemo.org>
Tue, 19 May 2009 17:58:25 +0000 (20:58 +0300)
maemian
www/index.html

diff --git a/maemian b/maemian
index 11d9985..94e4eaf 100755 (executable)
--- a/maemian
+++ b/maemian
@@ -40,9 +40,31 @@ use Carp;
 my $inputfile;             # --- A file passed to maemian 
 GetOptions ("inputfile|i=s" => \$inputfile);
 
-if ($inputfile && -x $inputfile) {
-  print "$inputfile\n";
-} else {
-  croak "Have you specified an input file?\n $!\n";
+sub file_tests {
+  use File::Basename;
+  my $path = shift;
+  if (-r $path) {
+    my ($filename, $dirs) = fileparse($path);
+    if ($filename =~ /maemo/) {
+      print "W: Any use of the word \"maemo\" is subject to trademark.\n";
+    }
+
+    # --- Open file into an array
+    open my $file, '<', $path or die "Cannot open file: $!\n";
+    my @lines = <$file>;
+    close $file;
+
+    if (grep /BEGIN PGP SIGNED MESSAGE/, @lines) {
+      print "$filename is signed\n";
+    }
+    # print "\n$dirs\n$filename\n";
+  } else {
+    croak "File not readable: $!\n";
+  }
 }
 
+if ($inputfile) {
+  file_tests($inputfile);
+} else {
+  croak "No input file found: $!\n";
+}
index 4999fe6..2a22f4a 100644 (file)
@@ -6,5 +6,6 @@
   <meta name="copyright" content="Jeremiah Foster 2009" />
   <meta name="license" content="Copyright (c) 2009 JEREMIAH FOSTER" />
 <body>
-Hello and welcome to Maemian, the policy checker for Maemo.
+<h4>Hello and welcome to Maemian, the policy checker for Maemo.</h4>
+<p>You can browse the repo here <a href="https://git.maemo.org/projects/maemian/gitweb?p=maemian">git repo</a>
 </body></html>