[gnomeweb-wml] cheese: fix hash retrieval in the update script



commit 381f0d38506700502ad9a5467e9705d5347d9e76
Author: Filippo Argiolas <filippo argiolas gmail com>
Date:   Thu Jun 18 15:55:53 2009 +0200

    cheese: fix hash retrieval in the update script

 projects.gnome.org/cheese/stable.shtml           |   14 +++---
 projects.gnome.org/cheese/stable_archive.shtml   |   16 ++++----
 projects.gnome.org/cheese/unstable.shtml         |   10 ++--
 projects.gnome.org/cheese/unstable_archive.shtml |   48 +++++++++++-----------
 projects.gnome.org/cheese/update.pl              |   40 ++++++++++++++++--
 5 files changed, 79 insertions(+), 49 deletions(-)
---
diff --git a/projects.gnome.org/cheese/stable.shtml b/projects.gnome.org/cheese/stable.shtml
index aa7034d..7d2a8f9 100644
--- a/projects.gnome.org/cheese/stable.shtml
+++ b/projects.gnome.org/cheese/stable.shtml
@@ -6,7 +6,7 @@
   </a>
   <p>
     released on May 19th 2009 <br />
-    md5sum: bd8ed8834fe92996a59919229aaa3038
+    md5sum: ab6bd52bac51235ec37182ee8969941a
   </p>
 </div>
 
@@ -18,7 +18,7 @@
   </a>
   <p>
     released on March 16th 2009 <br />
-    md5sum: 17c991c695c3a7549da6e42d1b327d79
+    md5sum: bb526e605e9ffcf29cc91aa2c2667058
   </p>
 </div>
 
@@ -30,7 +30,7 @@
   </a>
   <p>
     released on January 12th 2009 <br />
-    md5sum: 11ef1f92b77844b124276c92b464e23a
+    md5sum: 5927aec118b7f900f19806c256893d6f
   </p>
 </div>
 
@@ -42,7 +42,7 @@
   </a>
   <p>
     released on November 25th 2008 <br />
-    md5sum: 5631594e77d3dcab060a6869d764baea
+    md5sum: 2f4b3c1b0040128be8f28b4d135beaa3
   </p>
 </div>
 
@@ -54,7 +54,7 @@
   </a>
   <p>
     released on October 20th 2008 <br />
-    md5sum: 0cc61eaec685ba2447339ae9d1ceb157
+    md5sum: 6508bafea2c00a852c4292043c51c121
   </p>
 </div>
 
@@ -66,7 +66,7 @@
   </a>
   <p>
     released on September 22nd 2008 <br />
-    md5sum: 12536184509158aeffadb3f4aa1fd3fc
+    md5sum: a33c0b6cb211f2ee75757caca77f935b
   </p>
 </div>
 
@@ -78,7 +78,7 @@
   </a>
   <p>
     released on June 29th 2008 <br />
-    md5sum: c3f888c1d9bf6087e2008993d4450248
+    md5sum: c5f767bd9a55d2a515fd8960ec3523c0
   </p>
 </div>
 
diff --git a/projects.gnome.org/cheese/stable_archive.shtml b/projects.gnome.org/cheese/stable_archive.shtml
index 491de72..6ed0bd4 100644
--- a/projects.gnome.org/cheese/stable_archive.shtml
+++ b/projects.gnome.org/cheese/stable_archive.shtml
@@ -6,7 +6,7 @@
   </a>
   <p>
     released on May 26th 2008 <br />
-    md5sum: cc7dae47d077164d2b760d50692a3ce1
+    md5sum: 56029b9030098530a540422ab9a4d811
   </p>
 </div>
 
@@ -18,7 +18,7 @@
   </a>
   <p>
     released on April  8th 2008 <br />
-    md5sum: d38c16fe60a31fad9a64e8e8a473c678
+    md5sum: e1e290e5b6df7ac9e7f79ee824710d01
   </p>
 </div>
 
@@ -30,7 +30,7 @@
   </a>
   <p>
     released on March 10th 2008 <br />
-    md5sum: 94aa1c9837d011c94e4c44d922cd4ea7
+    md5sum: 1ee38d72153065f84198244e2cd96a14
   </p>
 </div>
 
@@ -42,7 +42,7 @@
   </a>
   <p>
     released on September  5th 2007 <br />
