[PATCH 6/7] Use unpack_archive_file() instead of unpackCpioBall()

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

 



---
 loader/lang.c       |   12 ++++--------
 loader/method.c     |    4 ++--
 loader/urlinstall.c |    3 ++-
 3 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/loader/lang.c b/loader/lang.c
index 035fb75..4f230dc 100644
--- a/loader/lang.c
+++ b/loader/lang.c
@@ -39,6 +39,7 @@
 #include "lang.h"
 #include "loadermisc.h"
 #include "windows.h"
+#include "unpack.h"
 
 #include "../pyanaconda/isys/lang.h"
 #include "../pyanaconda/isys/isys.h"
@@ -141,7 +142,6 @@ int getLangInfo(struct langInfo ** langs) {
 
 void loadLanguage (char * file) {
     char filename[200];
-    gzFile stream;
     int fd, hash, rc;
     char * key = getenv("LANGKEY");
 
@@ -159,20 +159,16 @@ void loadLanguage (char * file) {
         sprintf(filename, "/etc/loader.tr");
     }
 
-    stream = gzopen(file, "r");
-
-    if (!stream) {
+    if (access(file, R_OK) == -1) {
         newtWinMessage("Error", "OK", "Translation for %s is not available.  "
                        "The Installation will proceed in English.", key);
         return ;
     }
     
     sprintf(filename, "%s.tr", key);
+    rc = unpack_archive_file(filename, "/tmp/translation");
 
-    rc = installCpioFile(stream, filename, "/tmp/translation", 1);
-    gzclose(stream);
-
-    if (rc || access("/tmp/translation", R_OK)) {
+    if (rc != ARCHIVE_OK || access("/tmp/translation", R_OK) == -1) {
         newtWinMessage("Error", "OK", "Cannot get translation file %s.\n", 
                         filename);
         return;
diff --git a/loader/method.c b/loader/method.c
index d84a2e8..0173f5a 100644
--- a/loader/method.c
+++ b/loader/method.c
@@ -44,10 +44,10 @@
 #include "lang.h"
 #include "mediacheck.h"
 #include "method.h"
+#include "unpack.h"
 
 #include "../pyanaconda/isys/imount.h"
 #include "../pyanaconda/isys/isys.h"
-#include "../pyanaconda/isys/cpio.h"
 #include "../pyanaconda/isys/log.h"
 
 #include "devt.h"
@@ -345,7 +345,7 @@ void copyUpdatesImg(char * path) {
             umount("/tmp/update-disk");
             unlink("/tmp/update-disk");
         } else {
-            unpackCpioBall(path, "/tmp/updates");
+            unpack_archive_file(path, "/tmp/updates");
         }
     }
 }
diff --git a/loader/urlinstall.c b/loader/urlinstall.c
index 0998198..80285cd 100644
--- a/loader/urlinstall.c
+++ b/loader/urlinstall.c
@@ -47,6 +47,7 @@
 #include "cdinstall.h"
 #include "urls.h"
 #include "windows.h"
+#include "unpack.h"
 
 /* boot flags */
 extern uint64_t flags;
@@ -177,7 +178,7 @@ int loadUrlImages(struct loaderData_s *loaderData) {
         unlink("/tmp/updates-disk.img");
         unlink("/tmp/update-disk");
     } else if (!access("/tmp/updates-disk.img", R_OK)) {
-        unpackCpioBall("/tmp/updates-disk.img", "/tmp/updates");
+        unpack_archive_file("/tmp/updates-disk.img", "/tmp/updates");
         unlink("/tmp/updates-disk.img");
     }
 
-- 
1.7.2.3

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux