/[smeserver]/rpms/php-pear-Log/sme8/xml2changelog
ViewVC logotype

Annotation of /rpms/php-pear-Log/sme8/xml2changelog

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (hide annotations) (download)
Mon Sep 26 00:10:27 2011 UTC (13 years, 2 months ago) by slords
Branch: MAIN
CVS Tags: php-pear-Log-1_12_7-1_el5_sme, HEAD
Changes since 1.2: +23 -14 lines
Import newer package

1 slords 1.1 <?php
2     $prog=array_shift($_SERVER['argv']);
3     if ($_SERVER['argc']<2) die ("usage : " . $prog . " path_to_package.xml [ --debug ]\n");
4     $file=array_shift($_SERVER['argv']);
5    
6     ($xml=simplexml_load_file($file)) || die ($file . " not found !\n");
7     if (in_array("--debug", $_SERVER['argv'])) print_r($xml);
8    
9     if ($xml['version'] >= "2"){ // Package.xml V 2.0
10 slords 1.3 $new = "";
11     if (strlen(trim($xml->notes))>1) { // Ignore too short descr.
12     printf("++*** Version %s (%s) - API %s (%s) - %s\n\n%s\n\n",
13     $xml->version->release, $xml->stability->release,
14     $xml->version->api, $xml->stability->api,
15     $xml->date, $xml->notes);
16     $new=$xml->version->release;
17     }
18 slords 1.1
19 slords 1.3 if (isset($xml->changelog->release) && count($xml->changelog->release)) {
20     $tab = array();
21     foreach($xml->changelog->release as $rel) {
22     $old=$rel->version->release;
23     if ("$old" != "$new") {
24     $tab[''.$rel->date] = $rel;
25     }
26 slords 1.2 }
27 slords 1.3 krsort($tab);
28     foreach($tab as $rel) {
29     printf("*** Version %s (%s) - API %s (%s) - %s\n\n%s\n\n",
30     $rel->version->release, $rel->stability->release,
31     $rel->version->api, $rel->stability->api,
32     $rel->date, $rel->notes);
33     }
34     }
35 slords 1.1 } else { // Package.xml V 1.0
36     printf("* Version %s (%s) - %s\n\n%s\n\n",
37     $xml->release->version, $xml->release->state, $xml->release->date, $xml->release->notes);
38    
39     foreach($xml->changelog->release as $rel)
40     printf("* Version %s (%s) - %s\n\n%s\n\n",
41     $rel->version, $rel->state, $rel->date, $rel->notes);
42     }
43     ?>

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed