Revert "ports-mgmt/pkg: partially sync with upstream"

This reverts commit 51e320c8a6.
This reverts commit 3d9e862747.
This commit is contained in:
Franco Fichtner 2020-06-29 23:15:54 +02:00
parent df41173dd6
commit 4a36906abd
9 changed files with 68 additions and 50 deletions

View File

@ -104,7 +104,6 @@ for stage in INSTALL DEINSTALL UPGRADE; do
output=${dp_METADIR}/+${prepost:+${prepost}_}${stage}
for input in ${files}; do
[ -f "${input}" ] && cat ${input} >> ${output}
[ -f "${input}.lua" ] && cp ${input}.lua ${dp_METADIR}
done
done
done

View File

@ -1047,7 +1047,7 @@ _FLAVOR:= ${FLAVOR}
.if !defined(PORTS_FEATURES) && empty(${PORTS_FEATURES:MFLAVORS})
PORTS_FEATURES+= FLAVORS
.endif
MINIMAL_PKG_VERSION= 1.13.0
MINIMAL_PKG_VERSION= 1.6.0
_PORTS_DIRECTORIES+= ${PKG_DBDIR} ${PREFIX} ${WRKDIR} ${EXTRACT_WRKDIR} \
${STAGEDIR}${PREFIX} ${WRKDIR}/pkg ${BINARY_LINKDIR}

View File

@ -1,9 +1,9 @@
# $FreeBSD$
PORTNAME= pkg
DISTVERSION= 1.14.4
PORTREVISION= 1
DISTVERSION= 1.12.0
_PKG_VERSION= ${DISTVERSION}
PORTREVISION= 1
CATEGORIES= ports-mgmt
#MASTER_SITES= \
# http://files.etoilebsd.net/${PORTNAME}/ \
@ -18,7 +18,7 @@ LICENSE= BSD2CLAUSE
USE_GITHUB= yes
GH_ACCOUNT= freebsd
USE_LDCONFIG= ${PREFIX}/lib/compat/pkg
USE_LDCONFIG= yes
HAS_CONFIGURE= yes
PORTDOCS= NEWS
PORTSCOUT= ignore:1
@ -27,7 +27,7 @@ CONFIGURE_ENV= CC_FOR_BUILD="${CC}"
USE_HARDENING= pie:off
# Use a submake as 'deinstall install' needs to reevaluate PKG_REGISTER
# Use a submake as 'deinstall install' needs to reevaluate PKG_CMD
# so that pkg-static is used from the wrkdir
USE_SUBMAKE= yes
CFLAGS+= -Wno-error
@ -74,13 +74,6 @@ pre-everything::
.endif
.endif
.if !exists(/usr/libdata/pkgconfig/liblzma.pc)
LIBLZMA_LIBS= -llzma
.else
LIBLZMA_PC!= ${EGREP} ^Libs /usr/libdata/pkgconfig/liblzma.pc
LIBLZMA_LIBS= ${LIBLZMA_PC:M-l*}
.endif
#define PKG_DEPENDS to nothing to avoid infinite loop looking for pkg :)
PKG_DEPENDS=
.undef INSTALLS_DEPENDS
@ -91,13 +84,6 @@ PKG_DEPENDS=
PKG_BIN= ${WRKSRC}/src/pkg-static
.endif
post-patch:
${REINPLACE_CMD} -e "s|-llzma|${LIBLZMA_LIBS}|g" ${WRKSRC}/auto.def \
${WRKSRC}/src/Makefile.autosetup ${WRKSRC}/tests/Makefile.autosetup
post-install:
@${MKDIR} ${STAGEDIR}${PREFIX}/lib/compat/pkg
post-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/NEWS ${STAGEDIR}${DOCSDIR}/NEWS

View File

@ -1,3 +1,3 @@
TIMESTAMP = 1588145385
SHA256 (freebsd-pkg-1.14.4_GH0.tar.gz) = 5e43bbb6ff9ead6a7aaa0181f6bbe1a94d9f1d751c5cafb7c6d8cde961359a42
SIZE (freebsd-pkg-1.14.4_GH0.tar.gz) = 3406437
TIMESTAMP = 1568790737
SHA256 (freebsd-pkg-1.12.0_GH0.tar.gz) = 53141c4833a9776d916fb31eff346b8877e687d54edaec59b8472b71f62ec165
SIZE (freebsd-pkg-1.12.0_GH0.tar.gz) = 3867210

View File

