admin (git): distfiles/request-handler.pl, distfiles/run-rh.sh, distfiles/s...

draenog draenog at pld-linux.org
Fri Dec 16 16:51:37 CET 2011


Author: draenog                      Date: Fri Dec 16 15:51:37 2011 GMT
Module: admin                         Tag: git
---- Log message:
- changes for repositories kept in git

---- Files affected:
admin/distfiles:
   request-handler.pl (1.28 -> 1.28.2.1) , run-rh.sh (1.7 -> 1.7.2.1) , show_spec.sh (NONE -> 1.1.2.1)  (NEW)

---- Diffs:

================================================================
Index: admin/distfiles/request-handler.pl
diff -u admin/distfiles/request-handler.pl:1.28 admin/distfiles/request-handler.pl:1.28.2.1
--- admin/distfiles/request-handler.pl:1.28	Mon Apr 11 22:41:24 2011
+++ admin/distfiles/request-handler.pl	Fri Dec 16 16:51:32 2011
@@ -53,8 +53,8 @@
 
 while (<STDIN>) {
   chomp;
-  /^X-Spec: ([a-z0-9_.+-]+\.spec)/i and $spec = $1;
-  /^X-Branch: ([a-z0-9_-]+)/i and $branch = $1;
+  /^X-Package: ([a-z0-9_.+-]+)/i and $spec = $1;
+  /^X-Branch: ([\/a-z0-9_-]+)/i and $branch = $1;
   /^X-Login: ([a-z0-9_.]+)/i and $from = $1;
   /^X-Flags: ([a-z0-9_ -]+)/i and $flags = $1;
 }
@@ -68,17 +68,13 @@
 mkdir("tmp/$id") or die("cannot create: tmp/$id");
 chdir("tmp/$id");
 
-$branch = "" if ($branch eq "HEAD");
-$branch = "-r \"$branch\"" if ($branch ne "");
-
-$specdir = File::Basename::basename($spec,('.spec'));
-my $cvs_get = `cvs -d :pserver:cvs\@cvs.pld-linux.org:/cvsroot get $branch "packages/$specdir/$spec" 2>&1`;
+my $cvs_get = `~/show_spec.sh $spec $branch 2>&1`;
 if ( $? ) {
   chdir($oldcwd);
   my $at_branch = "";
   $at_branch = " from branch $branch" if $branch;
   my $code = $? >> 8;
-  report_fatal("cannot cvs get $spec$at_branch;\n$cvs_get\nexited with code $code");
+  report_fatal("cannot git fetch $spec$at_branch;\n$cvs_get\nexited with code $code");
 }
 
 chdir($oldcwd);
@@ -89,7 +85,7 @@
 print S "$flags\n";
 close(S);
 
-if (system("perl ./specparser.pl \"tmp/$id/packages/$specdir/$spec\" >> tmp/$id/to-spool") != 0) {
+if (system("perl ./specparser.pl \"tmp/$id/$spec\" >> tmp/$id/to-spool") != 0) {
   report_fatal("cannot parse $spec ($branch)")
 }
 

================================================================
Index: admin/distfiles/run-rh.sh
diff -u admin/distfiles/run-rh.sh:1.7 admin/distfiles/run-rh.sh:1.7.2.1
--- admin/distfiles/run-rh.sh:1.7	Wed Dec  8 20:55:08 2010
+++ admin/distfiles/run-rh.sh	Fri Dec 16 16:51:32 2011
@@ -1,7 +1,6 @@
 #!/bin/sh
 # $Id$
 
-export CVSROOT=":pserver:cvs at cvs.pld-linux.org:/cvsroot"
 cd ~/distfiles || exit 1
 nice -n 20 perl ./request-handler.pl
 

================================================================
Index: admin/distfiles/show_spec.sh
diff -u /dev/null admin/distfiles/show_spec.sh:1.1.2.1
--- /dev/null	Fri Dec 16 16:51:37 2011
+++ admin/distfiles/show_spec.sh	Fri Dec 16 16:51:32 2011
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+GIT_SERVER=carme.pld-linux.org
+
+package=$1
+ref=$2
+
+exticode=0
+
+export GIT_DIR=`mktemp -d gitemp.XXXXXX --tmpdir`
+(
+    set -e
+    git init --bare >/dev/null
+    git fetch --depth=1 git://${GIT_SERVER}/packages/$package $ref:
+    git ls-tree --name-only FETCH_HEAD | grep '.spec$' | while read file; do
+        git show FETCH_HEAD:$file > $package || exitcode=1
+    done
+)
+exitcode=$?
+rm -rf $GIT_DIR
+exit $exitcode
+
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/admin/distfiles/request-handler.pl?r1=1.28&r2=1.28.2.1&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/admin/distfiles/run-rh.sh?r1=1.7&r2=1.7.2.1&f=u



More information about the pld-cvs-commit mailing list