[kde-services-devel] r502 - in trunk/hotstuff: . src

josef at new.kstuff.org josef at new.kstuff.org
Sun Mar 22 20:49:27 CET 2009


Author: josef
Date: 2009-03-22 20:49:26 +0100 (Sun, 22 Mar 2009)
New Revision: 502

Modified:
   trunk/hotstuff/TODO
   trunk/hotstuff/src/hotstuff-access
   trunk/hotstuff/src/hotstuff-downloads
   trunk/hotstuff/src/hotstuff-http
   trunk/hotstuff/src/hotstuff-provider
   trunk/hotstuff/src/hotstuff-scan
   trunk/hotstuff/src/hotstuff-search
   trunk/hotstuff/src/hotstuff-siteadmin
   trunk/hotstuff/src/hotstuff-stuff
   trunk/hotstuff/src/hotstuff-versioning
Log:
- replace perl -C invocation with weird :encoding(utf-8) binmode statement, required by perl 5.10
- extend database port configurability to hotstuff-versioning script
- propagate --dry-run option from hotstuff-versioning to hotstuff-scan
- do not skip 'preview' and 'summary' tags anymore since the new special handling for meta_ref covers this skip implicitly
- copyright updates to cover 2009
- kde-look fix: discard 'id' tag as it clashes with what we use internally in our database, and it's definitely not part of the GHNS spec
- upped priority for Kalzium subdirs issue, this really needs to be solved soon



Modified: trunk/hotstuff/TODO
===================================================================
--- trunk/hotstuff/TODO	2009-02-13 07:11:48 UTC (rev 501)
+++ trunk/hotstuff/TODO	2009-03-22 19:49:26 UTC (rev 502)
@@ -1,5 +1,7 @@
 * recursive scanning in hotstuff-scan (e.g. for 'kalzium' repository)
+  - is implemented, but issue with database remains
 * less strict schema to allow for reordered lines
+  - see schemas/SchemaLimitation; this will affect SVN pre-commit hook script
 * SVN-backed repos: option to only generate new entry when tag gets applied
   - should be fixed by just pointing the SVN root config option there?
 * multiple co-maintainers for each entry, or improved upload queue moderation
@@ -14,6 +16,7 @@
   - implement by adding changelog entries in hotstuff-versioning before calling hotstuff-scan
 
 * bug report by JohnFlux: SVN-backed subdirectories are stripped in the database
+  + confirmed by Karl-Ulrich Bamberg, see Kalzium: ?file=./heptan-2-one.cml&site=kalzium
 
 ------------------------------------------------------
 

Modified: trunk/hotstuff/src/hotstuff-access
===================================================================
--- trunk/hotstuff/src/hotstuff-access	2009-02-13 07:11:48 UTC (rev 501)
+++ trunk/hotstuff/src/hotstuff-access	2009-03-22 19:49:26 UTC (rev 502)
@@ -1,9 +1,11 @@
-#!/usr/bin/perl -C
+#!/usr/bin/perl
 #
 # Download proxy which increases download count for each file
-# Copyright (C) 2007 Josef Spillner <josef at kstuff.org>
+# Copyright (C) 2007 - 2009 Josef Spillner <josef at kstuff.org>
 # Published under 'GNU AGPLv3 or later' conditions
 
+binmode STDOUT, ":encoding(utf-8)";
+
 use CGI;
 use DBI;
 use strict;

Modified: trunk/hotstuff/src/hotstuff-downloads
===================================================================
--- trunk/hotstuff/src/hotstuff-downloads	2009-02-13 07:11:48 UTC (rev 501)
+++ trunk/hotstuff/src/hotstuff-downloads	2009-03-22 19:49:26 UTC (rev 502)
@@ -1,9 +1,11 @@
-#!/usr/bin/perl -C
+#!/usr/bin/perl
 #
 # Updating the download counter based on download numbers
