X-Git-Url: http://gitweb/?a=blobdiff_plain;f=pkgutil.cc;h=69fefc1e4bde7474df824508cdcc7cd77b0c79ff;hb=0b4af85e50830c17b3496434b2dd6a83cd2210ee;hp=216ca531de2dd92d507d474b42b5d3f8ccc70aad;hpb=d324dd089cd8d643a3d6616de11de178919e10e7;p=pkgutils-cross.git diff --git a/pkgutil.cc b/pkgutil.cc index 216ca53..69fefc1 100644 --- a/pkgutil.cc +++ b/pkgutil.cc @@ -44,8 +44,8 @@ #include #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& 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& 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