-    md5sum: 4187b5962185a12c96fc423a1f9209b0
+    md5sum: f3a14b9ef07167f5fb6b34ccd67de339
   </p>
 </div>
 
@@ -54,7 +54,7 @@
   </a>
   <p>
     released on August 30th 2007 <br />
-    md5sum: 23c70533e77d30e8b35ae8552ca2ccb0
+    md5sum: 652f9e86447a1c797a179eb70b7a4ab0
   </p>
 </div>
 
@@ -66,7 +66,7 @@
   </a>
   <p>
     released on August 21st 2007 <br />
-    md5sum: f8aa07edcc22740cfd497fba6ecbf096
+    md5sum: 1998f9ee1027a4bfe1500b43ac7121e6
   </p>
 </div>
 
@@ -78,7 +78,7 @@
   </a>
   <p>
     released on August 20th 2007 <br />
-    md5sum: 3b5402d179bd7b6368aae1976dfcb44e
+    md5sum: ff71eb6e7a1c56b8ac283fdde9bbc224
   </p>
 </div>
 
@@ -90,7 +90,7 @@
   </a>
   <p>
     released on August 15th 2007 <br />
-    md5sum: 65c897105758b1472c4ff38a041cc240
+    md5sum: ebb2461d8d9ddc813baaf7b1ef91fe20
   </p>
 </div>
 
diff --git a/projects.gnome.org/cheese/unstable.shtml b/projects.gnome.org/cheese/unstable.shtml
index 46a36df..224db44 100644
--- a/projects.gnome.org/cheese/unstable.shtml
+++ b/projects.gnome.org/cheese/unstable.shtml
@@ -6,7 +6,7 @@
   </a>
   <p>
     released on June 16th 2009 <br />
-    md5sum: 93fc5bcb03062ab1280774dc73cf1b09
+    md5sum: 5a783a9c8fe993e694d8e83ffe9f6c68
   </p>
 </div>
 
@@ -18,7 +18,7 @@
   </a>
   <p>
     released on May 26th 2009 <br />
-    md5sum: 93539fad282884bcc85111861c2f1224
+    md5sum: 17b443543ebd87c8e9c773c2455148c1
   </p>
 </div>
 
@@ -30,7 +30,7 @@
   </a>
   <p>
     released on May  5th 2009 <br />
-    md5sum: 9899984f3b3b7b1f55b3695e6beb4e9e
+    md5sum: 4f9b714df1f8b3ccceb3ffa5ad58c841
   </p>
 </div>
 
@@ -42,7 +42,7 @@
   </a>
   <p>
     released on March  2nd 2009 <br />
-    md5sum: ce57dc5e4535466165517f3e82381bc4
+    md5sum: 014c5646b7b2c3389dd7d281384f941f
   </p>
 </div>
 
@@ -54,7 +54,7 @@
   </a>
   <p>
     released on February 16th 2009 <br />
-    md5sum: 00809808e02e879413a268c9e4939885
+    md5sum: 69e302a0438c64122529cd349b7044c7
   </p>
 </div>
 
diff --git a/projects.gnome.org/cheese/unstable_archive.shtml b/projects.gnome.org/cheese/unstable_archive.shtml
index a7c9091..83cf513 100644
--- a/projects.gnome.org/cheese/unstable_archive.shtml
+++ b/projects.gnome.org/cheese/unstable_archive.shtml
@@ -6,7 +6,7 @@
   </a>
   <p>
     released on February  3rd 2009 <br />
-    md5sum: 4fc108d5e18f5aba61be6f1174799882
+    md5sum: 1137d80afcc4be99c047704a70b47b59
   </p>
 </div>
 
@@ -18,7 +18,7 @@
   </a>
   <p>
     released on January  6th 2009 <br />
-    md5sum: d97ac3f4569dafaf043f61291843714a
+    md5sum: fb0ec94cc252c7a719a0cdd011a74cb8
   </p>
 </div>
 
@@ -30,7 +30,7 @@
   </a>
   <p>
     released on December 15th 2008 <br />
-    md5sum: 588da04d919531a4bf071fb7a46cc0d6
+    md5sum: 7491016ec7a1be192fac28e9685b85e5
   </p>
 </div>
 
@@ -42,7 +42,7 @@
   </a>
   <p>
     released on December  1st 2008 <br />
-    md5sum: 1399ee965be8deae9518ba6e80c0542c
+    md5sum: fda4377306d24def4fb806b4b698c324
   </p>
 </div>
 
