savannah-cvs
[Top][All Lists]
Advanced

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

[Savannah-cvs] administration/docs/hacking_savannah hacking_sa...


From: Sylvain Beucler
Subject: [Savannah-cvs] administration/docs/hacking_savannah hacking_sa...
Date: Thu, 30 Sep 2004 17:12:58 -0400

CVSROOT:        /cvsroot/administration
Module name:    administration
Branch:         
Changes by:     Sylvain Beucler <address@hidden>        04/09/30 21:06:13

Modified files:
        docs/hacking_savannah: hacking_savannah.texi 

Log message:
        Continued description of the creation of a 'light' test install with
        fewer projects and users

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/administration/administration/docs/hacking_savannah/hacking_savannah.texi.diff?tr1=1.52&tr2=1.53&r1=text&r2=text

Patches:
Index: administration/docs/hacking_savannah/hacking_savannah.texi
diff -u administration/docs/hacking_savannah/hacking_savannah.texi:1.52 
administration/docs/hacking_savannah/hacking_savannah.texi:1.53
--- administration/docs/hacking_savannah/hacking_savannah.texi:1.52     Thu Sep 
30 17:19:04 2004
+++ administration/docs/hacking_savannah/hacking_savannah.texi  Thu Sep 30 
21:06:13 2004
@@ -1,5 +1,5 @@
 \input texinfo   @c -*-texinfo-*-
address@hidden $Id: hacking_savannah.texi,v 1.52 2004/09/30 17:19:04 Beuc Exp $
address@hidden $Id: hacking_savannah.texi,v 1.53 2004/09/30 21:06:13 Beuc Exp $
 @comment %**start of header
 @setfilename hacking_savannah.info
 @include version.texi
@@ -845,29 +845,38 @@
 First, find the highest project you want to keep:
 @example
 SELECT A.group_id FROM groups A, groups B WHERE A.group_id >
-B.group_id GROUP BY A.group_id HAVING count(*) < 100;
+B.group_id GROUP BY A.group_id HAVING count(*) < @var{X};
 @end example
 
-Replace 100 by the number of projects you want to keep. That takes a
-while. You wish you were using PostreSQL and be able to use subqueries
-;)
+Replace @var{X} by the number of projects you want to keep. That takes a
+while. You wish you were using MySQL >= 4.1 or PostreSQL and be able
+to use subqueries ;)
 
 Then remove all project whose ID is greater than the number you found,
 taking not removing not removing 'administration' (#5802) or 'www' (#84).
 @example
-mysql> DELETE FROM groups WHERE group_id > X AND unix_group_name
+mysql> DELETE FROM groups WHERE group_id > @var{X} AND unix_group_name
        != 'administration' AND unix_group_name != 'www';
-mysql> DELETE FROM user_group WHERE group_id > X AND group_id !=
+mysql> DELETE FROM user_group WHERE group_id > @var{X} AND group_id !=
        5802 AND group_id != 84;
 @end example
 
-Then it would be good remove user without projects.
+Then it would be good remove user without projects. With a subquery:
 @example
-[TODO]
 mysql> DELETE FROM user WHERE NOT EXISTS (SELECT NULL FROM user_group WHERE 
user_groups.user_id = user.user_id);
 @end example
-Unfortunately it is not very easy without subqueries. I have to figure
-that out. I guess we'll have to use an external script.
+
+Or more barbaric:
address@hidden
+$ mysql savannah
+mysql> select distinct user_id into outfile '/tmp/minimum.txt' from user_group 
ORDER BY user_id;
+mysql> select user_id into outfile '/tmp/full.txt' from user ORDER BY user_id;
+$ cd /tmp
+$ diff minimum.txt full.txt | grep ^\> | cut -b 2- | while read line; do echo 
DELETE FROM user where user_id=$line\;; done | mysql savannah
address@hidden example
+
+It would be better to let some people with no assigned projects, so as
+to get all kinds of users in your database.
 
 
 @node Remaining, Non stable components, Populating your test install, Savannah 
configuration
@@ -1487,10 +1496,9 @@
 
 @itemize
 @item
-Launch a curl to update www.gnu.org/spftware/@var{project}
address@hidden
-Tell sysadmin to redirect www.nongnu.org/@var{project} to
-www.gnu.org/spftware/@var{project}
+Launch a curl to update www.gnu.org/spftware/@var{project}. It will
+also automatically create a redirection from
+www.nongnu.org/@var{project} to www.gnu.org/spftware/@var{project}
 @end itemize
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]