[gnome-boxes] installer: Prefix driver files with location's MD5



commit 0bfd05c60652d388ccf961f093ed8eb7fc8243cf
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed Dec 19 03:08:37 2012 +0200

    installer: Prefix driver files with location's MD5
    
    Instead of OS ID and architecture, lets just prefix driver files with
    MD5 sum of their location. This way we not only guarantee uniqueness but
    also ensure that our cache is up2date. The latter assumes that location
    is versioned (as it should be) so thats something we need to keep in
    mind when updating drivers in libosinfo DB.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=690169

 src/unattended-installer.vala |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/unattended-installer.vala b/src/unattended-installer.vala
index 1e80c32..e0b0126 100644
--- a/src/unattended-installer.vala
+++ b/src/unattended-installer.vala
@@ -639,12 +639,12 @@ private class Boxes.UnattendedInstaller: InstallerMedia {
 
         var driver_files = new GLib.List<UnattendedFile> ();
         var location = driver.get_location ();
+        var location_checksum = Checksum.compute_for_string (ChecksumType.MD5, location);
         foreach (var filename in driver.get_files ()) {
             var file_uri = location + "/" + filename;
             var file = File.new_for_uri (file_uri);
-            var cached_path = get_drivers_cache (os.short_id + "-" +
-                                                 driver.get_architecture () + "-" +
-                                                 file.get_basename ());
+
+            var cached_path = get_drivers_cache (location_checksum + "-" + file.get_basename ());
 
             file = yield downloader.download (file, cached_path);
 



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