@@ -54,7 +54,7 @@
   </a>
   <p>
     released on November  4th 2008 <br />
-    md5sum: 93957c44d66f1799f3a77515698a3c49
+    md5sum: 40fa1c69f3f719e15a294c0f7eb46f23
   </p>
 </div>
 
@@ -66,7 +66,7 @@
   </a>
   <p>
     released on September  9th 2008 <br />
-    md5sum: abb3203570a150c74472ec5b8ec91ea7
+    md5sum: 5ff9b66e4b356b79a8a8b2a0a4dea38b
   </p>
 </div>
 
@@ -78,7 +78,7 @@
   </a>
   <p>
     released on September  1st 2008 <br />
-    md5sum: c74e71898444967251e8cb1ca411df30
+    md5sum: f3d220c93c58ced545a25178636750b9
   </p>
 </div>
 
@@ -90,7 +90,7 @@
   </a>
   <p>
     released on August 18th 2008 <br />
-    md5sum: cd310e5d912c0909233af76664c942f4
+    md5sum: f2ffc5d2d1c07da2d5a085ed8cf7fc86
   </p>
 </div>
 
@@ -102,7 +102,7 @@
   </a>
   <p>
     released on August  5th 2008 <br />
-    md5sum: a75c0084de670e96fb4a67e13f8ea3b2
+    md5sum: 2bdbac73205513f36e91d8a589655d95
   </p>
 </div>
 
@@ -114,7 +114,7 @@
   </a>
   <p>
     released on July 21st 2008 <br />
-    md5sum: d600b8d85ffc83d15df306deebc38601
+    md5sum: 49ade729a10d7341416cf54ba8c3a767
   </p>
 </div>
 
@@ -126,7 +126,7 @@
   </a>
   <p>
     released on June 16th 2008 <br />
-    md5sum: 78c472e2887cc56a2e79fa2a4099b524
+    md5sum: 05a8a6c090b07fedf8e262a9b815acbf
   </p>
 </div>
 
@@ -138,7 +138,7 @@
   </a>
   <p>
     released on June  2nd 2008 <br />
-    md5sum: 053e5b311c9b8ca9a6d66ae471c2f950
+    md5sum: 6a2cd4e46f9f5099672600d5fbd3c6da
   </p>
 </div>
 
@@ -150,7 +150,7 @@
   </a>
   <p>
     released on May 12th 2008 <br />
-    md5sum: 8282dc534fb7d8bdb8a155367829ba56
+    md5sum: b79329e8391b0e0b38a2f0eaeea40f30
   </p>
 </div>
 
@@ -162,7 +162,7 @@
   </a>
   <p>
     released on April 21st 2008 <br />
-    md5sum: 686c1a8b338b116f5fb3d88fff7ef1de
+    md5sum: c61797ad48b632221cff6815c8d62be3
   </p>
 </div>
 
@@ -174,7 +174,7 @@
   </a>
   <p>
     released on February 26th 2008 <br />
-    md5sum: c75947ef79bb2be12fa18d698889e7d1
+    md5sum: a68c7cf2155f799bbc59aad51532f6f4
   </p>
 </div>
 
@@ -186,7 +186,7 @@
   </a>
   <p>
     released on February 11th 2008 <br />
-    md5sum: d137c7643329c8aab695cb688efbfc32
+    md5sum: e76217a0c47aee853c6512339fdf4643
   </p>
 </div>
 
@@ -198,7 +198,7 @@
   </a>
   <p>
     released on January 29th 2008 <br />
-    md5sum: 7726483e377c523020a1c1c1f6a33e61
+    md5sum: 8c191ffd1d81d1a556d8c86d050dd4fb
   </p>
 </div>
 
@@ -210,7 +210,7 @@
   </a>
   <p>
     released on January 14th 2008 <br />
-    md5sum: bbd993b0571596edf819a38514fd6bcc
+    md5sum: c1e5c94879bccf01325b841a3e163055
   </p>
 </div>
 
@@ -222,7 +222,7 @@
   </a>
   <p>
     released on December 24th 2007 <br />
-    md5sum: 63489464a86b1070dde86555f42e0273
+    md5sum: 4fc566d8b68020618fe81d0e6ea0232b
   </p>
 </div>
 
