Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Add mirror_pkg function to repo ops.
Vsevolod Stakhov committed 11 years ago
commit dd519bfe763d225f06b09e4a533ab0717e771abf
parent 18dfc30
3 files changed +5 -0
modified libpkg/private/pkg.h
@@ -386,6 +386,8 @@ struct pkg_repo_ops {
	void (*get_cached_name)(struct pkg_repo *, struct pkg *,
					char *dest, size_t destlen);
	int (*fetch_pkg)(struct pkg_repo *, struct pkg *);
+
	int (*mirror_pkg)(struct pkg_repo *repo, struct pkg *pkg,
+
		const char *destdir);
};

struct pkg_repo {
modified libpkg/repo/binary/binary.c
@@ -36,6 +36,7 @@ struct pkg_repo_ops pkg_repo_binary_ops = {
	.shlib_required = pkg_repo_binary_shlib_require,
	.search = pkg_repo_binary_search,
	.fetch_pkg = pkg_repo_binary_fetch,
+
	.mirror_pkg = pkg_repo_binary_mirror,
	.get_cached_name = pkg_repo_binary_get_cached_name,
	.ensure_loaded = pkg_repo_binary_ensure_loaded,
	.stat = pkg_repo_binary_stat
modified libpkg/repo/binary/binary.h
@@ -55,5 +55,7 @@ int64_t pkg_repo_binary_stat(struct pkg_repo *repo, pkg_stats_t type);
int pkg_repo_binary_fetch(struct pkg_repo *repo, struct pkg *pkg);
void pkg_repo_binary_get_cached_name(struct pkg_repo *repo, struct pkg *pkg,
	char *dest, size_t destlen);
+
int pkg_repo_binary_mirror(struct pkg_repo *repo, struct pkg *pkg,
+
	const char *destdir);

#endif /* BINARY_H_ */