[PATCH 1/3] Build: Make changelog action call git directly without Git module
The changelog action needs to checkout git2cl as a submodule. For some reason, when called through the Git module, command('submodule', 'update') was doing something unfathomable, and different to just calling 'git submodule update'. As Git is just a command line wrapper anyway, I've sidestepped this by just calling the command directly. --- Build.PL | 18 ++---------------- 1 files changed, 2 insertions(+), 16 deletions(-) diff --git a/Build.PL b/Build.PL index efce5dd..51afae8 100644 --- a/Build.PL +++ b/Build.PL @@ -150,22 +150,8 @@ sub ACTION_changelog return 1; } - # Check that git is available - eval "use Git;"; - if($@) { - $self->log_info("Git is not installed\n"); - return 1; - } - - # Update submodules to get git2cl - my $repo = Git->repository(Directory => '.'); - - eval { - $repo->command_noisy('submodule', 'update'); - }; - - if($@) { - $self->log_info("Failed to initialise git2cl\n"); + unless(system("git", "submodule", "update") == 0) { + $self->log_info("Failed to initialise git2cl: $@\n"); return 1; } -- 1.6.6
add_kernel was missing an _is_installed test for the kernel. --- lib/Sys/VirtV2V/GuestOS/RedHat.pm | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/lib/Sys/VirtV2V/GuestOS/RedHat.pm b/lib/Sys/VirtV2V/GuestOS/RedHat.pm index 5be124c..cd2f8e6 100644 --- a/lib/Sys/VirtV2V/GuestOS/RedHat.pm +++ b/lib/Sys/VirtV2V/GuestOS/RedHat.pm @@ -543,6 +543,8 @@ sub add_kernel my $path = $app->{path}; + return undef if($self->_is_installed($path)); + my @install; # Install any kernel dependencies which aren't already installed foreach my $dep (@{$app->{deps}}) { -- 1.6.6
On Tue, Feb 16, 2010 at 02:46:57PM +0000, Matthew Booth wrote:
add_kernel was missing an _is_installed test for the kernel. --- lib/Sys/VirtV2V/GuestOS/RedHat.pm | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/lib/Sys/VirtV2V/GuestOS/RedHat.pm b/lib/Sys/VirtV2V/GuestOS/RedHat.pm index 5be124c..cd2f8e6 100644 --- a/lib/Sys/VirtV2V/GuestOS/RedHat.pm +++ b/lib/Sys/VirtV2V/GuestOS/RedHat.pm @@ -543,6 +543,8 @@ sub add_kernel
my $path = $app->{path};
+ return undef if($self->_is_installed($path)); + my @install; # Install any kernel dependencies which aren't already installed foreach my $dep (@{$app->{deps}}) {
ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
The existing test on a pre-installed kernel wasn't dereferencing an array, meaning it never detected an existing kernel as virtio capable. --- lib/Sys/VirtV2V/Converter/Linux.pm | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/Sys/VirtV2V/Converter/Linux.pm b/lib/Sys/VirtV2V/Converter/Linux.pm index d5a93a7..87eeeb3 100644 --- a/lib/Sys/VirtV2V/Converter/Linux.pm +++ b/lib/Sys/VirtV2V/Converter/Linux.pm @@ -261,7 +261,7 @@ sub _configure_kernel "virtio_net" => undef ); - foreach my $module ($kernel->{modules}) { + foreach my $module (@{$kernel->{modules}}) { if(exists($checklist{$module})) { $checklist{$module} = 1; } -- 1.6.6
On Tue, Feb 16, 2010 at 02:46:58PM +0000, Matthew Booth wrote:
The existing test on a pre-installed kernel wasn't dereferencing an array, meaning it never detected an existing kernel as virtio capable. --- lib/Sys/VirtV2V/Converter/Linux.pm | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/Sys/VirtV2V/Converter/Linux.pm b/lib/Sys/VirtV2V/Converter/Linux.pm index d5a93a7..87eeeb3 100644 --- a/lib/Sys/VirtV2V/Converter/Linux.pm +++ b/lib/Sys/VirtV2V/Converter/Linux.pm @@ -261,7 +261,7 @@ sub _configure_kernel "virtio_net" => undef );
- foreach my $module ($kernel->{modules}) { + foreach my $module (@{$kernel->{modules}}) { if(exists($checklist{$module})) { $checklist{$module} = 1; } --
Static typing FTW. ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
participants (2)
-
Matthew Booth -
Richard W.M. Jones