CRUX-ARM :
Home
Home
::
Documentation
::
Download
::
Development
::
Community
::
Ports
::
Packages
::
Bugs
::
Links
::
About
::
Donors
development
/
pkgutils-cross.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- Added pkginfo to .gitignore
[pkgutils-cross.git]
/
pkgutil.cc
diff --git
a/pkgutil.cc
b/pkgutil.cc
index 709e7488493143cee0d9e9fde22184d7b4d39dc2..1bbb83d518fd7e49f0c3655ca76d5e18b3e6121f 100644
(file)
--- a/
pkgutil.cc
+++ b/
pkgutil.cc
@@
-2,7
+2,7
@@
// pkgutils
//
// Copyright (c) 2000-2005 Per Liden
// pkgutils
//
// Copyright (c) 2000-2005 Per Liden
-// Copyright (c) 2006-20
07
by CRUX team (http://crux.nu)
+// Copyright (c) 2006-20
13
by CRUX team (http://crux.nu)
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@
-44,8
+44,12
@@
#include <archive_entry.h>
#define INIT_ARCHIVE(ar) \
#include <archive_entry.h>
#define INIT_ARCHIVE(ar) \
- archive_read_support_compression_all((ar)); \
- archive_read_support_format_all((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;
using __gnu_cxx::stdio_filebuf;
@@
-350,8
+354,8
@@
pair<string, pkgutil::pkginfo_t> pkgutil::pkg_open(const string& filename) const
INIT_ARCHIVE(archive);
if (archive_read_open_filename(archive,
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) ==
throw runtime_error_with_errno("could not open " + filename, archive_errno(archive));
for (i = 0; archive_read_next_header(archive, &entry) ==
@@
-374,7
+378,7
@@
pair<string, pkgutil::pkginfo_t> pkgutil::pkg_open(const string& filename) const
throw runtime_error("could not read " + filename);
}
throw runtime_error("could not read " + filename);
}
- archive_read_f
inish
(archive);
+ archive_read_f
ree
(archive);
return result;
}
return result;
}
@@
-391,8
+395,8
@@
void pkgutil::pkg_install(const string& filename, const set<string>& keep_list,
INIT_ARCHIVE(archive);
if (archive_read_open_filename(archive,
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());
throw runtime_error_with_errno("could not open " + filename, archive_errno(archive));
chdir(root.c_str());
@@
-465,7
+469,7
@@
void pkgutil::pkg_install(const string& filename, const set<string>& keep_list,
throw runtime_error("could not read " + filename);
}
throw runtime_error("could not read " + filename);
}
- archive_read_f
inish
(archive);
+ archive_read_f
ree
(archive);
}
void pkgutil::ldconfig() const
}
void pkgutil::ldconfig() const
@@
-507,8
+511,8
@@
void pkgutil::pkg_footprint(string& filename) const
INIT_ARCHIVE(archive);
if (archive_read_open_filename(archive,
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) ==
throw runtime_error_with_errno("could not open " + filename, archive_errno(archive));
for (i = 0; archive_read_next_header(archive, &entry) ==
@@
-526,7
+530,7
@@
void pkgutil::pkg_footprint(string& filename) const
throw runtime_error_with_errno("could not read " + filename, archive_errno(archive));
}
throw runtime_error_with_errno("could not read " + filename, archive_errno(archive));
}
- archive_read_f
inish
(archive);
+ archive_read_f
ree
(archive);
// Too bad, there doesn't seem to be a way to reuse our archive
// instance
// Too bad, there doesn't seem to be a way to reuse our archive
// instance
@@
-534,8
+538,8
@@
void pkgutil::pkg_footprint(string& filename) const
INIT_ARCHIVE(archive);
if (archive_read_open_filename(archive,
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) ==
throw runtime_error_with_errno("could not open " + filename, archive_errno(archive));
for (i = 0; archive_read_next_header(archive, &entry) ==
@@
-608,7
+612,7
@@
void pkgutil::pkg_footprint(string& filename) const
throw runtime_error("could not read " + filename);
}
throw runtime_error("could not read " + filename);
}
- archive_read_f
inish
(archive);
+ archive_read_f
ree
(archive);
}
void pkgutil::print_version() const
}
void pkgutil::print_version() const