[PATCH] New tool: virt-edit
This adds a virt-edit command. This is already possible using guestfish: guestfish -i domain
<fs> vi /some/file
but having a special command to do it makes the operation more obvious and easier. Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.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
On Wed, Sep 23, 2009 at 11:39:40AM +0100, Richard W.M. Jones wrote:
+ +EXTRA_DIST = \ + run-edit-locally \ + virt-edit.pl + +if HAVE_EDIT + +man_MANS = virt-edit.1 + +noinst_DATA = @top_builddir@/html/virt-edit.1.html + +virt-edit.1: virt-edit.pl + $(POD2MAN) \ + --section 1 \ + -c "Virtualization Support" \ + --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \ + $< > $@ + +@top_builddir@/html/virt-edit.1.html: virt-edit.pl + mkdir -p @top_builddir@/html + cd @top_builddir@ && pod2html \ + --css 'pod.css' \ + --title 'virt-edit, edit a file in a virtual machine' \ + --htmldir html \ + --outfile html/virt-edit.1.html \ + edit/$< + +install-data-hook: + mkdir -p $(DESTDIR)$(bindir) + install -m 0755 virt-edit.pl $(DESTDIR)$(bindir)/virt-edit
If you name the file in GIT 'virt-edit' instead of 'virt-edit.pl' you can just use the regular automake rules since you won't need to be re-naming it upon install.. bin_SCRIPTS = virt-edit and thus not have to write install + uninstall hooks. Regards, Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
On Wed, Sep 23, 2009 at 11:45:16AM +0100, Daniel P. Berrange wrote:
On Wed, Sep 23, 2009 at 11:39:40AM +0100, Richard W.M. Jones wrote:
+ +EXTRA_DIST = \ + run-edit-locally \ + virt-edit.pl + +if HAVE_EDIT + +man_MANS = virt-edit.1 + +noinst_DATA = @top_builddir@/html/virt-edit.1.html + +virt-edit.1: virt-edit.pl + $(POD2MAN) \ + --section 1 \ + -c "Virtualization Support" \ + --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \ + $< > $@ + +@top_builddir@/html/virt-edit.1.html: virt-edit.pl + mkdir -p @top_builddir@/html + cd @top_builddir@ && pod2html \ + --css 'pod.css' \ + --title 'virt-edit, edit a file in a virtual machine' \ + --htmldir html \ + --outfile html/virt-edit.1.html \ + edit/$< + +install-data-hook: + mkdir -p $(DESTDIR)$(bindir) + install -m 0755 virt-edit.pl $(DESTDIR)$(bindir)/virt-edit
If you name the file in GIT 'virt-edit' instead of 'virt-edit.pl' you can just use the regular automake rules since you won't need to be re-naming it upon install..
bin_SCRIPTS = virt-edit
and thus not have to write install + uninstall hooks.
The was some reason why we called the tools virt-foo.pl, but I can't honestly recall it now. Perhaps something to do with having the editor recognize that it's a Perl file, but I should think any editor worth its salt should be able to do that ... Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 75 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
On Wed, Sep 23, 2009 at 12:00:23PM +0100, Richard W.M. Jones wrote:
On Wed, Sep 23, 2009 at 11:45:16AM +0100, Daniel P. Berrange wrote:
On Wed, Sep 23, 2009 at 11:39:40AM +0100, Richard W.M. Jones wrote:
+ +EXTRA_DIST = \ + run-edit-locally \ + virt-edit.pl + +if HAVE_EDIT + +man_MANS = virt-edit.1 + +noinst_DATA = @top_builddir@/html/virt-edit.1.html + +virt-edit.1: virt-edit.pl + $(POD2MAN) \ + --section 1 \ + -c "Virtualization Support" \ + --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \ + $< > $@ + +@top_builddir@/html/virt-edit.1.html: virt-edit.pl + mkdir -p @top_builddir@/html + cd @top_builddir@ && pod2html \ + --css 'pod.css' \ + --title 'virt-edit, edit a file in a virtual machine' \ + --htmldir html \ + --outfile html/virt-edit.1.html \ + edit/$< + +install-data-hook: + mkdir -p $(DESTDIR)$(bindir) + install -m 0755 virt-edit.pl $(DESTDIR)$(bindir)/virt-edit
If you name the file in GIT 'virt-edit' instead of 'virt-edit.pl' you can just use the regular automake rules since you won't need to be re-naming it upon install..
bin_SCRIPTS = virt-edit
and thus not have to write install + uninstall hooks.
The was some reason why we called the tools virt-foo.pl, but I can't honestly recall it now.
Perhaps something to do with having the editor recognize that it's a Perl file, but I should think any editor worth its salt should be able to do that ...
To handle that with emacs you can just add # -*- perl -*- Immediately after the #!/usr/bin/perl line Regards, Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
On 23/09/09 11:45, Daniel P. Berrange wrote:
If you name the file in GIT 'virt-edit' instead of 'virt-edit.pl' you can just use the regular automake rules since you won't need to be re-naming it upon install..
bin_SCRIPTS = virt-edit
and thus not have to write install + uninstall hooks.
Is there a way to do this with Module::Build? I tried removing .pl, but the extension appears to be magic. I have to rename them explicitly. Matt -- Matthew Booth, RHCA, RHCSS Red Hat Engineering, Virtualisation Team M: +44 (0)7977 267231 GPG ID: D33C3490 GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490
On Thu, Oct 01, 2009 at 10:49:55AM +0100, Matthew Booth wrote:
On 23/09/09 11:45, Daniel P. Berrange wrote:
If you name the file in GIT 'virt-edit' instead of 'virt-edit.pl' you can just use the regular automake rules since you won't need to be re-naming it upon install..
bin_SCRIPTS = virt-edit
and thus not have to write install + uninstall hooks.
Is there a way to do this with Module::Build? I tried removing .pl, but the extension appears to be magic. I have to rename them explicitly.
Not sure that Module::Build will work, because we're using autoconf/automake, and not any Perl-specific build system. FWIW I pushed this change a week ago: http://git.et.redhat.com/?p=libguestfs.git;a=commitdiff;h=b488436cc54288fcae... Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 75 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
On 01/10/09 10:56, Richard W.M. Jones wrote:
Not sure that Module::Build will work, because we're using autoconf/automake, and not any Perl-specific build system.
Question was for benefit of virt-v2v. I hit the same issue. Matt -- Matthew Booth, RHCA, RHCSS Red Hat Engineering, Virtualisation Team M: +44 (0)7977 267231 GPG ID: D33C3490 GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490
On Thu, Oct 01, 2009 at 10:49:55AM +0100, Matthew Booth wrote:
On 23/09/09 11:45, Daniel P. Berrange wrote:
If you name the file in GIT 'virt-edit' instead of 'virt-edit.pl' you can just use the regular automake rules since you won't need to be re-naming it upon install..
bin_SCRIPTS = virt-edit
and thus not have to write install + uninstall hooks.
Is there a way to do this with Module::Build? I tried removing .pl, but the extension appears to be magic. I have to rename them explicitly.
This works for me in the libvirt TCK Module::Build rules script_files => [ "bin/libvirt-tck", ], Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (3)
-
Daniel P. Berrange -
Matthew Booth -
Richard W.M. Jones