Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Merge branch 'master' of etoilebsd.net:pkgng
jlaffaye committed 15 years ago
commit 10ed97b37b79353b4c0a4d368e4c6d9b7d33883b
parent ca61697
5 files changed +10 -14
modified README
@@ -5,7 +5,7 @@ installed packages, to deal with remote repositories, manage packages: creation,
installation gathering informations, registering new ports.

features supported are or will be :
-
- smooth integration with bsd.port.mk (see ports/bsd.port.mk.patch) which allow
+
- smooth integration with bsd.port.mk (including bsd.pkg.mk line 2486) which allow
  to have a bsd.port.mk which deal with both pkg_install and pkgng.
- the register command can analyse elf files when registering a new port to
  discover forgotten dependency if necessary.
modified docs/TODO
@@ -5,8 +5,6 @@ ALPHA
  and later to dowload packages from repo, and even to download the repo.db.
that means a function with a callback to display progress.
- pkg version (comparison against ports tree and INDEX)
-
- bsd.pkgng.mk to easier testing
-
- pkg register (add -F option to force registering a package already registred)

BETA1
- repo
modified pkg/info.c
@@ -239,7 +239,7 @@ exec_info(int argc, char **argv)

		while ((ret = pkgdb_it_next(it, &pkg, query_flags)) == EPKG_OK) {
			gotone = true;
-
			if (pkgversion != NULL) {
+
			if (pkgversion != NULL && pkgversion[0] != '0') { /* FIXME special workaround for >=0 */
				switch (pkg_version_cmp(pkg_get(pkg, PKG_VERSION), pkgversion)) {
					case -1:
						if (sign != LT && sign != LE) {
modified pkg/register.c
@@ -198,6 +198,9 @@ exec_register(int argc, char **argv)
		retcode = 1;
	}

+
	if (pkg_get(pkg, PKG_MESSAGE) != NULL)
+
		printf("%s\n", pkg_get(pkg, PKG_MESSAGE));
+

	pkgdb_close(db);
	pkg_free(pkg);

modified ports/bsd.pkgng.mk
@@ -1,6 +1,7 @@
PKG_CMD=		/usr/sbin/pkg register
PKG_DELETE=		/usr/sbin/pkg delete
PKG_INFO=		/usr/sbin/pkg info
+
PKG_VERSION=		/usr/sbin/pkg version

PKGPREINSTALL?=		${PKGDIR}/pkg-pre-install
PKGPOSTINSTALL?=	${PKGDIR}/pkg-post-install
@@ -27,9 +28,6 @@ PKG_ARGS= -v -c -${COMMENT:Q} -d ${DESCR} -f ${TMPPLIST} -p ${PREFIX} -P "`cd $
.if !defined(NO_MTREE)
PKG_ARGS+=		-m ${MTREE_FILE}
.endif
-
.if defined(PKGORIGIN)
-
PKG_ARGS+=		-o ${PKGORIGIN}
-
.endif
.if defined(CONFLICTS) && !defined(DISABLE_CONFLICTS)
PKG_ARGS+=		-C "${CONFLICTS}"
.endif
@@ -37,6 +35,7 @@ PKG_ARGS+= -C "${CONFLICTS}"
PKG_ARGS+=		-C "${CONFLICTS_INSTALL}"
.endif
PKG_ARGS+= -n ${PKGNAME}
+
PKG_ARGS+= -o ${PKGORIGIN}
.if defined(MAINTAINER)
PKG_ARGS+= -r ${MAINTAINER}
.endif
@@ -82,11 +81,7 @@ PKG_ARGS+= -s "${PKGSCRIPTS}"
fake-pkg:
.if !defined(NO_PKG_REGISTER)
	@${ECHO_MSG} "===>   Registering installation for ${PKGNAME}"
-
.if defined(FORCE_PKG_REGISTER)
-
	@${PKG_CMD} ${PKG_ARGS} -F
-
.else
	@${PKG_CMD} ${PKG_ARGS}
-
.endif
.else
	@${DO_NADA}
.endif
@@ -217,8 +212,8 @@ do-package: ${TMPPLIST}
check-already-installed:
.if !defined(NO_PKG_REGISTER) && !defined(FORCE_PKG_REGISTER)
		@${ECHO_MSG} "===>  Checking if ${PKGORIGIN} already installed"; \
-
		pkgname=`${PKG_INFO} -q ${PKGORIGIN}`; \
-
		if [ -n $${pkgname} ]; then \
+
		pkgname=`${PKG_INFO} -q -O ${PKGORIGIN}`; \
+
		if [ -n "$${pkgname}" ]; then \
			v=`${PKG_VERSION} -t $${pkgname} ${PKGNAME}`; \
			if [ "w$${v}" = "x<" ]; then \
				${ECHO_CMD} "===>   An older version of ${PKGORIGIN} is already installed ($${found_package})"; \
@@ -244,7 +239,7 @@ deinstall:
	@if ${PKG_INFO} -e ${PKGORIGIN}; then \
		p=`${PKG_INFO} -q ${PKGORIGIN}`; \
		${ECHO_MSG} "===>   Deinstalling $${p}"; \
-
		${PKG_DELETE} -f ${PKGORIGIN}; \
+
		${PKG_DELETE} -f ${PKGORIGIN} ; \
	else \
		${ECHO_MSG} "===>   ${PKGBASE} not installed, skipping"; \
	fi