@@ -234,7 +234,7 @@
   </a>
   <p>
     released on August  2nd 2007 <br />
-    md5sum: ef02d52a3478651d9bc2363ea9448fde
+    md5sum: 1545c51d52dbdc4b1c9c532071a3ca75
   </p>
 </div>
 
@@ -246,7 +246,7 @@
   </a>
   <p>
     released on July  2nd 2007 <br />
-    md5sum: 5c44b88a039d6e33c9d318d420344946
+    md5sum: 1f2dfda74aebd7dccfbdbc231c6fc9c4
   </p>
 </div>
 
@@ -258,7 +258,7 @@
   </a>
   <p>
     released on July  1st 2007 <br />
-    md5sum: 94b3c1fb088c1284e51e3e64f01bfec1
+    md5sum: 27de81a9f96249e8134692f8797846fd
   </p>
 </div>
 
@@ -270,7 +270,7 @@
   </a>
   <p>
     released on June 25th 2007 <br />
-    md5sum: 9f0c80ad1aa91346f9fce84cae243358
+    md5sum: 3e2fd7efe0c46fdb1737355f3a5c0d83
   </p>
 </div>
 
@@ -282,7 +282,7 @@
   </a>
   <p>
     released on June 12th 2007 <br />
-    md5sum: 869059640e9ea9396da6cf2ac334c8ad
+    md5sum: eb9d7961e6a604e1987fc77cabaa8688
   </p>
 </div>
 
diff --git a/projects.gnome.org/cheese/update.pl b/projects.gnome.org/cheese/update.pl
index 5c9dd32..6565a5b 100755
--- a/projects.gnome.org/cheese/update.pl
+++ b/projects.gnome.org/cheese/update.pl
@@ -1,10 +1,36 @@
 #!/usr/bin/perl -w
 
+# Copyright © 2009 Filippo Argiolas <fargiolas gnome org
+#
+# Licensed under the GNU General Public License Version 2
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Little script that updates download page in Cheese website
+# retrieving data from GNOME Ftp.
+# Just run it in the main website directory and commit the changes.
+# Use at your own risk!
+
 use Net::FTP;
 use Date::Format;
 
+# maximum stable packages to list
 my $max_stables = 7;
+# maximum unstable packages to list
 my $max_unstables = 5;
+# other useful vars, probably not enough if you want to use the script
+# elsewhere, feel free to readapt to your needs, fwiw
 my $gnomeurl = "ftp.gnome.org";
 my $directory = "pub/GNOME/sources/cheese/";
 
@@ -28,23 +54,26 @@ print "-- Retrieving packages informations from ftp.gnome.org\n";
 for (@maindir) {
     @dir = $gnomeftp->ls("$_");
     for (@dir) {
+        $current_file = $_;
         m/^(.*)\.(.*)\/(.*)\.tar\.gz/g or next;
         $filename = "$3.tar.gz";
         $packages{$filename}{"news"} = "$3\.changes";
         $packages{$filename}{"url"} =
-            "http://ftp.gnome.org/pub/GNOME/sources/cheese/$_";;
+            "http://ftp.gnome.org/pub/GNOME/sources/cheese/$current_file";;
         $packages{$filename}{"major"} = $1;
         $packages{$filename}{"minor"} = $2;
         print "++ $filename\n";
         $sumfile = $gnomeftp->get("$1.$2/$3.md5sum");
         open (SUM, "<$sumfile");
-        $sum = <SUM>;
-        $sum =~ s/^(\w+)\s.*$/$1/;
-        chomp ($sum);
+        my $sum = "";
+        while (<SUM>) {
+            m/^(\w+)\s+$filename/ and $sum = $1;
+        }
         close (SUM);
         unlink $sumfile;
+        if ($sum eq "") { print "** WARNING: no hash found for $filename\n"; }
         $packages{$filename}{"sum"} = $sum;
-        $mdtm = $gnomeftp->mdtm($_)
+        $mdtm = $gnomeftp->mdtm($current_file)
             or die "Cannot retrieve mtime ", $ftp->message;
         $packages{$filename}{"epoch"} = $mdtm;
         $packages{$filename}{"mdtm"} = time2str ("%B %o %Y", $mdtm);
@@ -55,6 +84,7 @@ for (@maindir) {
 }
 
 $gnomeftp->quit;
+print "QUIT\n";
 
 # sort by mtime
 my @sorted_keys =



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]