diff --git a/devel/git-cinnabar/Makefile b/devel/git-cinnabar/Makefile index 87c3c94d9704..9351245fefc4 100644 --- a/devel/git-cinnabar/Makefile +++ b/devel/git-cinnabar/Makefile @@ -1,50 +1,46 @@ PORTNAME= git-cinnabar -DISTVERSION= 0.5.7 -PORTREVISION= 5 +DISTVERSION= 0.5.8 CATEGORIES= devel -PATCH_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/ -PATCHFILES+= 57f8d0171423.patch:-p1 # https://github.com/glandium/git-cinnabar/pull/277 - MAINTAINER= jbeich@FreeBSD.org COMMENT= Git remote helper to interact with Mercurial repositories LICENSE= GPLv2 BUILD_DEPENDS= ${NONEXISTENT}:devel/git:configure RUN_DEPENDS= git:devel/git USE_GITHUB= yes GH_ACCOUNT= glandium USES= gmake python:3.6+,run shebangfix TARGET_ORDER_OVERRIDE= 510:fix-shebang # after do-patch SHEBANG_FILES= ${PORTNAME} git-remote-hg ALL_TARGET= ${PORTNAME}-helper MAKE_ENV= ${:!${MAKE} -V MAKE_ENV -C ${.CURDIR:H}/git!} MAKE_ARGS= SUBMODULE_STATUS=dummy ${:!${MAKE} -V MAKE_ARGS -C ${.CURDIR:H}/git!} CFLAGS+= -ffunction-sections -fdata-sections LDFLAGS+= -Wl,--gc-sections .export CPPFLAGS CFLAGS CXXFLAGS LDFLAGS # :configure DATADIR= ${PREFIX}/libexec/git-core PORTDATA= * PORTDOCS= README.md OPTIONS_DEFINE= DOCS post-configure: @${TAR} cf - -C$$(${MAKE} -V WRKSRC -C ${PORTSDIR}/devel/git) . | \ ${TAR} xof - -C${WRKSRC}/git-core do-install: ${MKDIR} ${STAGEDIR}${DATADIR} ${INSTALL_SCRIPT} ${WRKSRC}/${PORTNAME} ${WRKSRC}/git-remote-hg \ ${STAGEDIR}${DATADIR} ${INSTALL_PROGRAM} ${WRKSRC}/git-core/${PORTNAME}-helper \ ${STAGEDIR}${DATADIR} (cd ${WRKSRC} && ${COPYTREE_SHARE} "${PORTNAME:S/git-//}" \ ${STAGEDIR}${DATADIR}/pythonlib) (cd ${WRKSRC} && ${COPYTREE_SHARE} \ "${PORTDOCS}" ${STAGEDIR}${DOCSDIR}) .include diff --git a/devel/git-cinnabar/distinfo b/devel/git-cinnabar/distinfo index a1731dd1e5b0..d1152f2ed834 100644 --- a/devel/git-cinnabar/distinfo +++ b/devel/git-cinnabar/distinfo @@ -1,5 +1,5 @@ -TIMESTAMP = 1617227922 -SHA256 (glandium-git-cinnabar-0.5.7_GH0.tar.gz) = 1f30b79b89b421ba33e47f00a8301da5b7533e10cc6314c4febd23ad6ed4b17b -SIZE (glandium-git-cinnabar-0.5.7_GH0.tar.gz) = 176569 +TIMESTAMP = 1637356993 +SHA256 (glandium-git-cinnabar-0.5.8_GH0.tar.gz) = 7971c2ae17d2b919f915efab35e3aba583b951d53ca2bc6ebf69bbd0c22f1067 +SIZE (glandium-git-cinnabar-0.5.8_GH0.tar.gz) = 181517 SHA256 (57f8d0171423.patch) = b3fd28c5e1604716a04faecc58e6cca3dc26601cbee480a317a821ed41bd5643 SIZE (57f8d0171423.patch) = 1266 diff --git a/devel/git-cinnabar/files/patch-git-2.32 b/devel/git-cinnabar/files/patch-git-2.32 deleted file mode 100644 index fca900005564..000000000000 --- a/devel/git-cinnabar/files/patch-git-2.32 +++ /dev/null @@ -1,117 +0,0 @@ -https://github.com/glandium/git-cinnabar/commit/1ffb93f88fea - ---- helper/GIT-VERSION.mk.orig 2021-03-31 21:58:42 UTC -+++ helper/GIT-VERSION.mk -@@ -1,2 +1,2 @@ --GIT_VERSION ?= v2.31.1 -+GIT_VERSION ?= v2.32.0 - WINDOWS_GIT_VERSION ?= $(GIT_VERSION).windows.1 ---- helper/cinnabar-fast-import.c.orig 2021-03-31 21:58:42 UTC -+++ helper/cinnabar-fast-import.c -@@ -106,6 +106,7 @@ void *get_object_entry(const unsigned char *sha1) - { - struct object_id oid; - hashcpy(oid.hash, sha1); -+ oid.algo = GIT_HASH_SHA1; - return find_object(&oid); - } - -@@ -220,7 +221,7 @@ static void end_packfile() - const struct object_id empty_tree = { { - 0x4b, 0x82, 0x5d, 0xc6, 0x42, 0xcb, 0x6e, 0xb9, 0xa0, 0x60, - 0xe5, 0x4b, 0xf8, 0xd6, 0x92, 0x88, 0xfb, 0xee, 0x49, 0x04, --} }; -+}, GIT_HASH_SHA1 }; - - /* Override fast-import.c's parse_mark_ref to allow a syntax for - * mercurial sha1s, resolved through hg2git. Hack: it uses a fixed -@@ -1285,7 +1286,7 @@ void store_git_commit(struct strbuf *commit_buf, struc - const struct object_id empty_blob = { { - 0xe6, 0x9d, 0xe2, 0x9b, 0xb2, 0xd1, 0xd6, 0x43, 0x4b, 0x8b, - 0x29, 0xae, 0x77, 0x5a, 0xd8, 0xc2, 0xe4, 0x8c, 0x53, 0x91, --} }; -+}, GIT_HASH_SHA1 }; - - const struct object_id *ensure_empty_blob() { - struct object_entry *oe = find_object((struct object_id *)&empty_blob); ---- helper/cinnabar-helper.c.orig 2021-03-31 21:58:42 UTC -+++ helper/cinnabar-helper.c -@@ -253,8 +253,7 @@ struct ls_tree_context { - }; - - static int fill_ls_tree(const struct object_id *oid, struct strbuf *base, -- const char *pathname, unsigned mode, int stage, -- void *context) -+ const char *pathname, unsigned mode, void *context) - { - struct ls_tree_context *ctx = context; - struct strbuf *buf = &ctx->buf; -@@ -299,8 +298,7 @@ static void do_ls_tree(struct string_list *args) - goto not_found; - - memset(&match_all, 0, sizeof(match_all)); -- read_tree_recursive(the_repository, tree, "", 0, 0, &match_all, -- fill_ls_tree, &ctx); -+ read_tree(the_repository, tree, &match_all, fill_ls_tree, &ctx); - send_buffer(&ctx.buf); - strbuf_release(&ctx.buf); - ---- helper/cinnabar-notes.c.orig 2021-03-31 21:58:42 UTC -+++ helper/cinnabar-notes.c -@@ -145,7 +145,8 @@ int cinnabar_remove_note(struct cinnabar_notes_tree *t - if (!result) { - struct object_id oid; - hashcpy(oid.hash, object_sha1); -- add_note(&t->additions, &oid, &null_oid, NULL); -+ oid.algo = GIT_HASH_SHA1; -+ add_note(&t->additions, &oid, null_oid(), NULL); - } - return result && result2; - } ---- helper/csum-file.c.patch.orig 2021-03-31 21:58:42 UTC -+++ helper/csum-file.c.patch -@@ -1,5 +1,5 @@ - diff --git a/csum-file.c b/csum-file.c --index 0f35fa5ee4..cee7bd5aeb 100644 -+index 7510950fa3..19d02e3a63 100644 - --- a/csum-file.c - +++ b/csum-file.c - @@ -86,7 +86,7 @@ int finalize_hashfile(struct hashfile *f, unsigned char *result, unsigned int fl -@@ -10,4 +10,4 @@ index 0f35fa5ee4..cee7bd5aeb 100644 - +void real_hashwrite(struct hashfile *f, const void *buf, unsigned int count) - { - while (count) { -- unsigned offset = f->offset; -+ unsigned left = sizeof(f->buffer) - f->offset; ---- helper/hg-data.h.orig 2021-03-31 21:58:42 UTC -+++ helper/hg-data.h -@@ -43,11 +43,13 @@ static inline void hg_oidcpy2git(struct object_id *dst - { - memcpy(dst->hash, src->hash, 20); - memset(dst->hash + 20, 0, the_hash_algo->rawsz - 20); -+ dst->algo = GIT_HASH_SHA1; - } - - static inline void oidcpy2hg(struct hg_object_id *dst, - const struct object_id *src) - { -+ assert(src->algo == GIT_HASH_SHA1); - memcpy(dst->hash, src->hash, 20); - } - ---- helper/tree-walk.c.patch.orig 2021-03-31 21:58:42 UTC -+++ helper/tree-walk.c.patch -@@ -1,5 +1,5 @@ - diff --git a/tree-walk.c b/tree-walk.c --index d5a8e096a6..cace4fd6cf 100644 -+index 3a94959d64..70558d2964 100644 - --- a/tree-walk.c - +++ b/tree-walk.c - @@ -47,7 +47,7 @@ static int decode_tree_entry(struct tree_desc *desc, const char *buf, unsigned l -@@ -9,5 +9,5 @@ index d5a8e096a6..cace4fd6cf 100644 - - desc->entry.mode = canon_mode(mode); - + desc->entry.mode = mode; - desc->entry.pathlen = len - 1; -- hashcpy(desc->entry.oid.hash, (const unsigned char *)path + len); -+ oidread(&desc->entry.oid, (const unsigned char *)path + len); - diff --git a/devel/git-cinnabar/files/patch-git-2.33 b/devel/git-cinnabar/files/patch-git-2.33 index 469b600e802c..6ee6e1162de0 100644 --- a/devel/git-cinnabar/files/patch-git-2.33 +++ b/devel/git-cinnabar/files/patch-git-2.33 @@ -1,27 +1,66 @@ -https://github.com/glandium/git-cinnabar/commit/ea33ee10ac39 +Revert https://github.com/glandium/git-cinnabar/commit/6ced6a84edc1 +until devel/git tracks 2.34.0 or later ---- helper/GIT-VERSION.mk.orig 2021-03-31 21:58:42 UTC +--- helper/GIT-VERSION.mk.orig 2021-11-19 21:23:13 UTC +++ helper/GIT-VERSION.mk @@ -1,2 +1,2 @@ --GIT_VERSION ?= v2.32.0 -+GIT_VERSION ?= v2.33.0 +-GIT_VERSION ?= v2.34.0 ++GIT_VERSION ?= v2.33.1 WINDOWS_GIT_VERSION ?= $(GIT_VERSION).windows.1 ---- helper/csum-file.c.patch.orig 2021-03-31 21:58:42 UTC -+++ helper/csum-file.c.patch -@@ -1,8 +1,8 @@ - diff --git a/csum-file.c b/csum-file.c --index 7510950fa3..19d02e3a63 100644 -+index c951cf8277..1215459b01 100644 - --- a/csum-file.c - +++ b/csum-file.c --@@ -86,7 +86,7 @@ int finalize_hashfile(struct hashfile *f, unsigned char *result, unsigned int fl -+@@ -91,7 +91,7 @@ int finalize_hashfile(struct hashfile *f, unsigned char *result, unsigned int fl - return fd; +--- helper/cinnabar-fast-import.c.orig 2021-11-19 21:23:13 UTC ++++ helper/cinnabar-fast-import.c +@@ -522,8 +522,8 @@ static void do_set(struct string_list *args) + } + } + +-int write_object_file_flags(const void *buf, unsigned long len, const char *type, +- struct object_id *oid, unsigned flags) ++int write_object_file(const void *buf, unsigned long len, const char *type, ++ struct object_id *oid) + { + struct strbuf data; + enum object_type t; +--- helper/hg-connect-http.c.orig 2021-11-19 21:23:13 UTC ++++ helper/hg-connect-http.c +@@ -408,7 +408,7 @@ struct hg_connection *hg_connect_http(const char *url, + struct hg_connection *conn = xmalloc(sizeof(*conn)); + struct strbuf caps = STRBUF_INIT; + struct writer writer; +- string_list_init_dup(&conn->capabilities); ++ string_list_init(&conn->capabilities, 1); + + conn->http.url = xstrdup(url); + conn->http.initial_request = 1; +--- helper/hg-connect-stdio.c.orig 2021-11-19 21:23:13 UTC ++++ helper/hg-connect-stdio.c +@@ -206,7 +206,7 @@ struct hg_connection *hg_connect_stdio(const char *url + struct strbuf buf = STRBUF_INIT; + struct hg_connection *conn = xmalloc(sizeof(*conn)); + struct child_process *proc = &conn->stdio.proc; +- string_list_init_dup(&conn->capabilities); ++ string_list_init(&conn->capabilities, 1); + + protocol = parse_connect_url(url, &hostandport, &path); + +--- helper/object-file.c.patch.orig 2021-11-19 21:23:13 UTC ++++ helper/object-file.c.patch +@@ -1,13 +1,13 @@ + diff --git a/object-file.c b/object-file.c +-index c3d866a287..904149ce90 100644 ++index 188de57634..7b06e56727 100644 + --- a/object-file.c + +++ b/object-file.c +-@@ -1954,7 +1954,7 @@ static int freshen_packed_object(const struct object_id *oid) ++@@ -1868,7 +1868,7 @@ static int freshen_packed_object(const struct object_id *oid) + return 1; } -@@ -10,4 +10,4 @@ index 7510950fa3..19d02e3a63 100644 - +void real_hashwrite(struct hashfile *f, const void *buf, unsigned int count) +--int write_object_file_flags(const void *buf, unsigned long len, +-+int real_write_object_file_flags(const void *buf, unsigned long len, +- const char *type, struct object_id *oid, +- unsigned flags) ++-int write_object_file(const void *buf, unsigned long len, const char *type, +++int real_write_object_file(const void *buf, unsigned long len, const char *type, ++ struct object_id *oid) { - while (count) { -- unsigned left = sizeof(f->buffer) - f->offset; -+ unsigned left = f->buffer_len - f->offset; ++ char hdr[MAX_HEADER_LEN]; diff --git a/devel/git-cinnabar/files/patch-no-wrapper b/devel/git-cinnabar/files/patch-no-wrapper index 86c9b64b0a89..7811dd7d609a 100644 --- a/devel/git-cinnabar/files/patch-no-wrapper +++ b/devel/git-cinnabar/files/patch-no-wrapper @@ -1,84 +1,72 @@ Disable wrappers as Python version is controlled by FLAVORS ---- README.md.orig 2020-11-12 02:19:34 UTC +--- README.md.orig 2021-11-19 21:23:13 UTC +++ README.md -@@ -53,21 +53,6 @@ Setup: +@@ -53,17 +53,6 @@ Setup: If you want to build git along the helper, you can run `make git`. --Experimental support for python 3.x: -------------------------------------- +-Python: +-------- - --Experimental support for python 3.5 or more can be enabled by one of the --following: +-git-cinnabar will use one of `python3`, `python2.7` or `python2`, whichever has +-mercurial libraries. If none of them does, it will use the first that can be +-found. - --- set the `GIT_CINNABAR_EXPERIMENTS` environment variable to `python3`. --- `git config cinnabar.experiments python3`. +-You may force a specific python through the `GIT_CINNABAR_PYTHON` environment +-variable. - --It has been tested mainly with python 3.5 and 3.7. Corner cases may not work --properly. -- --It is also possible to replace `python3` in either `GIT_CINNABAR_EXPERIMENTS` --or `cinnabar.experiments` with `python=/path/to/python`. - Usage: ------ ---- git-cinnabar.orig 2020-11-12 02:19:34 UTC +--- git-cinnabar.orig 2021-11-19 21:23:13 UTC +++ git-cinnabar -@@ -1,25 +1,4 @@ +@@ -1,21 +1,4 @@ -#!/bin/sh -''':' --experiments=",${GIT_CINNABAR_EXPERIMENTS-$(git config cinnabar.experiments)}," --case "$experiments" in --*,python3,*) -- PYTHON=python3 -- ;; --*,python=*,*) -- PYTHON=${experiments#*,python=} -- PYTHON=${PYTHON%%,*} -- ;; --*) -- if command -v python2.7 > /dev/null; then -- PYTHON=python2.7 -- else -- PYTHON=python2 -- fi -- ;; --esac --exec $PYTHON $0 "$@" +-py="$GIT_CINNABAR_PYTHON" +-if test -z "$py"; then +- for py in python3 python2.7 python2; do +- "$py" -c "from mercurial import hg" >/dev/null 2>&1 && break +- py= +- done +-fi +-if test -z "$py"; then +- for py in python3 python2.7 python2; do +- command -v "$py" > /dev/null && break +- py=python3 +- done +-fi +-exec "$py" "$0" "$@" -exit 1 -''' +#!/usr/bin/env python import os import sys ---- git-remote-hg.orig 2020-11-12 02:19:34 UTC +--- git-remote-hg.orig 2021-11-19 21:23:13 UTC +++ git-remote-hg -@@ -1,25 +1,4 @@ +@@ -1,21 +1,4 @@ -#!/bin/sh -''':' --experiments=",${GIT_CINNABAR_EXPERIMENTS-$(git config cinnabar.experiments)}," --case "$experiments" in --*,python3,*) -- PYTHON=python3 -- ;; --*,python=*,*) -- PYTHON=${experiments#*,python=} -- PYTHON=${PYTHON%%,*} -- ;; --*) -- if command -v python2.7 > /dev/null; then -- PYTHON=python2.7 -- else -- PYTHON=python2 -- fi -- ;; --esac --exec $PYTHON $0 "$@" +-py="$GIT_CINNABAR_PYTHON" +-if test -z "$py"; then +- for py in python3 python2.7 python2; do +- "$py" -c "from mercurial import hg" >/dev/null 2>&1 && break +- py= +- done +-fi +-if test -z "$py"; then +- for py in python3 python2.7 python2; do +- command -v "$py" > /dev/null && break +- py=python3 +- done +-fi +-exec "$py" "$0" "$@" -exit 1 -''' +#!/usr/bin/env python from __future__ import division import os