CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
pkgutils-cross: updated to 5.35.2
authorVictor Martinez <pitillo@ono.com>
Mon, 8 Oct 2012 18:15:27 +0000 (18:15 +0000)
committerVictor Martinez <pitillo@ono.com>
Mon, 8 Oct 2012 18:15:27 +0000 (18:15 +0000)
src/Makefile
src/pkgutil.cc

index 4d0b524d41a1528b53d4d6478e849dd6ed7b7625..023d6c221049da8e53ee328e40bba9ff661b6114 100644 (file)
@@ -25,7 +25,7 @@ BINDIR = /usr/bin
 MANDIR = /usr/man
 ETCDIR = /etc
 
-VERSION = 5.35.1
+VERSION = 5.35.2
 NAME = pkgutils-$(VERSION)
 
 CXXFLAGS += -DNDEBUG
index f549b893e12b92884a6b437cfb9b9752868606bd..843c668f2876e588fd0c4181e9e67f9b1b5f57a7 100644 (file)
 #include <archive_entry.h>
 
 #define INIT_ARCHIVE(ar) \
-       archive_read_support_compression_gzip((ar)); \
-       archive_read_support_compression_bzip2((ar)); \
-       archive_read_support_compression_xz((ar)); \
+       archive_read_support_filter_gzip((ar)); \
+       archive_read_support_filter_bzip2((ar)); \
+       archive_read_support_filter_xz((ar)); \
        archive_read_support_format_tar((ar))
 
+#define DEFAULT_BYTES_PER_BLOCK (20 * 512)
+
 using __gnu_cxx::stdio_filebuf;
 
 pkgutil::pkgutil(const string& name)
@@ -352,8 +354,8 @@ pair<string, pkgutil::pkginfo_t> pkgutil::pkg_open(const string& filename) const
        INIT_ARCHIVE(archive);
 
        if (archive_read_open_filename(archive,
-           const_cast<char*>(filename.c_str()),
-           ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK)
+           filename.c_str(),
+           DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK)
                throw runtime_error_with_errno("could not open " + filename, archive_errno(archive));
 
        for (i = 0; archive_read_next_header(archive, &entry) ==
@@ -376,7 +378,7 @@ pair<string, pkgutil::pkginfo_t> pkgutil::pkg_open(const string& filename) const
                        throw runtime_error("could not read " + filename);
        }
 
-       archive_read_finish(archive);
+       archive_read_free(archive);
 
        return result;
 }
@@ -393,8 +395,8 @@ void pkgutil::pkg_install(const string& filename, const set<string>& keep_list,
        INIT_ARCHIVE(archive);
 
        if (archive_read_open_filename(archive,
-           const_cast<char*>(filename.c_str()),
-           ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK)
+           filename.c_str(),
+           DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK)
                throw runtime_error_with_errno("could not open " + filename, archive_errno(archive));
 
        chdir(root.c_str());
@@ -467,7 +469,7 @@ void pkgutil::pkg_install(const string& filename, const set<string>& keep_list,
                        throw runtime_error("could not read " + filename);
        }
 
-       archive_read_finish(archive);
+       archive_read_free(archive);
 }
 
 void pkgutil::ldconfig() const
@@ -509,8 +511,8 @@ void pkgutil::pkg_footprint(string& filename) const
        INIT_ARCHIVE(archive);
 
        if (archive_read_open_filename(archive,
-           const_cast<char*>(filename.c_str()),
-           ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK)
+           filename.c_str(),
+           DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK)
                 throw runtime_error_with_errno("could not open " + filename, archive_errno(archive));
 
        for (i = 0; archive_read_next_header(archive, &entry) ==
@@ -528,7 +530,7 @@ void pkgutil::pkg_footprint(string& filename) const
                        throw runtime_error_with_errno("could not read " + filename, archive_errno(archive));
        }
 
-       archive_read_finish(archive);
+       archive_read_free(archive);
 
        // Too bad, there doesn't seem to be a way to reuse our archive
        // instance
@@ -536,8 +538,8 @@ void pkgutil::pkg_footprint(string& filename) const
        INIT_ARCHIVE(archive);
 
        if (archive_read_open_filename(archive,
-           const_cast<char*>(filename.c_str()),
-           ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK)
+           filename.c_str(),
+           DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK)
                 throw runtime_error_with_errno("could not open " + filename, archive_errno(archive));
 
        for (i = 0; archive_read_next_header(archive, &entry) ==
@@ -610,7 +612,7 @@ void pkgutil::pkg_footprint(string& filename) const
                        throw runtime_error("could not read " + filename);
        }
 
-       archive_read_finish(archive);
+       archive_read_free(archive);
 }
 
 void pkgutil::print_version() const