Remove knowledge from the library to install packages.
The library is only responsible now to find all binary packages from repositories, sort them and create a dictionary with all details. The frontend (xbps-bin) provides support for this, and this allows for more flexibility and removes some stuff that didn't belong in the library. While here implemented support to show total download/installed size for all packages that are going to be installed. Next step will be to implement user interactivity before installing/removing/updating packages. --HG-- extra : convert_revision : 858e9a89bc6a60b348435f2416a8af3ebb6ea5c9
This commit is contained in:
parent
acd07f61e3
commit
f80e1753a8
13 changed files with 580 additions and 482 deletions
13
lib/unpack.c
13
lib/unpack.c
|
@ -39,7 +39,7 @@ static int unpack_archive_init(prop_dictionary_t, const char *);
|
|||
static int unpack_archive_fini(struct archive *, prop_dictionary_t);
|
||||
|
||||
int
|
||||
xbps_unpack_binary_pkg(prop_dictionary_t repo, prop_dictionary_t pkg)
|
||||
xbps_unpack_binary_pkg(prop_dictionary_t pkg)
|
||||
{
|
||||
prop_string_t filename, repoloc, arch;
|
||||
char *binfile;
|
||||
|
@ -47,13 +47,14 @@ xbps_unpack_binary_pkg(prop_dictionary_t repo, prop_dictionary_t pkg)
|
|||
|
||||
assert(pkg != NULL);
|
||||
|
||||
/* Append filename to the full path for binary pkg */
|
||||
/*
|
||||
* 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");
|
||||
repoloc = prop_dictionary_get(pkg, "repository");
|
||||
if (filename == NULL || arch == NULL || repoloc == NULL)
|
||||
return ENOTSUP;
|
||||
|
||||
binfile = xbps_xasprintf("%s/%s/%s",
|
||||
prop_string_cstring_nocopy(repoloc),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue