[Evolvis-commits] r240: * Added sf-add-skill and sf-register-theme scripts. ↵

mirabilos at evolvis.org mirabilos at evolvis.org
Thu Feb 25 14:11:56 CET 2010


Author: mirabilos
Date: 2010-02-25 13:11:55 +0000 (Thu, 25 Feb 2010)
New Revision: 240

Added:
   trunk/gforge_base/evolvisforge/gforge/deb-specific/sf-add-skill
   trunk/gforge_base/evolvisforge/gforge/deb-specific/sf-register-theme
Modified:
   trunk/gforge_base/evolvisforge/
   trunk/gforge_base/evolvisforge/gforge/debian/README.Debian
   trunk/gforge_base/evolvisforge/gforge/debian/changelog
   trunk/gforge_base/evolvisforge/gforge/debian/rules
   trunk/gforge_base/evolvisforge/gforge/debian/sourceforge.dirs
Log:
  * Added sf-add-skill and sf-register-theme scripts.



Property changes on: trunk/gforge_base/evolvisforge
___________________________________________________________________
Name: bzr:revision-info
   - timestamp: 2001-08-14 06:33:37.000000000 +0000
committer: cbayle

   + timestamp: 2001-08-14 07:22:33.000000000 +0000
committer: lo-lan-do

Name: bzr:file-ids
   - gforge/cronjobs/stats	10 at 9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk%2Fgforge%2Fcronjobs%2Fstats
gforge/cronjobs/stats/cvsserver	10 at 9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk%2Fgforge%2Fcronjobs%2Fstats%2Fcvsserver
gforge/cronjobs/stats/cvsserver/cvs_history_parse.pl	10 at 9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk%2Fgforge%2Fcronjobs%2Fstats%2Fcvsserver%2Fcvs_history_parse.pl
gforge/cronjobs/stats/cvsserver/db_stats_cvs_history.pl	10 at 9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk%2Fgforge%2Fcronjobs%2Fstats%2Fcvsserver%2Fdb_stats_cvs_history.pl

   + gforge/deb-specific/sf-add-skill	11 at 9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk%2Fgforge%2Fdeb-specific%2Fsf-add-skill
gforge/deb-specific/sf-register-theme	11 at 9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk%2Fgforge%2Fdeb-specific%2Fsf-register-theme
gforge/debian/README.Debian	7 at 9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk%2Fgforge%2Fdebian%2FREADME.Debian
gforge/debian/changelog	7 at 9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk%2Fgforge%2Fdebian%2Fchangelog
gforge/debian/rules	7 at 9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk%2Fgforge%2Fdebian%2Frules
gforge/debian/sourceforge.dirs	7 at 9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk%2Fgforge%2Fdebian%2Fsourceforge.dirs

Name: bzr:revision-id:v4
   - 1 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:1
2 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:2
3 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:7
4 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:9
5 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:10

   + 1 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:1
2 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:2
3 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:7
4 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:9
5 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:10
6 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:11

Name: bzr:text-parents
   - 
   + gforge/debian/README.Debian	svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:7
gforge/debian/changelog	svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:9
gforge/debian/rules	svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:7
gforge/debian/sourceforge.dirs	svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:7


Added: trunk/gforge_base/evolvisforge/gforge/deb-specific/sf-add-skill
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/deb-specific/sf-add-skill	                        (rev 0)
+++ trunk/gforge_base/evolvisforge/gforge/deb-specific/sf-add-skill	2010-02-25 13:11:55 UTC (rev 240)
@@ -0,0 +1,71 @@
+#!/usr/bin/perl -w
+#
+# Debian-specific script to insert a new skill into the SF database
+
+use DBI ;
+use strict ;
+use diagnostics ;
+
+use vars qw/$dbh @reqlist $skill/ ;
+
+use vars qw/@skills/ ;
+
+sub debug ( $ ) ;
+
+require ("/usr/lib/sourceforge/lib/include.pl") ; # Include all the predefined functions 
+
+&db_connect ;
+
+if ($#ARGV < 0) {
+    debug "Usage: sf-add-skill <skill>..." ;
+    exit 1 ;
+}
+
+ at skills = @ARGV ;
+
+$dbh->{AutoCommit} = 0;
+$dbh->{RaiseError} = 1;
+eval {
+    my ($query, $sth, @array, $version, $action, $skill) ;
+
+    foreach $skill (@skills) {
+	debug "Inserting skill <$skill>." ;
+	$skill = $dbh->quote ($skill) ;
+	
+	$query = "INSERT INTO people_skill (name) VALUES ($skill)" ;
+	
+	# debug $query ;
+	
+	$sth = $dbh->prepare ($query) ;
+	$sth->execute () ;
+	$sth->finish () ;
+    }
+    
+    # debug "Committing." ;
+    $dbh->commit () ;
+
+    # There should be a commit at the end of every block above.
+    # If there is not, then it might be symptomatic of a problem.
+    # For safety, we roll back.
+    $dbh->rollback ();
+};
+
+if ($@) {
+    warn "Transaction aborted because $@" ;
+    debug "Transaction aborted because $@" ;
+    $dbh->rollback ;
+    debug "Please report this bug on the Debian bug-tracking system." ;
+    debug "Please include the previous messages as well to help debugging." ;
+    debug "You should not worry too much about this," ;
+    debug "your DB is still in a consistent state and should be usable." ;
+    exit 1 ;
+}
+
+$dbh->rollback ;
+$dbh->disconnect ;
+
+sub debug ( $ ) {
+    my $v = shift ;
+    chomp $v ;
+    print STDERR "$v\n" ;
+}


