From 82d17a2d0baed6137fa54250a10712751716f2d8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 30 Nov 2011 17:32:50 +0100 Subject: [PATCH] Rename hydra_*.pl to hydra-* The underscores are ugly and the .pl extension is an implementation detail that shouldn't be visible to the outside. Also, get rid of the *.in files. It's not really necessary to generate them. And I was always modifying the wrong file. --- configure.ac | 10 ------- src/script/Makefile.am | 28 +++++++++---------- src/script/{hydra_build.pl.in => hydra-build} | 4 +-- .../{hydra_control.sh => hydra-control} | 0 .../{hydra_create.pl.in => hydra-create} | 0 ...{hydra_evaluator.pl.in => hydra-evaluator} | 2 +- ..._queue_runner.pl.in => hydra-queue-runner} | 4 +-- .../{hydra_server.pl.in => hydra-server} | 2 +- ...e_gc_roots.pl.in => hydra-update-gc-roots} | 2 +- tests/Makefile.am | 7 +++-- ...uation-tests.pl.in => evaluation-tests.pl} | 2 -- ...y-all-tables.pl.in => query-all-tables.pl} | 2 -- 12 files changed, 26 insertions(+), 37 deletions(-) rename src/script/{hydra_build.pl.in => hydra-build} (99%) rename src/script/{hydra_control.sh => hydra-control} (100%) rename src/script/{hydra_create.pl.in => hydra-create} (100%) rename src/script/{hydra_evaluator.pl.in => hydra-evaluator} (99%) rename src/script/{hydra_queue_runner.pl.in => hydra-queue-runner} (98%) rename src/script/{hydra_server.pl.in => hydra-server} (97%) rename src/script/{hydra_update_gc_roots.pl.in => hydra-update-gc-roots} (99%) rename tests/{evaluation-tests.pl.in => evaluation-tests.pl} (98%) rename tests/{query-all-tables.pl.in => query-all-tables.pl} (93%) diff --git a/configure.ac b/configure.ac index ed85e3bb..00609af2 100644 --- a/configure.ac +++ b/configure.ac @@ -94,14 +94,4 @@ AC_CONFIG_FILES([ tests/jobs/config.nix ]) -AC_CONFIG_FILES([src/script/hydra_build.pl], [chmod +x src/script/hydra_build.pl]) -AC_CONFIG_FILES([src/script/hydra_create.pl], [chmod +x src/script/hydra_create.pl]) -AC_CONFIG_FILES([src/script/hydra_evaluator.pl], [chmod +x src/script/hydra_evaluator.pl]) -AC_CONFIG_FILES([src/script/hydra_queue_runner.pl], [chmod +x src/script/hydra_queue_runner.pl]) -AC_CONFIG_FILES([src/script/hydra_server.pl], [chmod +x src/script/hydra_server.pl]) -AC_CONFIG_FILES([src/script/hydra_update_gc_roots.pl], [chmod +x src/script/hydra_update_gc_roots.pl]) -AC_CONFIG_FILES([tests/query-all-tables.pl], [chmod +x tests/query-all-tables.pl]) -AC_CONFIG_FILES([tests/evaluation-tests.pl], [chmod +x tests/evaluation-tests.pl]) - AC_OUTPUT - diff --git a/src/script/Makefile.am b/src/script/Makefile.am index d334d457..14f01d93 100644 --- a/src/script/Makefile.am +++ b/src/script/Makefile.am @@ -1,19 +1,19 @@ EXTRA_DIST = \ - hydra_control.sh \ - nix-prefetch-svn \ - nix-prefetch-git \ - nix-prefetch-bzr \ - nix-prefetch-hg - -bin_SCRIPTS = \ - hydra_build.pl \ - hydra_evaluator.pl \ - hydra_queue_runner.pl \ - hydra_server.pl \ - hydra_update_gc_roots.pl \ - hydra_create.pl \ + hydra-control \ nix-prefetch-svn \ nix-prefetch-git \ nix-prefetch-bzr \ nix-prefetch-hg \ - hydra_control.sh + $(bin_SCRIPTS) + +bin_SCRIPTS = \ + hydra-build \ + hydra-evaluator \ + hydra-queue-runner \ + hydra-server \ + hydra-update-gc-roots \ + hydra-create \ + nix-prefetch-svn \ + nix-prefetch-git \ + nix-prefetch-bzr \ + nix-prefetch-hg diff --git a/src/script/hydra_build.pl.in b/src/script/hydra-build similarity index 99% rename from src/script/hydra_build.pl.in rename to src/script/hydra-build index fe21e9cb..d0d98684 100755 --- a/src/script/hydra_build.pl.in +++ b/src/script/hydra-build @@ -1,4 +1,4 @@ -#! @perl@ -w -I@nix@/libexec/nix +#! /var/run/current-system/sw/bin/perl -w use strict; use File::Basename; @@ -430,7 +430,7 @@ sub doBuild { } -my $buildId = $ARGV[0] or die; +my $buildId = $ARGV[0] or die "syntax: $0 BUILD-ID\n"; print STDERR "performing build $buildId\n"; if ($ENV{'HYDRA_MAIL_TEST'}) { diff --git a/src/script/hydra_control.sh b/src/script/hydra-control similarity index 100% rename from src/script/hydra_control.sh rename to src/script/hydra-control diff --git a/src/script/hydra_create.pl.in b/src/script/hydra-create similarity index 100% rename from src/script/hydra_create.pl.in rename to src/script/hydra-create diff --git a/src/script/hydra_evaluator.pl.in b/src/script/hydra-evaluator similarity index 99% rename from src/script/hydra_evaluator.pl.in rename to src/script/hydra-evaluator index a04677d9..9e7371c7 100755 --- a/src/script/hydra_evaluator.pl.in +++ b/src/script/hydra-evaluator @@ -1,4 +1,4 @@ -#! @perl@ -w -I@nix@/libexec/nix +#! /var/run/current-system/sw/bin/perl -w use strict; use feature 'switch'; diff --git a/src/script/hydra_queue_runner.pl.in b/src/script/hydra-queue-runner similarity index 98% rename from src/script/hydra_queue_runner.pl.in rename to src/script/hydra-queue-runner index a4a6c45d..4410f6ea 100755 --- a/src/script/hydra_queue_runner.pl.in +++ b/src/script/hydra-queue-runner @@ -1,4 +1,4 @@ -#! @perl@ -w -I@nix@/libexec/nix +#! /var/run/current-system/sw/bin/perl -w use strict; use Cwd; @@ -138,7 +138,7 @@ sub checkBuilds { open LOG, ">$logfile" or die "cannot create logfile $logfile"; POSIX::dup2(fileno(LOG), 1) or die; POSIX::dup2(fileno(LOG), 2) or die; - exec("hydra_build.pl", $id); + exec("hydra-build", $id); }; warn "cannot start build $id: $@"; POSIX::_exit(1); diff --git a/src/script/hydra_server.pl.in b/src/script/hydra-server similarity index 97% rename from src/script/hydra_server.pl.in rename to src/script/hydra-server index 971c6b77..e56e5621 100755 --- a/src/script/hydra_server.pl.in +++ b/src/script/hydra-server @@ -1,4 +1,4 @@ -#! @perl@ -w -I@nix@/libexec/nix +#! /var/run/current-system/sw/bin/perl -w BEGIN { $ENV{CATALYST_SCRIPT_GEN} = 40; diff --git a/src/script/hydra_update_gc_roots.pl.in b/src/script/hydra-update-gc-roots similarity index 99% rename from src/script/hydra_update_gc_roots.pl.in rename to src/script/hydra-update-gc-roots index 25572ac7..59061a56 100755 --- a/src/script/hydra_update_gc_roots.pl.in +++ b/src/script/hydra-update-gc-roots @@ -1,4 +1,4 @@ -#! @perl@ -w -I@nix@/libexec/nix +#! /var/run/current-system/sw/bin/perl -w use strict; use File::Path; diff --git a/tests/Makefile.am b/tests/Makefile.am index f0f54312..2f720af2 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -16,7 +16,10 @@ TESTS_ENVIRONMENT = \ EXTRA_DIST = \ $(wildcard *.pm) \ $(wildcard jobs/*.nix) \ - $(wildcard jobs/*.sh) + $(wildcard jobs/*.sh) \ + $(TESTS) + +TESTS_ENVIRONMENT = $(perl) -w TESTS = \ query-all-tables.pl \ @@ -65,7 +68,7 @@ bzr-repo : touch bzr-repo/bzr-file bzr add bzr-repo/bzr-file BZR_HOME=$(abs_builddir)/data bzr commit -m "add bzr-file" bzr-repo/bzr-file - + svn-checkout-repo : ln -s svn-repo svn-checkout-repo diff --git a/tests/evaluation-tests.pl.in b/tests/evaluation-tests.pl similarity index 98% rename from tests/evaluation-tests.pl.in rename to tests/evaluation-tests.pl index 5ac4daa2..d24a1c8b 100755 --- a/tests/evaluation-tests.pl.in +++ b/tests/evaluation-tests.pl @@ -1,5 +1,3 @@ -#! @perl@ -w -I@nix@/libexec/nix - use strict; use Hydra::Schema; use Hydra::Helper::Nix; diff --git a/tests/query-all-tables.pl.in b/tests/query-all-tables.pl similarity index 93% rename from tests/query-all-tables.pl.in rename to tests/query-all-tables.pl index 1d3c9171..bf5cc394 100755 --- a/tests/query-all-tables.pl.in +++ b/tests/query-all-tables.pl @@ -1,5 +1,3 @@ -#! @perl@ -w -I@nix@/libexec/nix - use strict; use Hydra::Schema; use Hydra::Helper::Nix;