-# Copyright (C) 2004 - 2007 Josef Spillner <josef at kstuff.org>
+# Copyright (C) 2004 - 2009 Josef Spillner <josef at kstuff.org>
 # Published under 'GNU AGPLv3 or later' conditions.
 
+binmode STDOUT, ":encoding(utf-8)";
+
 use strict;
 use Getopt::Long qw(:config no_auto_abbrev bundling no_ignore_case);
 use DBI;
@@ -28,7 +30,7 @@
 
 if($opt_help){
 	print "hotstuff-download - Update the download counter based on HTTP downloads\n";
-	print "Copyright (C) 2004, 2005 Josef Spillner <josef\@kstuff.org>\n";
+	print "Copyright (C) 2004 - 2009 Josef Spillner <josef\@kstuff.org>\n";
 	print "Published under 'GNU AGPLv3 or later' conditions\n";
 	print;
 	print "Options:\n";

Modified: trunk/hotstuff/src/hotstuff-http
===================================================================
--- trunk/hotstuff/src/hotstuff-http	2009-02-13 07:11:48 UTC (rev 501)
+++ trunk/hotstuff/src/hotstuff-http	2009-03-22 19:49:26 UTC (rev 502)
@@ -1,9 +1,11 @@
-#!/usr/bin/perl -C
+#!/usr/bin/perl
 #
 # Moving HTTP-uploaded files into the FTP upload queue
-# Copyright (C) 2005 - 2007 Josef Spillner <josef at kstuff.org>
+# Copyright (C) 2005 - 2009 Josef Spillner <josef at kstuff.org>
 # Published under 'GNU AGPLv3 or later' conditions.
 
+binmode STDOUT, ":encoding(utf-8)";
+
 use strict;
 use Getopt::Long qw(:config no_auto_abbrev bundling no_ignore_case);
 
@@ -26,7 +28,7 @@
 
 if($opt_help){
 	print "hotstuff-http - Moving HTTP uploads into main GHNS upload directory\n";
-	print "Copyright (C) 2005 Josef Spillner <josef\@kstuff.org>\n";
+	print "Copyright (C) 2005 - 2009 Josef Spillner <josef\@kstuff.org>\n";
 	print "Published under 'GNU AGPLv3 or later' conditions\n";
 	print;
 	print "Options:\n";

Modified: trunk/hotstuff/src/hotstuff-provider
===================================================================
--- trunk/hotstuff/src/hotstuff-provider	2009-02-13 07:11:48 UTC (rev 501)
+++ trunk/hotstuff/src/hotstuff-provider	2009-03-22 19:49:26 UTC (rev 502)
@@ -1,9 +1,11 @@
-#!/usr/bin/perl -C
+#!/usr/bin/perl
 #
 # Automatic generation of the providers.xml file
-# Copyright (C) 2007 Josef Spillner <josef at kstuff.org>
+# Copyright (C) 2007 - 2009 Josef Spillner <josef at kstuff.org>
 # Published under 'GNU AGPLv3 or later' conditions
 
+binmode STDOUT, ":encoding(utf-8)";
+
 use CGI;
 use XML::Writer;
 use DBI;

Modified: trunk/hotstuff/src/hotstuff-scan
===================================================================
--- trunk/hotstuff/src/hotstuff-scan	2009-02-13 07:11:48 UTC (rev 501)
+++ trunk/hotstuff/src/hotstuff-scan	2009-03-22 19:49:26 UTC (rev 502)
@@ -1,9 +1,11 @@
-#!/usr/bin/perl -C
+#!/usr/bin/perl
 #
 # Merging of GHNS (Get Hot New Stuff) XML upload files (*.meta) into a database
-# Copyright (C) 2003 - 2008 Josef Spillner <josef at kstuff.org>
+# Copyright (C) 2003 - 2009 Josef Spillner <josef at kstuff.org>
 # Published under 'GNU AGPLv3 or later' conditions.
 
+binmode STDOUT, ":encoding(utf-8)";
+
 use strict;
 use Getopt::Long qw(:config no_auto_abbrev bundling no_ignore_case);
 use XML::DOM;
@@ -36,7 +38,7 @@
 
 if($opt_help){
 	print "hotstuff-scan - Import of GHNS uploads into the Hotstuff database\n";
-	print "Copyright (C) 2003 - 2008 Josef Spillner <josef\@kstuff.org>\n";
+	print "Copyright (C) 2003 - 2009 Josef Spillner <josef\@kstuff.org>\n";
 	print "Published under 'GNU AGPLv3 or later' conditions\n";
 	print;
 	print "Options:\n";
@@ -121,6 +123,10 @@
 			$value = $tag->getFirstChild->getData;
 		}
 
+		if($name eq "id"){
+			next;
+		}
+
 		if(($name eq "payload") || ($name eq "preview")){
 			if($value){
 				my $oldvalue = "$dirname/$value";
@@ -312,11 +318,12 @@
 	}
 }
 
-my @changes;
+my $changes;
 my $revision;
 if(-f "$uploaddir/_changes"){
 	open(X, "$uploaddir/_changes");
-	@changes = <X>;
+	my @changesar = <X>;
+	$changes = join("\n", @changesar);
 	close(X);
 }
 if(-f "$uploaddir/_revision"){
@@ -469,9 +476,9 @@
 			$res = $conn->prepare($statec);
 			$res->execute();
 
-			if((@changes) && ($revision)){
+			if(($changes) && ($revision)){
 				my $nextid = $dbvals{"directory"};
-				my $nextcontents = $dbvals("contents");
+				my $nextcontents = $dbvals{"contents"};
 				#my $oldrevision = $tmp{"id"};
 				my $oldrevision = $revision - 1;
 
@@ -484,8 +491,8 @@
 				# FIXME: there's apparently a <changes> tag but neither
 				# the ghns.xsd schema nor hotstuff.sql support it!?
 				$statec = "INSERT INTO contents " .
-					"(index, type, content) VALUES "
-					"($nextcontents, 'changes', '@changes')";
+					"(index, type, content) VALUES " .
+					"($nextcontents, 'changes', '$changes')";
 				$res = $conn->prepare($statec);
 				$res->execute();
 			}
@@ -552,8 +559,8 @@
 		next if($key eq "type");
 		next if($key eq "more");
 
-		next if($key eq "preview");
-		next if($key eq "summary");
+		#next if($key eq "preview");
+		#next if($key eq "summary");
 
 		next if($key eq "release");
 

Modified: trunk/hotstuff/src/hotstuff-search
===================================================================
--- trunk/hotstuff/src/hotstuff-search	2009-02-13 07:11:48 UTC (rev 501)
+++ trunk/hotstuff/src/hotstuff-search	2009-03-22 19:49:26 UTC (rev 502)
@@ -1,9 +1,11 @@
-#!/usr/bin/perl -C
+#!/usr/bin/perl
 #
 # OpenSearch frontend for the Hotstuff database
-# Copyright (C) 2005 - 2007 Josef Spillner <josef at kstuff.org>
+# Copyright (C) 2005 - 2009 Josef Spillner <josef at kstuff.org>
 # Published under 'GNU AGPLv3 or later' conditions
 
+binmode STDOUT, ":encoding(utf-8)";
+
 use CGI;
 use XML::Writer;
 use DBI;

Modified: trunk/hotstuff/src/hotstuff-siteadmin
===================================================================
--- trunk/hotstuff/src/hotstuff-siteadmin	2009-02-13 07:11:48 UTC (rev 501)
+++ trunk/hotstuff/src/hotstuff-siteadmin	2009-03-22 19:49:26 UTC (rev 502)
@@ -1,7 +1,7 @@
 #!/bin/bash
 #
 # Site-wide maintenance of GHNS repositories
-# Copyright (C) 2006 - 2008 Josef Spillner <josef at kstuff.org>
+# Copyright (C) 2006 - 2009 Josef Spillner <josef at kstuff.org>
 # Published under 'GNU AGPLv3 or later' conditions.
 
 help()

Modified: trunk/hotstuff/src/hotstuff-stuff
===================================================================
--- trunk/hotstuff/src/hotstuff-stuff	2009-02-13 07:11:48 UTC (rev 501)
+++ trunk/hotstuff/src/hotstuff-stuff	2009-03-22 19:49:26 UTC (rev 502)
@@ -1,9 +1,11 @@
-#!/usr/bin/perl -C
+#!/usr/bin/perl
 #
 # Generation of GHNS feed from the Hotstuff database
-# Copyright (C) 2005 - 2007 Josef Spillner <josef at kstuff.org>
+# Copyright (C) 2005 - 2009 Josef Spillner <josef at kstuff.org>
 # Published under 'GNU AGPLv3 or later' conditions
 
+binmode STDOUT, ":encoding(utf-8)";
+
 use CGI;
 use XML::Writer;
 use DBI;

Modified: trunk/hotstuff/src/hotstuff-versioning
===================================================================
--- trunk/hotstuff/src/hotstuff-versioning	2009-02-13 07:11:48 UTC (rev 501)
+++ trunk/hotstuff/src/hotstuff-versioning	2009-03-22 19:49:26 UTC (rev 502)
@@ -1,9 +1,11 @@
-#!/usr/bin/perl -C
+#!/usr/bin/perl
 #
 # Versioning of Hotstuff entries
-# Copyright (C) 2005 - 2007 Josef Spillner <josef at kstuff.org>
+# Copyright (C) 2005 - 2009 Josef Spillner <josef at kstuff.org>
 # Published under 'GNU AGPLv3 or later' conditions.
 
+binmode STDOUT, ":encoding(utf-8)";
+
 use strict;
 use Getopt::Long qw(:config no_auto_abbrev bundling no_ignore_case);
 use DBI;
@@ -30,7 +32,7 @@
 
 if($opt_help){
 	print "hotstuff-versioning - Versioning of Hotstuff entries\n";
-	print "Copyright (C) 2005 - 2007 Josef Spillner <josef\@kstuff.org>\n";
+	print "Copyright (C) 2005 - 2009 Josef Spillner <josef\@kstuff.org>\n";
 	print "Published under 'GNU AGPLv3 or later' conditions\n";
 	print;
 	print "Options:\n";
@@ -46,13 +48,16 @@
 	exit;
 }
 
-use vars qw($dbhost $dbname $dbuser $dbpass);
+use vars qw($dbhost $dbname $dbuser $dbpass $dbport);
 use vars qw($downloaddir $uploaddir $repository);
 eval{require $opt_config};
 if($@){
 	print "Configuration file $opt_config not found or invalid.\n";
 	exit 1;
 }
+if(!$dbport){
+	$dbport = 5432;
+}
 
 if($opt_setup){
 	print "Setup repository at $opt_setup...\n";
@@ -79,11 +84,11 @@
 		system("svn log --xml -r$rev $downloaddir | xmlstarlet sel -t -v '/log/logentry/msg' > $downloaddir/_changes");
 		system("echo $rev > $downloaddir/_revision");
 	}
-	system("hotstuff-scan --nomove -c $opt_config");
+	system("hotstuff-scan --nomove -c $opt_config $opt_dry");
 	exit;
 }
 
-my $conn = DBI->connect("DBI:Pg:host=$dbhost;dbname=$dbname;user=$dbuser;password=$dbpass");
+my $conn = DBI->connect("DBI:Pg:host=$dbhost;port=$dbport;dbname=$dbname;user=$dbuser;password=$dbpass");
 $conn || die DBI::errstr;
 
 my $status = `svn status $downloaddir`;



More information about the kde-services-devel mailing list