xbps: update to 0.42.
This commit is contained in:
parent
da8d29367d
commit
4636c7ed65
11 changed files with 7 additions and 747 deletions
|
@ -1,31 +0,0 @@
|
|||
From 1c20086896215fd6eb8e8ff59a6f98a86024ec20 Mon Sep 17 00:00:00 2001
|
||||
From: Juan RP <xtraeme@gmail.com>
|
||||
Date: Fri, 17 Oct 2014 09:17:07 +0200
|
||||
Subject: [PATCH 01/13] Package remove: disable file owner checks if euid==0.
|
||||
|
||||
All package files even not owned by root should be removed, so make sure
|
||||
that those checks return success while being root.
|
||||
|
||||
This fixes package removal for polkit, that had /etc/polkit/rules.d
|
||||
files owned by the polkitd user.
|
||||
---
|
||||
NEWS | 4 ++++
|
||||
lib/package_remove.c | 2 +-
|
||||
2 files changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/package_remove.c b/lib/package_remove.c
|
||||
index 9c82278..5679fea 100644
|
||||
--- lib/package_remove.c
|
||||
+++ lib/package_remove.c
|
||||
@@ -65,7 +65,7 @@ check_remove_pkg_files(struct xbps_handle *xhp,
|
||||
* enough to ensure the user has write permissions
|
||||
* on the directory.
|
||||
*/
|
||||
- if (!lstat(path, &st) && euid == st.st_uid) {
|
||||
+ if (euid == 0 || (!lstat(path, &st) && euid == st.st_uid)) {
|
||||
/* success */
|
||||
continue;
|
||||
}
|
||||
--
|
||||
2.1.2
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
From d7633e88e0bf25cd2c319ac1c0706fe69bfd5885 Mon Sep 17 00:00:00 2001
|
||||
From: Juan RP <xtraeme@gmail.com>
|
||||
Date: Fri, 17 Oct 2014 09:52:32 +0200
|
||||
Subject: [PATCH 02/13] Fix #62 (Dup replaced pkgs in transaction)
|
||||
|
||||
---
|
||||
NEWS | 3 +++
|
||||
lib/transaction_package_replace.c | 3 +--
|
||||
tests/xbps/libxbps/shell/replace_test.sh | 40 ++++++++++++++++++++++++++++++++
|
||||
3 files changed, 44 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/transaction_package_replace.c b/lib/transaction_package_replace.c
|
||||
index 56048f8..2eebd51 100644
|
||||
--- lib/transaction_package_replace.c
|
||||
+++ lib/transaction_package_replace.c
|
||||
@@ -103,14 +103,13 @@ xbps_transaction_package_replace(struct xbps_handle *xhp)
|
||||
*/
|
||||
xbps_dictionary_get_bool(instd, "automatic-install", &instd_auto);
|
||||
if ((reppkgd = xbps_find_pkg_in_array(unsorted, curpkgname, NULL))) {
|
||||
- xbps_dictionary_set_bool(instd,
|
||||
- "remove-and-update", true);
|
||||
xbps_dictionary_set_bool(reppkgd,
|
||||
"automatic-install", instd_auto);
|
||||
xbps_dictionary_set_bool(reppkgd,
|
||||
"skip-obsoletes", true);
|
||||
xbps_array_replace_dict_by_name(unsorted,
|
||||
reppkgd, curpkgname);
|
||||
+ continue;
|
||||
}
|
||||
/*
|
||||
* If new package is providing a virtual package to the
|
||||
diff --git a/tests/xbps/libxbps/shell/replace_test.sh b/tests/xbps/libxbps/shell/replace_test.sh
|
||||
index 469b7f8..0e54dc2 100644
|
||||
--- tests/xbps/libxbps/shell/replace_test.sh
|
||||
+++ tests/xbps/libxbps/shell/replace_test.sh
|
||||
@@ -37,6 +37,45 @@ replace_dups_body() {
|
||||
atf_check_equal $(xbps-query -C empty.conf -r root -p state B) installed
|
||||
}
|
||||
|
||||
+atf_test_case replace_ntimes
|
||||
+
|
||||
+replace_ntimes_head() {
|
||||
+ atf_set "descr" "Tests for package replace: replacing installed pkg by multiple pkgs"
|
||||
+}
|
||||
+
|
||||
+replace_ntimes_body() {
|
||||
+ mkdir some_repo root
|
||||
+ mkdir -p pkg_{A,B,C,D}/usr/bin
|
||||
+ cd some_repo
|
||||
+ xbps-create -A noarch -n A-1.0_1 -s "A pkg" ../pkg_A
|
||||
+ atf_check_equal $? 0
|
||||
+ xbps-create -A noarch -n B-1.0_1 -s "B pkg" ../pkg_B
|
||||
+ atf_check_equal $? 0
|
||||
+ xbps-create -A noarch -n C-1.0_1 -s "C pkg" ../pkg_C
|
||||
+ atf_check_equal $? 0
|
||||
+ xbps-create -A noarch -n D-1.0_1 -s "D pkg" ../pkg_D
|
||||
+ atf_check_equal $? 0
|
||||
+ xbps-rindex -a *.xbps
|
||||
+ atf_check_equal $? 0
|
||||
+ cd ..
|
||||
+ xbps-install -C empty.conf -r root --repository=$PWD/some_repo -yd A B C D
|
||||
+ atf_check_equal $? 0
|
||||
+ cd some_repo
|
||||
+ xbps-create -A noarch -n A-1.1_1 -s "A pkg" ../pkg_A
|
||||
+ atf_check_equal $? 0
|
||||
+ xbps-create -A noarch -n B-1.1_1 -s "B pkg" --replaces "A<1.1" ../pkg_B
|
||||
+ atf_check_equal $? 0
|
||||
+ xbps-create -A noarch -n C-1.1_1 -s "C pkg" --replaces "A<1.1" ../pkg_C
|
||||
+ atf_check_equal $? 0
|
||||
+ xbps-create -A noarch -n D-1.1_1 -s "D pkg" --replaces "A<1.1" ../pkg_D
|
||||
+ atf_check_equal $? 0
|
||||
+ xbps-rindex -a *.xbps
|
||||
+ atf_check_equal $? 0
|
||||
+ cd ..
|
||||
+ result=$(xbps-install -C empty.conf -r root --repository=$PWD/some_repo -yun|wc -l)
|
||||
+ atf_check_equal $result 4
|
||||
+}
|
||||
+
|
||||
atf_test_case self_replace
|
||||
|
||||
self_replace_head() {
|
||||
@@ -97,6 +136,7 @@ replace_vpkg_body() {
|
||||
|
||||
atf_init_test_cases() {
|
||||
atf_add_test_case replace_dups
|
||||
+ atf_add_test_case replace_ntimes
|
||||
atf_add_test_case replace_vpkg
|
||||
atf_add_test_case self_replace
|
||||
}
|
||||
--
|
||||
2.1.2
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
Switch to internalize_from_zfile() to be able to read zplists from 0.42.
|
||||
|
||||
--- lib/pkgdb.c.orig 2014-10-20 08:42:01.750291119 +0200
|
||||
+++ lib/pkgdb.c 2014-10-20 08:42:17.430433368 +0200
|
||||
@@ -155,7 +155,7 @@ xbps_pkgdb_update(struct xbps_handle *xh
|
||||
return cached_rv;
|
||||
|
||||
if (xhp->pkgdb && flush) {
|
||||
- pkgdb_storage = xbps_dictionary_internalize_from_file(xhp->pkgdb_plist);
|
||||
+ pkgdb_storage = xbps_dictionary_internalize_from_zfile(xhp->pkgdb_plist);
|
||||
if (pkgdb_storage == NULL ||
|
||||
!xbps_dictionary_equals(xhp->pkgdb, pkgdb_storage)) {
|
||||
/* flush dictionary to storage */
|
||||
@@ -170,7 +170,7 @@ xbps_pkgdb_update(struct xbps_handle *xh
|
||||
cached_rv = 0;
|
||||
}
|
||||
/* update copy in memory */
|
||||
- if ((xhp->pkgdb = xbps_dictionary_internalize_from_file(xhp->pkgdb_plist)) == NULL) {
|
||||
+ if ((xhp->pkgdb = xbps_dictionary_internalize_from_zfile(xhp->pkgdb_plist)) == NULL) {
|
||||
if (errno == ENOENT)
|
||||
xhp->pkgdb = xbps_dictionary_create();
|
||||
else
|
||||
@@ -346,7 +346,7 @@ xbps_pkgdb_get_pkg_files(struct xbps_han
|
||||
|
||||
plist = xbps_xasprintf("%s/.%s-files.plist", xhp->metadir, pkgname);
|
||||
free(pkgname);
|
||||
- pkgfilesd = xbps_dictionary_internalize_from_file(plist);
|
||||
+ pkgfilesd = xbps_dictionary_internalize_from_zfile(plist);
|
||||
free(plist);
|
||||
|
||||
if (pkgfilesd == NULL) {
|
||||
--- lib/package_remove.c.orig 2014-10-20 08:42:53.597762164 +0200
|
||||
+++ lib/package_remove.c 2014-10-20 08:42:59.429815272 +0200
|
||||
@@ -268,7 +268,7 @@ xbps_remove_pkg(struct xbps_handle *xhp,
|
||||
|
||||
/* internalize pkg files dictionary from metadir */
|
||||
snprintf(metafile, sizeof(metafile), "%s/.%s-files.plist", xhp->metadir, pkgname);
|
||||
- pkgfilesd = xbps_dictionary_internalize_from_file(metafile);
|
||||
+ pkgfilesd = xbps_dictionary_internalize_from_zfile(metafile);
|
||||
if (pkgfilesd == NULL)
|
||||
xbps_dbg_printf(xhp, "WARNING: metaplist for %s "
|
||||
"doesn't exist!\n", pkgver);
|
||||
--- bin/xbps-pkgdb/check.c.orig 2014-10-20 08:43:16.190968036 +0200
|
||||
+++ bin/xbps-pkgdb/check.c 2014-10-20 08:43:21.246014149 +0200
|
||||
@@ -94,7 +94,7 @@ check_pkg_integrity(struct xbps_handle *
|
||||
if (xbps_dictionary_get_cstring_nocopy(opkgd, "metafile-sha256", &sha256)) {
|
||||
buf = xbps_xasprintf("%s/.%s-files.plist",
|
||||
xhp->metadir, pkgname);
|
||||
- filesd = xbps_dictionary_internalize_from_file(buf);
|
||||
+ filesd = xbps_dictionary_internalize_from_zfile(buf);
|
||||
rv = xbps_file_hash_check(buf, sha256);
|
||||
free(buf);
|
||||
if (rv == ENOENT) {
|
|
@ -1,85 +0,0 @@
|
|||
commit 15943d990caf40a77c255ee5bc7e7935ebf0673d
|
||||
Author: Juan RP <xtraeme@gmail.com>
|
||||
Date: Wed Oct 29 09:46:54 2014 +0100
|
||||
|
||||
xbps-query: fix --fulldeptree with multiple pkgs using vpkgs and non vpkgs.
|
||||
|
||||
--- bin/xbps-query/show-deps.c 2014-09-29 15:54:15.000000000 +0200
|
||||
+++ bin/xbps-query/show-deps.c 2014-10-29 09:56:03.142653297 +0100
|
||||
@@ -43,6 +43,8 @@ struct pkgdep {
|
||||
static SLIST_HEAD(pkgdep_head, pkgdep) pkgdep_list =
|
||||
SLIST_HEAD_INITIALIZER(pkgdep_list);
|
||||
|
||||
+static xbps_dictionary_t pkgdep_pvmap;
|
||||
+
|
||||
static void
|
||||
print_rdeps(struct xbps_handle *xhp, xbps_array_t rdeps, bool full, bool repo)
|
||||
{
|
||||
@@ -53,7 +55,6 @@ print_rdeps(struct xbps_handle *xhp, xbp
|
||||
for (unsigned int i = 0; i < xbps_array_count(rdeps); i++) {
|
||||
struct pkgdep *pd;
|
||||
const char *pkgver;
|
||||
- char *vpkg;
|
||||
bool virtual = false, found = false;
|
||||
|
||||
xbps_array_get_cstring_nocopy(rdeps, i, &curdep);
|
||||
@@ -83,16 +84,15 @@ print_rdeps(struct xbps_handle *xhp, xbp
|
||||
p = xbps_pkg_name(curdep);
|
||||
|
||||
assert(p);
|
||||
- vpkg = xbps_xasprintf("%s-%s", p, xbps_pkg_version(pkgver));
|
||||
- assert(vpkg);
|
||||
+ if (pkgdep_pvmap == NULL)
|
||||
+ pkgdep_pvmap = xbps_dictionary_create();
|
||||
+
|
||||
+ xbps_dictionary_set_cstring_nocopy(pkgdep_pvmap, p, pkgver);
|
||||
free(p);
|
||||
}
|
||||
/* uniquify dependencies, sorting will be done later */
|
||||
SLIST_FOREACH(pd, &pkgdep_list, pkgdep_entries) {
|
||||
- if (virtual && strcmp(pd->pkg, vpkg) == 0) {
|
||||
- found = true;
|
||||
- break;
|
||||
- } else if (strcmp(pd->pkg, pkgver) == 0) {
|
||||
+ if (strcmp(pd->pkg, pkgver) == 0) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
@@ -100,11 +100,7 @@ print_rdeps(struct xbps_handle *xhp, xbp
|
||||
if (!found) {
|
||||
pd = malloc(sizeof(*pd));
|
||||
assert(pd);
|
||||
- if (virtual)
|
||||
- pd->pkg = vpkg;
|
||||
- else
|
||||
pd->pkg = pkgver;
|
||||
-
|
||||
pd->rdeps = xbps_array_copy(currdeps);
|
||||
SLIST_INSERT_HEAD(&pkgdep_list, pd, pkgdep_entries);
|
||||
//printf("Added %s into the slist\n", pd->pkg);
|
||||
@@ -143,13 +139,21 @@ sort_rdeps(void)
|
||||
char *pkgname;
|
||||
|
||||
xbps_array_get_cstring_nocopy(pd->rdeps, i, &pkgdep);
|
||||
- pkgname = xbps_pkgpattern_name(pkgdep);
|
||||
- if (pkgname == NULL)
|
||||
+ if ((pkgname = xbps_pkgpattern_name(pkgdep)) == NULL)
|
||||
pkgname = xbps_pkg_name(pkgdep);
|
||||
|
||||
- if (xbps_match_pkgname_in_array(result, pkgname))
|
||||
+ assert(pkgname);
|
||||
+ if (xbps_match_pkgname_in_array(result, pkgname)) {
|
||||
mdeps++;
|
||||
-
|
||||
+ free(pkgname);
|
||||
+ continue;
|
||||
+ }
|
||||
+ if (xbps_dictionary_get(pkgdep_pvmap, pkgname)) {
|
||||
+ mdeps++;
|
||||
+ free(pkgname);
|
||||
+ continue;
|
||||
+ }
|
||||
+ //printf("%s: missing dep %s\n", pd->pkg, pkgdep);
|
||||
free(pkgname);
|
||||
}
|
||||
if (mdeps == rdeps) {
|
|
@ -1,25 +0,0 @@
|
|||
From 12e18ae5796cdf0b1ec05b31a41380c6dbbe241f Mon Sep 17 00:00:00 2001
|
||||
From: Juan RP <xtraeme@gmail.com>
|
||||
Date: Thu, 30 Oct 2014 10:59:42 +0100
|
||||
Subject: [PATCH 1/4] bin/xbps-install/util.c: use STDOUT_FILENO.
|
||||
|
||||
---
|
||||
bin/xbps-install/util.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/bin/xbps-install/util.c b/bin/xbps-install/util.c
|
||||
index 3be2baf..9594877 100644
|
||||
--- bin/xbps-install/util.c
|
||||
+++ bin/xbps-install/util.c
|
||||
@@ -40,7 +40,7 @@ get_maxcols(void)
|
||||
{
|
||||
struct winsize ws;
|
||||
|
||||
- if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) == 0)
|
||||
+ if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) == 0)
|
||||
return ws.ws_col ? ws.ws_col : 80;
|
||||
|
||||
return 80;
|
||||
--
|
||||
2.1.3
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
From 3f7cd86d9d4e291a148016be9da379db52ac2d37 Mon Sep 17 00:00:00 2001
|
||||
From: Juan RP <xtraeme@gmail.com>
|
||||
Date: Thu, 30 Oct 2014 11:00:01 +0100
|
||||
Subject: [PATCH 2/4] bin/xbps-query/list.c: remove unused header.
|
||||
|
||||
---
|
||||
bin/xbps-query/list.c | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/bin/xbps-query/list.c b/bin/xbps-query/list.c
|
||||
index 73ba667..8532dc9 100644
|
||||
--- bin/xbps-query/list.c
|
||||
+++ bin/xbps-query/list.c
|
||||
@@ -29,7 +29,6 @@
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
-#include <sys/ioctl.h>
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
--
|
||||
2.1.3
|
||||
|
|
@ -1,295 +0,0 @@
|
|||
From b179c16fc096a8c549c860d34aa838fcc3cfb5b4 Mon Sep 17 00:00:00 2001
|
||||
From: Juan RP <xtraeme@gmail.com>
|
||||
Date: Thu, 30 Oct 2014 11:23:10 +0100
|
||||
Subject: [PATCH 3/4] xbps-{install,remove}: implemented column/wide output
|
||||
mode.
|
||||
|
||||
See https://github.com/voidlinux/xbps/issues/63 for info.
|
||||
|
||||
Close #63
|
||||
---
|
||||
NEWS | 5 ++
|
||||
bin/xbps-install/defs.h | 12 +++++
|
||||
bin/xbps-install/transaction.c | 99 +++++++++++++++++--------------------
|
||||
bin/xbps-install/util.c | 109 ++++++++++++++++++++++++++++++++++++++++-
|
||||
4 files changed, 170 insertions(+), 55 deletions(-)
|
||||
|
||||
diff --git a/bin/xbps-install/defs.h b/bin/xbps-install/defs.h
|
||||
index 3a9b718..a8d0c7e 100644
|
||||
--- bin/xbps-install/defs.h
|
||||
+++ bin/xbps-install/defs.h
|
||||
@@ -34,6 +34,17 @@ struct xferstat {
|
||||
struct timeval last;
|
||||
};
|
||||
|
||||
+struct transaction {
|
||||
+ struct xbps_handle *xhp;
|
||||
+ xbps_dictionary_t d;
|
||||
+ xbps_object_iterator_t iter;
|
||||
+ uint32_t inst_pkgcnt;
|
||||
+ uint32_t up_pkgcnt;
|
||||
+ uint32_t cf_pkgcnt;
|
||||
+ uint32_t rm_pkgcnt;
|
||||
+ uint32_t dl_pkgcnt;
|
||||
+};
|
||||
+
|
||||
/* from transaction.c */
|
||||
int install_new_pkg(struct xbps_handle *, const char *, bool);
|
||||
int update_pkg(struct xbps_handle *, const char *);
|
||||
@@ -52,6 +63,7 @@ int state_cb(const struct xbps_state_cb_data *, void *);
|
||||
|
||||
/* From util.c */
|
||||
void print_package_line(const char *, int, bool);
|
||||
+bool print_trans_colmode(struct transaction *, int);
|
||||
int get_maxcols(void);
|
||||
|
||||
#endif /* !_XBPS_INSTALL_DEFS_H_ */
|
||||
diff --git a/bin/xbps-install/transaction.c b/bin/xbps-install/transaction.c
|
||||
index efd964a..7280ee4 100644
|
||||
--- bin/xbps-install/transaction.c
|
||||
+++ bin/xbps-install/transaction.c
|
||||
@@ -36,17 +36,6 @@
|
||||
#include <xbps.h>
|
||||
#include "defs.h"
|
||||
|
||||
-struct transaction {
|
||||
- struct xbps_handle *xhp;
|
||||
- xbps_dictionary_t d;
|
||||
- xbps_object_iterator_t iter;
|
||||
- uint32_t inst_pkgcnt;
|
||||
- uint32_t up_pkgcnt;
|
||||
- uint32_t cf_pkgcnt;
|
||||
- uint32_t rm_pkgcnt;
|
||||
- uint32_t dl_pkgcnt;
|
||||
-};
|
||||
-
|
||||
static void
|
||||
print_array(xbps_array_t a)
|
||||
{
|
||||
@@ -128,49 +117,51 @@ show_transaction_sizes(struct transaction *trans, int cols)
|
||||
uint64_t dlsize = 0, instsize = 0, rmsize = 0, disk_free_size = 0;
|
||||
char size[8];
|
||||
|
||||
- /*
|
||||
- * Show the list of packages that will be downloaded, installed, updated,
|
||||
- * removed or configured.
|
||||
- */
|
||||
- xbps_dictionary_get_uint32(trans->d, "total-download-pkgs",
|
||||
- &trans->dl_pkgcnt);
|
||||
- if (trans->dl_pkgcnt) {
|
||||
- printf("%u package%s will be downloaded:\n",
|
||||
- trans->dl_pkgcnt, trans->dl_pkgcnt == 1 ? "" : "s");
|
||||
- show_package_list(trans, NULL, cols);
|
||||
- printf("\n");
|
||||
- }
|
||||
- xbps_dictionary_get_uint32(trans->d, "total-install-pkgs",
|
||||
- &trans->inst_pkgcnt);
|
||||
- if (trans->inst_pkgcnt) {
|
||||
- printf("%u package%s will be installed:\n",
|
||||
- trans->inst_pkgcnt, trans->inst_pkgcnt == 1 ? "" : "s");
|
||||
- show_package_list(trans, "install", cols);
|
||||
- printf("\n");
|
||||
- }
|
||||
- xbps_dictionary_get_uint32(trans->d, "total-update-pkgs",
|
||||
- &trans->up_pkgcnt);
|
||||
- if (trans->up_pkgcnt) {
|
||||
- printf("%u package%s will be updated:\n",
|
||||
- trans->up_pkgcnt, trans->up_pkgcnt == 1 ? "" : "s");
|
||||
- show_package_list(trans, "update", cols);
|
||||
- printf("\n");
|
||||
- }
|
||||
- xbps_dictionary_get_uint32(trans->d, "total-configure-pkgs",
|
||||
- &trans->cf_pkgcnt);
|
||||
- if (trans->cf_pkgcnt) {
|
||||
- printf("%u package%s will be configured:\n",
|
||||
- trans->cf_pkgcnt, trans->cf_pkgcnt == 1 ? "" : "s");
|
||||
- show_package_list(trans, "configure", cols);
|
||||
- printf("\n");
|
||||
- }
|
||||
- xbps_dictionary_get_uint32(trans->d, "total-remove-pkgs",
|
||||
- &trans->rm_pkgcnt);
|
||||
- if (trans->rm_pkgcnt) {
|
||||
- printf("%u package%s will be removed:\n",
|
||||
- trans->rm_pkgcnt, trans->rm_pkgcnt == 1 ? "" : "s");
|
||||
- show_package_list(trans, "remove", cols);
|
||||
- printf("\n");
|
||||
+ if (!print_trans_colmode(trans, cols)) {
|
||||
+ /*
|
||||
+ * Show the list of packages that will be downloaded, installed, updated,
|
||||
+ * removed or configured.
|
||||
+ */
|
||||
+ xbps_dictionary_get_uint32(trans->d, "total-download-pkgs",
|
||||
+ &trans->dl_pkgcnt);
|
||||
+ if (trans->dl_pkgcnt) {
|
||||
+ printf("%u package%s will be downloaded:\n",
|
||||
+ trans->dl_pkgcnt, trans->dl_pkgcnt == 1 ? "" : "s");
|
||||
+ show_package_list(trans, NULL, cols);
|
||||
+ printf("\n");
|
||||
+ }
|
||||
+ xbps_dictionary_get_uint32(trans->d, "total-install-pkgs",
|
||||
+ &trans->inst_pkgcnt);
|
||||
+ if (trans->inst_pkgcnt) {
|
||||
+ printf("%u package%s will be installed:\n",
|
||||
+ trans->inst_pkgcnt, trans->inst_pkgcnt == 1 ? "" : "s");
|
||||
+ show_package_list(trans, "install", cols);
|
||||
+ printf("\n");
|
||||
+ }
|
||||
+ xbps_dictionary_get_uint32(trans->d, "total-update-pkgs",
|
||||
+ &trans->up_pkgcnt);
|
||||
+ if (trans->up_pkgcnt) {
|
||||
+ printf("%u package%s will be updated:\n",
|
||||
+ trans->up_pkgcnt, trans->up_pkgcnt == 1 ? "" : "s");
|
||||
+ show_package_list(trans, "update", cols);
|
||||
+ printf("\n");
|
||||
+ }
|
||||
+ xbps_dictionary_get_uint32(trans->d, "total-configure-pkgs",
|
||||
+ &trans->cf_pkgcnt);
|
||||
+ if (trans->cf_pkgcnt) {
|
||||
+ printf("%u package%s will be configured:\n",
|
||||
+ trans->cf_pkgcnt, trans->cf_pkgcnt == 1 ? "" : "s");
|
||||
+ show_package_list(trans, "configure", cols);
|
||||
+ printf("\n");
|
||||
+ }
|
||||
+ xbps_dictionary_get_uint32(trans->d, "total-remove-pkgs",
|
||||
+ &trans->rm_pkgcnt);
|
||||
+ if (trans->rm_pkgcnt) {
|
||||
+ printf("%u package%s will be removed:\n",
|
||||
+ trans->rm_pkgcnt, trans->rm_pkgcnt == 1 ? "" : "s");
|
||||
+ show_package_list(trans, "remove", cols);
|
||||
+ printf("\n");
|
||||
+ }
|
||||
}
|
||||
/*
|
||||
* Show total download/installed/removed size for all required packages.
|
||||
diff --git a/bin/xbps-install/util.c b/bin/xbps-install/util.c
|
||||
index 9594877..3fb68a7 100644
|
||||
--- bin/xbps-install/util.c
|
||||
+++ bin/xbps-install/util.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/*-
|
||||
- * Copyright (c) 2008-2013 Juan Romero Pardines.
|
||||
+ * Copyright (c) 2008-2014 Juan Romero Pardines.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <sys/ioctl.h>
|
||||
+#include <assert.h>
|
||||
|
||||
#include <xbps.h>
|
||||
#include "defs.h"
|
||||
@@ -69,3 +70,109 @@ print_package_line(const char *str, int maxcols, bool reset)
|
||||
}
|
||||
printf("%s ", str);
|
||||
}
|
||||
+
|
||||
+static unsigned int
|
||||
+find_longest_pkgname(struct transaction *trans)
|
||||
+{
|
||||
+ xbps_object_t obj;
|
||||
+ const char *pkgver;
|
||||
+ char *pkgname;
|
||||
+ unsigned int len = 0, max = 0;
|
||||
+
|
||||
+ while ((obj = xbps_object_iterator_next(trans->iter)) != NULL) {
|
||||
+ xbps_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver);
|
||||
+ pkgname = xbps_pkg_name(pkgver);
|
||||
+ assert(pkgname);
|
||||
+ len = strlen(pkgname);
|
||||
+ free(pkgname);
|
||||
+ if (max == 0 || len > max)
|
||||
+ max = len;
|
||||
+ }
|
||||
+ xbps_object_iterator_reset(trans->iter);
|
||||
+ return max+1;
|
||||
+}
|
||||
+
|
||||
+bool
|
||||
+print_trans_colmode(struct transaction *trans, int cols)
|
||||
+{
|
||||
+ xbps_object_t obj;
|
||||
+ uint64_t dlsize = 0;
|
||||
+ char size[8];
|
||||
+ unsigned int x, blen, pnamelen;
|
||||
+ int hdrlen;
|
||||
+
|
||||
+ pnamelen = find_longest_pkgname(trans);
|
||||
+ /* header length */
|
||||
+ hdrlen = 4 + pnamelen + 48;
|
||||
+ if (cols <= hdrlen)
|
||||
+ return false;
|
||||
+
|
||||
+ printf("Name");
|
||||
+ for (x = 4; x < pnamelen; x++)
|
||||
+ printf(" ");
|
||||
+ printf("Action Version New version Download size\n");
|
||||
+
|
||||
+ while ((obj = xbps_object_iterator_next(trans->iter)) != NULL) {
|
||||
+ xbps_dictionary_t ipkgd;
|
||||
+ const char *pkgver, *ipkgver, *ver, *iver, *tract;
|
||||
+ char *pkgname;
|
||||
+ bool dload = false;
|
||||
+
|
||||
+ ver = iver = NULL;
|
||||
+
|
||||
+ xbps_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver);
|
||||
+ xbps_dictionary_get_cstring_nocopy(obj, "transaction", &tract);
|
||||
+ xbps_dictionary_get_uint64(obj, "filename-size", &dlsize);
|
||||
+ xbps_dictionary_get_bool(obj, "download", &dload);
|
||||
+
|
||||
+ pkgname = xbps_pkg_name(pkgver);
|
||||
+ assert(pkgname);
|
||||
+
|
||||
+ if ((strcmp(tract, "update") == 0) || strcmp(tract, "remove") == 0) {
|
||||
+ ipkgd = xbps_pkgdb_get_pkg(trans->xhp, pkgname);
|
||||
+ assert(ipkgd);
|
||||
+ xbps_dictionary_get_cstring_nocopy(ipkgd, "pkgver", &ipkgver);
|
||||
+ iver = xbps_pkg_version(ipkgver);
|
||||
+ }
|
||||
+ ver = xbps_pkg_version(pkgver);
|
||||
+
|
||||
+ /* print pkgname and some blanks */
|
||||
+ blen = pnamelen - strlen(pkgname);
|
||||
+ printf("%s", pkgname);
|
||||
+ for (x = 0; x < blen; x++)
|
||||
+ printf(" ");
|
||||
+
|
||||
+ /* print action */
|
||||
+ printf("%s ", tract);
|
||||
+ for (x = strlen(tract); x < 7; x++)
|
||||
+ printf(" ");
|
||||
+
|
||||
+ /* print installed version */
|
||||
+ if (iver == NULL)
|
||||
+ iver = "-";
|
||||
+
|
||||
+ /* print new version */
|
||||
+ printf("%s ", iver);
|
||||
+ for (x = strlen(iver); x < 14; x++)
|
||||
+ printf(" ");
|
||||
+
|
||||
+ if (strcmp(tract, "remove") == 0) {
|
||||
+ ver = "-";
|
||||
+ }
|
||||
+ if (dload)
|
||||
+ (void)xbps_humanize_number(size, (int64_t)dlsize);
|
||||
+ else {
|
||||
+ size[0] = '-';
|
||||
+ size[1] = '\0';
|
||||
+ }
|
||||
+ printf("%s ", ver);
|
||||
+ for (x = strlen(ver); x < 18; x++)
|
||||
+ printf(" ");
|
||||
+ /* print download size */
|
||||
+ printf("%s ", size);
|
||||
+ printf("\n");
|
||||
+ free(pkgname);
|
||||
+ }
|
||||
+ xbps_object_iterator_reset(trans->iter);
|
||||
+ return true;
|
||||
+}
|
||||
--
|
||||
2.1.3
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
From 59781f4e91b798d63ad38e0d43ef0c0c2fe5f34c Mon Sep 17 00:00:00 2001
|
||||
From: Juan RP <xtraeme@gmail.com>
|
||||
Date: Thu, 30 Oct 2014 11:25:37 +0100
|
||||
Subject: [PATCH 4/4] bin/xbps-install/fetch_cb.c: use STDOUT_FILENO.
|
||||
|
||||
---
|
||||
bin/xbps-install/fetch_cb.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/bin/xbps-install/fetch_cb.c b/bin/xbps-install/fetch_cb.c
|
||||
index fb1a069..8b715a9 100644
|
||||
--- bin/xbps-install/fetch_cb.c
|
||||
+++ bin/xbps-install/fetch_cb.c
|
||||
@@ -162,7 +162,7 @@ fetch_file_progress_cb(const struct xbps_fetch_cb_data *xfpd, void *cbdata)
|
||||
|
||||
if (xfpd->cb_start) {
|
||||
/* start transfer stats */
|
||||
- v_tty = isatty(STDERR_FILENO);
|
||||
+ v_tty = isatty(STDOUT_FILENO);
|
||||
get_time(&xfer->start);
|
||||
xfer->last.tv_sec = xfer->last.tv_usec = 0;
|
||||
} else if (xfpd->cb_update) {
|
||||
--
|
||||
2.1.3
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
From 42bbc601547b5342ddd5512e7b5e088284fe81c3 Mon Sep 17 00:00:00 2001
|
||||
From: Juan RP <xtraeme@gmail.com>
|
||||
Date: Wed, 5 Nov 2014 10:16:57 +0100
|
||||
Subject: [PATCH] xbps-install: fix cnt stats and align issues in the column
|
||||
output mode.
|
||||
|
||||
- The counter stats were not taken into account.
|
||||
- Align version/new version with pkgs that have long versions (chromium).
|
||||
---
|
||||
bin/xbps-install/util.c | 22 +++++++++++++++++-----
|
||||
1 file changed, 17 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/bin/xbps-install/util.c b/bin/xbps-install/util.c
|
||||
index 3fb68a7..e10bba1 100644
|
||||
--- bin/xbps-install/util.c
|
||||
+++ bin/xbps-install/util.c
|
||||
@@ -103,14 +103,14 @@ print_trans_colmode(struct transaction *trans, int cols)
|
||||
|
||||
pnamelen = find_longest_pkgname(trans);
|
||||
/* header length */
|
||||
- hdrlen = 4 + pnamelen + 48;
|
||||
+ hdrlen = 4 + pnamelen + 60;
|
||||
if (cols <= hdrlen)
|
||||
return false;
|
||||
|
||||
printf("Name");
|
||||
for (x = 4; x < pnamelen; x++)
|
||||
printf(" ");
|
||||
- printf("Action Version New version Download size\n");
|
||||
+ printf("Action Version New version Download size\n");
|
||||
|
||||
while ((obj = xbps_object_iterator_next(trans->iter)) != NULL) {
|
||||
xbps_dictionary_t ipkgd;
|
||||
@@ -128,6 +128,18 @@ print_trans_colmode(struct transaction *trans, int cols)
|
||||
pkgname = xbps_pkg_name(pkgver);
|
||||
assert(pkgname);
|
||||
|
||||
+ if (strcmp(tract, "install") == 0) {
|
||||
+ trans->inst_pkgcnt++;
|
||||
+ } else if (strcmp(tract, "update") == 0) {
|
||||
+ trans->up_pkgcnt++;
|
||||
+ } else if (strcmp(tract, "remove") == 0) {
|
||||
+ trans->rm_pkgcnt++;
|
||||
+ } else if (strcmp(tract, "configure") == 0) {
|
||||
+ trans->cf_pkgcnt++;
|
||||
+ }
|
||||
+ if (dload) {
|
||||
+ trans->dl_pkgcnt++;
|
||||
+ }
|
||||
if ((strcmp(tract, "update") == 0) || strcmp(tract, "remove") == 0) {
|
||||
ipkgd = xbps_pkgdb_get_pkg(trans->xhp, pkgname);
|
||||
assert(ipkgd);
|
||||
@@ -144,7 +156,7 @@ print_trans_colmode(struct transaction *trans, int cols)
|
||||
|
||||
/* print action */
|
||||
printf("%s ", tract);
|
||||
- for (x = strlen(tract); x < 7; x++)
|
||||
+ for (x = strlen(tract); x < 9; x++)
|
||||
printf(" ");
|
||||
|
||||
/* print installed version */
|
||||
@@ -153,7 +165,7 @@ print_trans_colmode(struct transaction *trans, int cols)
|
||||
|
||||
/* print new version */
|
||||
printf("%s ", iver);
|
||||
- for (x = strlen(iver); x < 14; x++)
|
||||
+ for (x = strlen(iver); x < 17; x++)
|
||||
printf(" ");
|
||||
|
||||
if (strcmp(tract, "remove") == 0) {
|
||||
@@ -166,7 +178,7 @@ print_trans_colmode(struct transaction *trans, int cols)
|
||||
size[1] = '\0';
|
||||
}
|
||||
printf("%s ", ver);
|
||||
- for (x = strlen(ver); x < 18; x++)
|
||||
+ for (x = strlen(ver); x < 22; x++)
|
||||
printf(" ");
|
||||
/* print download size */
|
||||
printf("%s ", size);
|
||||
--
|
||||
2.1.3
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
From 578c3add0c253fe122703783392a5cc4d6fa0e6b Mon Sep 17 00:00:00 2001
|
||||
From: Juan RP <xtraeme@gmail.com>
|
||||
Date: Wed, 5 Nov 2014 15:57:21 +0100
|
||||
Subject: [PATCH] xbps-uchroot: mount sys/dev recursively to access to /dev/pts
|
||||
(thanks chris2).
|
||||
|
||||
---
|
||||
bin/xbps-uchroot/main.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/bin/xbps-uchroot/main.c b/bin/xbps-uchroot/main.c
|
||||
index e03b4ea..de87308 100644
|
||||
--- bin/xbps-uchroot/main.c
|
||||
+++ bin/xbps-uchroot/main.c
|
||||
@@ -122,7 +122,7 @@ bindmount(uid_t ruid, const char *chrootdir, const char *dir, const char *dest)
|
||||
|
||||
if (fsuid_chdir(ruid, dir) == -1)
|
||||
die("Couldn't chdir to %s", dir);
|
||||
- if (mount(".", mountdir, NULL, MS_BIND|MS_PRIVATE, NULL) == -1)
|
||||
+ if (mount(".", mountdir, NULL, MS_BIND|MS_REC|MS_PRIVATE, NULL) == -1)
|
||||
die("Failed to bind mount %s at %s", dir, mountdir);
|
||||
}
|
||||
|
||||
--
|
||||
2.1.3
|
||||
|
|
@ -1,23 +1,24 @@
|
|||
# Template file for 'xbps'
|
||||
pkgname=xbps
|
||||
version=0.41
|
||||
revision=9
|
||||
version=0.42
|
||||
revision=1
|
||||
bootstrap=yes
|
||||
build_style=configure
|
||||
short_desc="The XBPS package system utilities"
|
||||
maintainer="Juan RP <xtraeme@gmail.com>"
|
||||
homepage="http://www.voidlinux.eu/xbps"
|
||||
license="Simplified BSD"
|
||||
homepage="https://github.com/voidlinux/xbps"
|
||||
license="2-clause-BSD"
|
||||
distfiles="https://github.com/voidlinux/xbps/archive/${version}.tar.gz"
|
||||
checksum=22a8ae9b81ffb4727c9500c428bd5e70085b1e8605f82fa7bfa367c1cbc65fbc
|
||||
|
||||
makedepends="zlib-devel libressl-devel libarchive-devel>=3.1.2"
|
||||
depends="xbps-triggers>=0.75"
|
||||
conf_files="/etc/xbps/xbps.conf"
|
||||
|
||||
if [ -z "$CHROOT_READY" ]; then
|
||||
CFLAGS+=" -idirafter ${XBPS_MASTERDIR}/usr/include"
|
||||
LDFLAGS+=" -L${XBPS_MASTERDIR}/usr/lib"
|
||||
else
|
||||
hostmakedepends="pkg-config git"
|
||||
hostmakedepends="pkg-config"
|
||||
makedepends+=" atf-devel>=0.21"
|
||||
|
||||
xbps-tests_package() {
|
||||
|
@ -34,9 +35,6 @@ if [ "$XBPS_TARGET_MACHINE" = "i686-musl" ]; then
|
|||
CFLAGS+=" -fno-stack-protector"
|
||||
fi
|
||||
|
||||
do_fetch() {
|
||||
git clone -b${version} git://github.com/voidlinux/xbps ${pkgname}-${version}
|
||||
}
|
||||
do_configure() {
|
||||
if [ "$CHROOT_READY" ]; then
|
||||
_args="--enable-tests"
|
||||
|
|
Loading…
Reference in a new issue