]> git.pld-linux.org Git - projects/distfiles.git/commitdiff
- changes for repositories kept in git
authorKacper Kornet <draenog@pld-linux.org>
Fri, 16 Dec 2011 15:51:32 +0000 (15:51 +0000)
committercvs2git <feedback@pld-linux.org>
Thu, 29 Nov 2012 22:58:17 +0000 (22:58 +0000)
Changed files:
    request-handler.pl -> 1.28.2.1
    run-rh.sh -> 1.7.2.1
    show_spec.sh -> 1.1.2.1

request-handler.pl
run-rh.sh
show_spec.sh [new file with mode: 0644]

index 0d23b8a28435e156bbd088f99669a213696cba6c..0798ec1e8765c399b98599a1a95540387e1e441c 100644 (file)
@@ -53,8 +53,8 @@ $id = rand if (!defined $id or $id eq "");
 
 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 @@ $oldcwd = Cwd::getcwd();
 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 "$spec\n";
 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 4777dfa1654f7b8b902dbc700b903c92a120f9ab..d8069beb766bc1d49c564c35819797b9d41befac 100644 (file)
--- a/run-rh.sh
+++ b/run-rh.sh
@@ -1,7 +1,6 @@
 #!/bin/sh
 # $Id$
 
-export CVSROOT=":pserver:cvs@cvs.pld-linux.org:/cvsroot"
 cd ~/distfiles || exit 1
 nice -n 20 perl ./request-handler.pl
 
diff --git a/show_spec.sh b/show_spec.sh
new file mode 100644 (file)
index 0000000..28d900a
--- /dev/null
@@ -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
+
This page took 0.112739 seconds and 4 git commands to generate.