Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Display repo priority in pkg -vv output Add new pkg_repo_priority() accessor function Some whitespace cleanup.
Matthew Seaman committed 11 years ago
commit 72000689fe0bbc72b3f0d07dca9131e23210c255
parent ddf795a
5 files changed +17 -7
modified libpkg/libpkg.ver
@@ -119,6 +119,7 @@ global:
	pkg_repo_key;
	pkg_repo_mirror_type;
	pkg_repo_name;
+
	pkg_repo_priority;
	pkg_repo_signature_type;
	pkg_repo_url;
	pkg_repos;
modified libpkg/pkg.h.in
@@ -1462,6 +1462,7 @@ const char *pkg_repo_fingerprints(struct pkg_repo *r);
signature_t pkg_repo_signature_type(struct pkg_repo *r);
bool pkg_repo_enabled(struct pkg_repo *r);
mirror_t pkg_repo_mirror_type(struct pkg_repo *r);
+
unsigned pkg_repo_priority(struct pkg_repo *r);
struct pkg_repo *pkg_repo_find(const char *name);

/**
modified libpkg/pkg_config.c
@@ -1207,6 +1207,11 @@ pkg_repo_mirror_type(struct pkg_repo *r)
	return (r->mirror_type);
}

+
unsigned int
+
pkg_repo_priority(struct pkg_repo *r)
+
{
+
	return (r->priority);
+
}

/* Locate the repo by the file basename / database name */
struct pkg_repo *
modified libpkg/pkg_repo.c
@@ -2,7 +2,7 @@
 * Copyright (c) 2011-2013 Baptiste Daroussin <bapt@FreeBSD.org>
 * Copyright (c) 2011-2012 Julien Laffaye <jlaffaye@FreeBSD.org>
 * Copyright (c) 2011-2012 Marin Atanasov Nikolov <dnaeon@gmail.com>
-
 * Copyright (c) 2012-2013 Matthew Seaman <matthew@FreeBSD.org>
+
 * Copyright (c) 2012-2015 Matthew Seaman <matthew@FreeBSD.org>
 * Copyright (c) 2014 Vsevolod Stakhov <vsevolod@FreeBSD.org>
 *
 * All rights reserved.
modified src/main.c
@@ -3,7 +3,7 @@
 * Copyright (c) 2011-2012 Julien Laffaye <jlaffaye@FreeBSD.org>
 * Copyright (c) 2011 Will Andrews <will@FreeBSD.org>
 * Copyright (c) 2011-2012 Marin Atanasov Nikolov <dnaeon@gmail.com>
-
 * Copyright (c) 2014 Matthew Seaman <matthew@FreeBSD.org>
+
 * Copyright (c) 2014-2015 Matthew Seaman <matthew@FreeBSD.org>
 * Copyright (c) 2014 Vsevolod Stakhov <vsevolod@FreeBSD.org>
 * All rights reserved.
 *
@@ -340,10 +340,13 @@ show_repository_info(void)
			break;
		}

-
		printf("  %s: { \n    %-16s: \"%s\",\n    %-16s: %s",
+
		printf("  %s: { \n    %-16s: \"%s\",\n    %-16s: %s,\n"
+
		       "    %-16s: %u",
		    pkg_repo_name(repo),
                    "url", pkg_repo_url(repo),
-
		    "enabled", pkg_repo_enabled(repo) ? "yes" : "no");
+
		    "enabled", pkg_repo_enabled(repo) ? "yes" : "no",
+
		    "priority", pkg_repo_priority(repo));
+

		if (pkg_repo_mirror_type(repo) != NOMIRROR)
			printf(",\n    %-16s: \"%s\"",
			    "mirror_type", mirror);
@@ -374,7 +377,7 @@ show_version_info(int version)
	printf("%s\n", pkg_config_dump());
	show_plugin_info();
	show_repository_info();
-
	
+

	exit(EX_OK);
	/* NOTREACHED */
}
@@ -493,7 +496,7 @@ expand_aliases(int argc, char ***argv)
	char			**oldargv = *argv;
	char			**newargv;
	char			 *args;
-
	int			  newargc; 
+
	int			  newargc;
	int			  spaces;
	int			  i;
	size_t			  veclen;
@@ -516,7 +519,7 @@ expand_aliases(int argc, char ***argv)
	 * counting the number of whitespace characters in it. This
	 * will be at minimum one less than the final argc. We'll be
	 * consuming one of the orginal argv, so that balances
-
	 * out. */ 
+
	 * out. */

	spaces = pkg_utils_count_spaces(alias_value);
	arglen = strlen(alias_value) + 1;