Added support for using noarch packages.
--HG-- extra : convert_revision : a96166ddecb6efe65d35283f25e06a944cc4a038
This commit is contained in:
parent
4f6364a2bd
commit
6b6162bb44
10 changed files with 107 additions and 36 deletions
19
lib/unpack.c
19
lib/unpack.c
|
@ -56,25 +56,34 @@ xbps_unpack_binary_pkg(prop_dictionary_t repo, prop_dictionary_t pkg,
|
|||
const char *destdir,
|
||||
void (*cb_print)(prop_dictionary_t))
|
||||
{
|
||||
prop_string_t filename, repoloc;
|
||||
char *binfile;
|
||||
prop_string_t filename, repoloc, arch;
|
||||
char *binfile, *path;
|
||||
int rv = 0;
|
||||
|
||||
assert(pkg != NULL);
|
||||
|
||||
/* Append filename to the full path for binary pkg */
|
||||
filename = prop_dictionary_get(pkg, "filename");
|
||||
arch = prop_dictionary_get(pkg, "architecture");
|
||||
if (repo)
|
||||
repoloc = prop_dictionary_get(repo, "location-local");
|
||||
else
|
||||
repoloc = prop_dictionary_get(pkg, "repository");
|
||||
|
||||
binfile = xbps_append_full_path(false,
|
||||
path = xbps_append_full_path(false,
|
||||
prop_string_cstring_nocopy(repoloc),
|
||||
prop_string_cstring_nocopy(filename));
|
||||
if (binfile == NULL)
|
||||
prop_string_cstring_nocopy(arch));
|
||||
if (path == NULL)
|
||||
return EINVAL;
|
||||
|
||||
binfile = xbps_append_full_path(false, path,
|
||||
prop_string_cstring_nocopy(filename));
|
||||
if (binfile == NULL) {
|
||||
free(path);
|
||||
return EINVAL;
|
||||
}
|
||||
free(path);
|
||||
|
||||
if (!cb_print)
|
||||
unpack_defcb_print(pkg);
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue