CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
Only enable the tar and gzip modules when initialising libarchive.
[pkgutils-cross.git] / pkgutil.cc
index 216ca531de2dd92d507d474b42b5d3f8ccc70aad..69fefc1e4bde7474df824508cdcc7cd77b0c79ff 100644 (file)
@@ -44,8 +44,8 @@
 #include <archive_entry.h>
 
 #define INIT_ARCHIVE(ar) \
-       archive_read_support_compression_all((ar)); \
-       archive_read_support_format_all((ar))
+       archive_read_support_compression_gzip((ar)); \
+       archive_read_support_format_tar((ar))
 
 using __gnu_cxx::stdio_filebuf;
 
@@ -384,6 +384,8 @@ void pkgutil::pkg_install(const string& filename, const set<string>& keep_list,
        struct archive* archive;
        struct archive_entry* entry;
        unsigned int i;
+       char buf[PATH_MAX];
+       string absroot;
 
        archive = archive_read_new();
        INIT_ARCHIVE(archive);
@@ -394,12 +396,13 @@ void pkgutil::pkg_install(const string& filename, const set<string>& keep_list,
                throw runtime_error_with_errno("could not open " + filename, archive_errno(archive));
 
        chdir(root.c_str());
+       absroot = getcwd(buf, sizeof(buf));
 
        for (i = 0; archive_read_next_header(archive, &entry) ==
             ARCHIVE_OK; ++i) {
                string archive_filename = archive_entry_pathname(entry);
-               string reject_dir = trim_filename(root + string("/") + string(PKG_REJECTED));
-               string original_filename = trim_filename(root + string("/") + archive_filename);
+               string reject_dir = trim_filename(absroot + string("/") + string(PKG_REJECTED));
+               string original_filename = trim_filename(absroot + string("/") + archive_filename);
                string real_filename = original_filename;
 
                // Check if file is filtered out via INSTALL