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;
}
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);
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)")
}
--- /dev/null
+#!/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
+