Property changes on: trunk/gforge_base/evolvisforge/gforge/deb-specific/sf-add-skill
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/gforge_base/evolvisforge/gforge/deb-specific/sf-register-theme
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/deb-specific/sf-register-theme	                        (rev 0)
+++ trunk/gforge_base/evolvisforge/gforge/deb-specific/sf-register-theme	2010-02-25 13:11:55 UTC (rev 240)
@@ -0,0 +1,84 @@
+#!/usr/bin/perl -w
+#
+# Debian-specific script to register a new theme into the SF database
+
+use DBI ;
+use strict ;
+use diagnostics ;
+
+use vars qw/$dbh @reqlist $thdir $thname/ ;
+
+use vars qw/@skills/ ;
+
+sub debug ( $ ) ;
+
+require ("/usr/lib/sourceforge/lib/include.pl") ; # Include all the predefined functions 
+
+&db_connect ;
+
+if ($#ARGV < 1) {
+    debug "Usage: sf-register-theme <dirname> <theme name>" ;
+    debug "The theme must be in /usr/lib/sourceforge/www/themes/<dirname>/" ;
+    exit 1 ;
+}
+
+$thdir = $ARGV [0] ;
+$thname = $ARGV [1] ;
+
+unless (-d "/usr/lib/sourceforge/www/themes/$thdir") {
+    debug "The directory /usr/lib/sourceforge/www/themes/$thdir does not exist" ;
+    exit 1 ;
+}
+unless (-e "/usr/lib/sourceforge/www/themes/$thdir/theme.php") {
+    debug "The file /usr/lib/sourceforge/www/themes/$thdir/theme.php does not exist" ;
+    exit 1 ;
+}
+unless (-e "/usr/lib/sourceforge/www/themes/$thdir/Theme.class") {
+    debug "The file /usr/lib/sourceforge/www/themes/$thdir/Theme.class does not exist" ;
+    exit 1 ;
+}
+
+$dbh->{AutoCommit} = 0;
+$dbh->{RaiseError} = 1;
+eval {
+    my ($query, $sth, @array, $version, $action) ;
+
+    $thdir = $dbh->quote ($thdir) ;
+    $thname = $dbh->quote ($thname) ;
+    
+    $query = "INSERT INTO themes (dirname, fullname) VALUES ($thdir, $thname)" ;
+    
+    # debug $query ;
+    
+    $sth = $dbh->prepare ($query) ;
+    $sth->execute () ;
+    $sth->finish () ;
+    
+    # debug "Committing." ;
+    $dbh->commit () ;
+
+    # There should be a commit at the end of every block above.
+    # If there is not, then it might be symptomatic of a problem.
+    # For safety, we roll back.
+    $dbh->rollback ();
+};
+
+if ($@) {
+    warn "Transaction aborted because $@" ;
+    debug "Transaction aborted because $@" ;
+    $dbh->rollback ;
+    debug "Please report this bug on the Debian bug-tracking system." ;
+    debug "Please include the previous messages as well to help debugging." ;
+    debug "You should not worry too much about this," ;
+    debug "your DB is still in a consistent state and should be usable." ;
+    exit 1 ;
+}
+
+$dbh->rollback ;
+$dbh->disconnect ;
+
+sub debug ( $ ) {
+    my $v = shift ;
+    chomp $v ;
+    print STDERR "$v\n" ;
+}


Property changes on: trunk/gforge_base/evolvisforge/gforge/deb-specific/sf-register-theme
___________________________________________________________________
Name: svn:executable
   + *

Modified: trunk/gforge_base/evolvisforge/gforge/debian/README.Debian
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/debian/README.Debian	2010-02-25 13:11:51 UTC (rev 239)
+++ trunk/gforge_base/evolvisforge/gforge/debian/README.Debian	2010-02-25 13:11:55 UTC (rev 240)
@@ -3,7 +3,6 @@
 
 Status
 ------
-
 Want to know what the status of this package is?  Read
 /usr/share/doc/sourceforge/TODO.Debian or (even better)
 <http://savannah.gnu.org/support/?group_id=259>.  If you miss a
@@ -67,6 +66,29 @@
 needed.  Do not alter them either unless you *know* what you're doing.
 
 