@ -0,0 +1,31 @@
diff --git a/external/libfetch/fetch.c b/external/libfetch/fetch.c
index 47c03a79..df5d5547 100644
--- external/libfetch/fetch.c
+++ external/libfetch/fetch.c
@@ -332,6 +332,8 @@ fetch_pctdecode(char *dst, const char *src, size_t dlen)
}
if (dlen-- > 0)
*dst++ = c;
+ else
+ return (NULL);
}
return (s);
}
@@ -381,11 +383,15 @@ fetchParseURL(const char *URL)
if (p && *p == '@') {
/* username */
q = fetch_pctdecode(u->user, URL, URL_USERLEN);
+ if (q == NULL)
+ goto ouch;
/* password */
- if (*q == ':')
+ if (*q == ':') {
q = fetch_pctdecode(u->pwd, q + 1, URL_PWDLEN);
-
+ if (q == NULL)
+ goto ouch;
+ }
p++;
} else {
p = URL;

View File

@ -1,11 +0,0 @@
--- libpkg/lua_scripts.c.orig 2020-06-04 01:54:38 UTC
+++ libpkg/lua_scripts.c
@@ -51,6 +51,8 @@
#include "private/pkg.h"
#include "private/event.h"
+#undef PROC_REAP_KILL /* OPNsense patch */
+
extern char **environ;
static lua_CFunction

View File

@ -1,15 +1,24 @@
--- libpkg/scripts.c.orig 2020-04-29 07:28:26 UTC
--- libpkg/scripts.c.orig 2019-09-18 07:11:10 UTC
+++ libpkg/scripts.c
@@ -48,6 +48,8 @@
#include "private/pkg.h"
#include "private/event.h"
@@ -68,7 +68,7 @@ pkg_script_run(struct pkg * const pkg, p
ssize_t bytes_written;
size_t script_cmd_len;
long argmax;
-#ifdef PROC_REAP_KILL
+#ifdef PROC_REAP_KILL_XXX
bool do_reap;
pid_t mypid;
struct procctl_reaper_status info;
@@ -103,7 +103,7 @@ pkg_script_run(struct pkg * const pkg, p
+#undef PROC_REAP_KILL /* OPNsense patch */
+
extern char **environ;
assert(i < sizeof(map) / sizeof(map[0]));
int
@@ -277,7 +279,6 @@ pkg_script_run(struct pkg * const pkg, p
-#ifdef PROC_REAP_KILL
+#ifdef PROC_REAP_KILL_XXX
mypid = getpid();
do_reap = procctl(P_PID, mypid, PROC_REAP_ACQUIRE, NULL) == 0;
#endif
@@ -218,7 +218,6 @@ pkg_script_run(struct pkg * const pkg, p
exit(0);
pkg_emit_error("%s script failed", map[i].arg);
@ -17,3 +26,12 @@
goto cleanup;
}
}
@@ -232,7 +231,7 @@ cleanup:
if (stdin_pipe[1] != -1)
close(stdin_pipe[1]);
-#ifdef PROC_REAP_KILL
+#ifdef PROC_REAP_KILL_XXX
/*
* If the prior PROCCTL_REAP_ACQUIRE call failed, the kernel
* probably doesn't support this, so don't try.

View File

@ -1,6 +1,6 @@
--- libpkg/utils.c.orig 2020-04-29 07:28:26 UTC
--- libpkg/utils.c.orig 2019-09-18 07:11:10 UTC
+++ libpkg/utils.c
@@ -351,7 +351,7 @@ is_valid_abi(const char *arch, bool emit
@@ -350,7 +350,7 @@ is_valid_abi(const char *arch, bool emit
bool
is_valid_os_version(struct pkg *pkg)
{

View File

@ -10,13 +10,9 @@ lib/libpkg.a
lib/libpkg.so
lib/libpkg.so.4
libdata/pkgconfig/pkg.pc
man/man3/pkg_create.3.gz
man/man3/pkg_printf.3.gz
man/man3/pkg_repos.3.gz
man/man5/pkg-repository.5.gz
man/man5/pkg-keywords.5.gz
man/man5/pkg-lua-script.5.gz
man/man5/pkg-script.5.gz
man/man5/pkg.conf.5.gz
man/man8/pkg-add.8.gz
man/man8/pkg-alias.8.gz
@ -55,4 +51,3 @@ man/man8/pkg.8.gz
sbin/pkg
sbin/pkg-static
share/zsh/site-functions/_pkg
@dir lib/compat/pkg