[gnome-boxes] unattended-file: Introduce disk_file prop



commit 510f4ffbfb142891f657b0b6a2124eb2a1a1ac51
Author: Lasse Schuirmann <lasse schuirmann gmail com>
Date:   Sun Jun 1 16:25:00 2014 +0200

    unattended-file: Introduce disk_file prop
    
    This provides the possibility to override the disk file in the derived
    classes of UnattendedFile to copy to initrd file rather.
    
    This will be needed for supporting initrd injection method for express
    installation.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=730640

 src/unattended-file.vala |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/unattended-file.vala b/src/unattended-file.vala
index 2bd10bd..5395c11 100644
--- a/src/unattended-file.vala
+++ b/src/unattended-file.vala
@@ -6,18 +6,23 @@ private interface Boxes.UnattendedFile : GLib.Object {
     public abstract string src_path { get; set; }
     public abstract string dest_name { get; set; }
 
+    protected virtual string disk_file {
+        owned get {
+            return installer.disk_file.get_path ();
+        }
+    }
     protected abstract UnattendedInstaller installer  { get; set; }
 
     public async void copy (Cancellable? cancellable) throws GLib.Error {
         var source_file = yield get_source_file (cancellable);
 
-        debug ("Copying unattended file '%s' into disk drive/image '%s'", dest_name, 
installer.disk_file.get_path ());
+        debug ("Copying unattended file '%s' into disk drive/image '%s'", dest_name, disk_file);
         // FIXME: Perhaps we should use libarchive for this? Make sure to also change the mcopy dependency 
in README.
-        string[] argv = { "mcopy", "-n", "-o", "-i", installer.disk_file.get_path (),
+        string[] argv = { "mcopy", "-n", "-o", "-i", disk_file,
                                    source_file.get_path (),
                                    "::" + dest_name };
         yield exec (argv, cancellable);
-        debug ("Copied unattended file '%s' into disk drive/image '%s'", dest_name, 
installer.disk_file.get_path ());
+        debug ("Copied unattended file '%s' into disk drive/image '%s'", dest_name, disk_file);
     }
 
     protected abstract async File get_source_file (Cancellable? cancellable)  throws GLib.Error;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]