[packagekit] Reconizing Debian distro verstion

Daniel Nicoletti dantti85-pk at yahoo.com.br
Wed Apr 1 09:06:41 PDT 2009


here is the patch to find Debian version:

diff --git a/lib/packagekit-glib/pk-common.c b/lib/packagekit-glib/pk-common.c                                      
index 7af42d6..b23db1e 100644                                                                                       
--- a/lib/packagekit-glib/pk-common.c                                                                               
+++ b/lib/packagekit-glib/pk-common.c                                                                               
@@ -158,6 +158,19 @@ pk_get_distro_id (void)                                                                        
                goto out;                                                                                           
        }                                                                                                           
                                                                                                                    
+       /* check for Debian or Debian derivatives */                                                                
+       ret = g_file_get_contents ("/etc/debian_version", &contents, NULL, NULL);                                   
+       if (ret) {                                                                                                  
+               /* split to remove ""\n": "squeeze/sid\n" */                                                        
+               split = g_strsplit (contents, "\n", 0);                                                             
+               if (split == NULL)                                                                                  
+                       goto out;
+
+               /* complete! */
+               distro = g_strdup_printf ("debian-(%s)", split[0]);
+               goto out;
+       }
+
 out:
        g_strfreev (split);
        g_free (arch);


      Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com



More information about the PackageKit mailing list