+Adminning notes
+---------------
+  Once Sourceforge is setup, it pretty much runs by itself.  There
+should be relatively few things to do for the administrator.  The
+following are random notes trying to document them.
+
+  If you need to add skills to the database after installation, you
+can use the sf-add-skill script.  Give it a skill (or a list of
+skills) and it'll insert it into the databse.  This script is located
+in /usr/lib/sourceforge/bin/.
+
+  If you would like to add a theme to your Sourceforge, you'll first
+have to compose it.  Take example on the ones present in
+/usr/lib/sourceforge/www/themes/ and adapt them to your needs.  When
+it's done, you'll have to register it into the database.  Use the
+sf-register-theme script for that purpose.  This script is located in
+/usr/lib/sourceforge/bin/ too.
+
+  You'll need to periodically check the Approve Pending Projects page
+as well as the Approve News Bytes one, and take appropriate action.
+That can be done by the `admin' user via the web interface.
+
+
 Packaging roadmap
 -----------------
   This section sketches a roadmap of the steps that needed to be taken
@@ -194,12 +216,12 @@
 
 Thanks
 ------
-  Apart from the Sourceforge crew at VA Linux, who did (and still do)
-a great job with SF, I'd like to send my thanks to Guillaume Morin,
-who wrote a very thorough Sourceforge installation guide.  That guide
-gives step-by-step instructions for the installation procedure, and a
-big part of the packaging task was to turn these instructions into
-automated scripts.
+  Apart from the Sourceforge crew at VA Linux, who did (and probably
+still do) a great job with SF, I'd like to send my thanks to Guillaume
+Morin, who wrote a very thorough Sourceforge installation guide.  That
+guide gives step-by-step instructions for the installation procedure,
+and a big part of the packaging task was to turn these instructions
+into automated scripts.
 
   Thanks also to all who tested packages and helped correct many
 errors of mine.
@@ -208,6 +230,8 @@
 adapted and fixed all the scripts related to CVS, DNS, SSH accounts,
 and probably more.
 
+  -- Roland Mas <lolando at debian.org>, 2001
+
 # Local Variables:
 # mode: text
 # End:

Modified: trunk/gforge_base/evolvisforge/gforge/debian/changelog
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/debian/changelog	2010-02-25 13:11:51 UTC (rev 239)
+++ trunk/gforge_base/evolvisforge/gforge/debian/changelog	2010-02-25 13:11:55 UTC (rev 240)
@@ -1,9 +1,10 @@
-sourceforge (2.5-10+1) unstable; urgency=low
+sourceforge (2.5-10+2) unstable; urgency=low
 
   * Fixed /etc/alias entry for sourceforge user.  Really, this time.
   * Fixed Trove software map (closes: #108297).
+  * Added sf-add-skill and sf-register-theme scripts.
 
- -- Roland Mas <lolando at debian.org>  Mon, 13 Aug 2001 18:48:30 +0200
+ -- Roland Mas <lolando at debian.org>  Mon, 13 Aug 2001 23:13:47 +0200
 
 sourceforge (2.5-10) unstable; urgency=low
 

Modified: trunk/gforge_base/evolvisforge/gforge/debian/rules
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/debian/rules	2010-02-25 13:11:51 UTC (rev 239)
+++ trunk/gforge_base/evolvisforge/gforge/debian/rules	2010-02-25 13:11:55 UTC (rev 240)
@@ -86,6 +86,10 @@
 	install -m 755 deb-specific/install-chroot.sh $(CURDIR)/debian/sourceforge/usr/lib/sourceforge/bin/
 	install -m 755 deb-specific/db-upgrade.pl $(CURDIR)/debian/sourceforge/usr/lib/sourceforge/bin/
 	install -m 755 deb-specific/fill-in-the-blanks.pl $(CURDIR)/debian/sourceforge/usr/lib/sourceforge/bin/
+	# install -m 755 deb-specific/sf-add-skill $(CURDIR)/debian/sourceforge/usr/bin/
+	# install -m 755 deb-specific/sf-register-theme $(CURDIR)/debian/sourceforge/usr/bin/
+	install -m 755 deb-specific/sf-add-skill $(CURDIR)/debian/sourceforge/usr/lib/sourceforge/bin/
+	install -m 755 deb-specific/sf-register-theme $(CURDIR)/debian/sourceforge/usr/lib/sourceforge/bin/
 	install -m 644 utils/include.pl $(CURDIR)/debian/sourceforge/usr/lib/sourceforge/lib/
 
 	# DNS stuff

Modified: trunk/gforge_base/evolvisforge/gforge/debian/sourceforge.dirs
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/debian/sourceforge.dirs	2010-02-25 13:11:51 UTC (rev 239)
+++ trunk/gforge_base/evolvisforge/gforge/debian/sourceforge.dirs	2010-02-25 13:11:55 UTC (rev 240)
@@ -1,5 +1,6 @@
 bin
 etc/sourceforge
+usr/bin
 usr/lib/sourceforge/bin
 usr/lib/sourceforge/db
 usr/lib/sourceforge/lib




More information about the evolvis-commits mailing list