[haiku-bugs] [Haiku] #8169: haiku-files.org -- PHP doesn't detect *hrev* nightly images

  • From: "mmadia" <trac@xxxxxxxxxxxx>
  • Date: Thu, 01 Dec 2011 10:30:42 -0000

#8169: haiku-files.org -- PHP doesn't detect *hrev* nightly images
---------------------+-------------------------
 Reporter:  mmadia   |        Owner:  haiku-web
     Type:  bug      |       Status:  new
 Priority:  normal   |    Milestone:
Component:  Website  |      Version:
 Keywords:           |   Blocked By:
 Blocking:           |  Has a Patch:  0
 Platform:  All      |
---------------------+-------------------------
 With the switch to git, the nightly images will no longer have r###### in
 their filename, rather hrev#####.   e.g. {{{ haiku_unsupported-nightly-
 hrev43373-x86gcc2-anyboot.tar.xz }}}

 The current code for generating the tables does not handle "hrev*"

 scanDirectory.php:42-68
 {{{
                 while (($file = readdir($directory)) !== false) {
                         if (substr($file, 0, 1) == ".") continue;
                         if (filetype($dirName . "/" . $file) == "file") {
                                 // try to find a revision in there...
                                 if (preg_match("/r[0-9]{2,8}/", $file,
 $regs)) {
                                         $revision = substr($regs[0], 1);
                                         $format = "";
                                         foreach($formats as $_format) {
                                                 if
 (ereg($_format["regexp"], $file, $regs)) {
                                                         $format =
 $_format["title"];
                                                 }
                                         }
                                         if ($format == "")
                                                 continue;
                                         if (!isset($rows[$revision])) {
                                                 $rows[$revision] =
 Array();
                                         }
                                         $size =
 format_bytes(filesize($dirName.'/'.$file));
                                         $date = date("Y-m-j",
 filemtime($dirName.'/'.$file));
                                         $extension = substr($file,
 strrpos($file, ".")+1);
                                         $rows[$revision][$format][] =
 Array("date"=>$date,
 "extension"=>$extension,
 "filename"=>$file,
 "size"=>$size);
                                 }
                         }
         }
 }}}



 By the way, www.haiku-files.org is contained within a mercurial
 repository.
 {{{ hg clone ssh://haiku_files@xxxxxxxxxxxxxxx }}}
 The usual {{{ hg push ; ssh haiku_files@xxxxxxxxxxxxxxx ; hg up }}} is
 needed after committing locally.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/8169>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: