From 4e168f1647f83b9dfe43ae7eac881349f6f4b65b Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: May 22 2020 07:38:22 +0000 Subject: Properly remove old patches. --- diff --git a/0001-Fix-compiler-warnings.patch b/0001-Fix-compiler-warnings.patch deleted file mode 100644 index 9cc7056..0000000 --- a/0001-Fix-compiler-warnings.patch +++ /dev/null @@ -1,226 +0,0 @@ -From 39bcba58fc82eea44b76006c699d0024db756f8a Mon Sep 17 00:00:00 2001 -From: Stefan Widgren -Date: Thu, 15 Aug 2019 22:45:42 +0200 -Subject: [PATCH 1/3] Fix compiler warnings - -(cherry picked from commit 6893907bdc18e2136a8f7ad39a0c56c0a970e640) ---- - src/git2r.c | 8 ++------ - src/git2r_arg.h | 4 +++- - src/git2r_branch.c | 2 +- - src/git2r_cred.c | 4 +++- - src/git2r_diff.c | 17 +++++++++++++++++ - src/git2r_merge.c | 4 ++-- - src/git2r_odb.c | 2 +- - src/git2r_stash.c | 3 +++ - src/git2r_tree.c | 2 +- - 9 files changed, 33 insertions(+), 13 deletions(-) - -diff --git a/src/git2r.c b/src/git2r.c -index 51a6c7f5..9f85ec48 100644 ---- a/src/git2r.c -+++ b/src/git2r.c -@@ -24,12 +24,7 @@ - * - */ - --#include --#include --#include -- --#include -- -+#include "git2r_arg.h" - #include "git2r_blame.h" - #include "git2r_blob.h" - #include "git2r_branch.h" -@@ -181,5 +176,6 @@ R_init_git2r(DllInfo *info) - void - R_unload_git2r(DllInfo *info) - { -+ GIT2R_UNUSED(info); - git_libgit2_shutdown(); - } -diff --git a/src/git2r_arg.h b/src/git2r_arg.h -index 0d435411..38422045 100644 ---- a/src/git2r_arg.h -+++ b/src/git2r_arg.h -@@ -1,6 +1,6 @@ - /* - * git2r, R bindings to the libgit2 library. -- * Copyright (C) 2013-2018 The git2r contributors -+ * Copyright (C) 2013-2019 The git2r contributors - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, -@@ -23,6 +23,8 @@ - #include - #include - -+#define GIT2R_UNUSED(x) ((void)(x)) -+ - int git2r_arg_check_blob(SEXP arg); - int git2r_arg_check_branch(SEXP arg); - int git2r_arg_check_commit(SEXP arg); -diff --git a/src/git2r_branch.c b/src/git2r_branch.c -index a238d75b..55c2f322 100644 ---- a/src/git2r_branch.c -+++ b/src/git2r_branch.c -@@ -429,7 +429,7 @@ SEXP git2r_branch_upstream_canonical_name(SEXP branch) - goto cleanup; - } - error = snprintf(buf, buf_len, "branch.%.*s.merge", (int)branch_name_len, branch_name); -- if (error < 0 || error >= buf_len) { -+ if (error < 0 || (size_t)error >= buf_len) { - GIT2R_ERROR_SET_STR(GIT2R_ERROR_OS, "Failed to snprintf branch config."); - error = GIT2R_ERROR_OS; - goto cleanup; -diff --git a/src/git2r_cred.c b/src/git2r_cred.c -index 4eb3c7fa..efe424cf 100644 ---- a/src/git2r_cred.c -+++ b/src/git2r_cred.c -@@ -1,6 +1,6 @@ - /* - * git2r, R bindings to the libgit2 library. -- * Copyright (C) 2013-2018 The git2r contributors -+ * Copyright (C) 2013-2019 The git2r contributors - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, -@@ -440,6 +440,8 @@ int git2r_cred_acquire_cb( - git2r_transfer_data *td; - SEXP credentials; - -+ GIT2R_UNUSED(url); -+ - if (!payload) - return -1; - -diff --git a/src/git2r_diff.c b/src/git2r_diff.c -index 7dd6bd1a..2eeef502 100644 ---- a/src/git2r_diff.c -+++ b/src/git2r_diff.c -@@ -750,6 +750,9 @@ int git2r_diff_count_file_cb(const git_diff_delta *delta, - { - git2r_diff_count_payload *n = payload; - -+ GIT2R_UNUSED(delta); -+ GIT2R_UNUSED(progress); -+ - n->num_files += 1; - n->num_hunks = n->num_lines = 0; - return 0; -@@ -769,6 +772,9 @@ int git2r_diff_count_hunk_cb(const git_diff_delta *delta, - { - git2r_diff_count_payload *n = payload; - -+ GIT2R_UNUSED(delta); -+ GIT2R_UNUSED(hunk); -+ - n->num_hunks += 1; - if (n->num_hunks > n->max_hunks) { n->max_hunks = n->num_hunks; } - n->num_lines = 0; -@@ -792,6 +798,10 @@ int git2r_diff_count_line_cb(const git_diff_delta *delta, - { - git2r_diff_count_payload *n = payload; - -+ GIT2R_UNUSED(delta); -+ GIT2R_UNUSED(hunk); -+ GIT2R_UNUSED(line); -+ - n->num_lines += 1; - if (n->num_lines > n->max_lines) - n->max_lines = n->num_lines; -@@ -867,6 +877,8 @@ int git2r_diff_get_file_cb(const git_diff_delta *delta, - { - git2r_diff_payload *p = (git2r_diff_payload *) payload; - -+ GIT2R_UNUSED(progress); -+ - /* Save previous hunk's lines in hunk_tmp, we just call the - hunk callback, with a NULL hunk */ - git2r_diff_get_hunk_cb(delta, /* hunk= */ 0, payload); -@@ -932,6 +944,8 @@ int git2r_diff_get_hunk_cb(const git_diff_delta *delta, - { - git2r_diff_payload *p = (git2r_diff_payload *) payload; - -+ GIT2R_UNUSED(delta); -+ - /* Save previous hunk's lines in hunk_tmp, from the line_tmp - temporary storage. */ - if (p->hunk_ptr != 0) { -@@ -1013,6 +1027,9 @@ int git2r_diff_get_line_cb(const git_diff_delta *delta, - char *buffer = short_buffer; - SEXP line_obj; - -+ GIT2R_UNUSED(delta); -+ GIT2R_UNUSED(hunk); -+ - PROTECT(line_obj = Rf_mkNamed(VECSXP, git2r_S3_items__git_diff_line)); - Rf_setAttrib( - line_obj, -diff --git a/src/git2r_merge.c b/src/git2r_merge.c -index 97536e48..1d586090 100644 ---- a/src/git2r_merge.c -+++ b/src/git2r_merge.c -@@ -159,7 +159,7 @@ static int git2r_fast_forward_merge( - goto cleanup; - } - error = snprintf(buf, buf_len, "%s: Fast-forward", log_message); -- if (error < 0 || error >= buf_len) { -+ if (error < 0 || (size_t)error >= buf_len) { - GIT2R_ERROR_SET_STR(GIT2R_ERROR_OS, "Failed to snprintf log message."); - error = GIT2R_ERROR_OS; - goto cleanup; -@@ -552,7 +552,7 @@ SEXP git2r_merge_branch(SEXP branch, SEXP merger, SEXP commit_on_success, SEXP f - goto cleanup; - } - error = snprintf(buf, buf_len, "merge %s", name); -- if (error < 0 || error >= buf_len) { -+ if (error < 0 || (size_t)error >= buf_len) { - GIT2R_ERROR_SET_STR(GIT2R_ERROR_OS, "Failed to snprintf log message."); - error = GIT2R_ERROR_OS; - goto cleanup; -diff --git a/src/git2r_odb.c b/src/git2r_odb.c -index 738e777e..141d7c97 100644 ---- a/src/git2r_odb.c -+++ b/src/git2r_odb.c -@@ -379,7 +379,7 @@ static int git2r_odb_tree_blobs( - sep = ""; - } - error = snprintf(buf, buf_len, "%s%s%s", path, sep, entry_name); -- if (0 <= error && error < buf_len) { -+ if (0 <= error && (size_t)error < buf_len) { - error = git2r_odb_tree_blobs( - sub_tree, - buf, -diff --git a/src/git2r_stash.c b/src/git2r_stash.c -index d9987567..4a38a5e8 100644 ---- a/src/git2r_stash.c -+++ b/src/git2r_stash.c -@@ -171,6 +171,9 @@ static int git2r_stash_list_cb( - SEXP stash, class; - git2r_stash_list_cb_data *cb_data = (git2r_stash_list_cb_data*)payload; - -+ GIT2R_UNUSED(index); -+ GIT2R_UNUSED(message); -+ - /* Check if we have a list to populate */ - if (!Rf_isNull(cb_data->list)) { - PROTECT(class = Rf_allocVector(STRSXP, 2)); -diff --git a/src/git2r_tree.c b/src/git2r_tree.c -index 6b70d592..3df2f63b 100644 ---- a/src/git2r_tree.c -+++ b/src/git2r_tree.c -@@ -112,7 +112,7 @@ static int git2r_tree_walk_cb( - - /* mode */ - error = snprintf(mode, sizeof(mode), "%06o", git_tree_entry_filemode(entry)); -- if (error < 0 || error >= sizeof(mode)) { -+ if (error < 0 || (size_t)error >= sizeof(mode)) { - error = -1; - goto cleanup; - } --- -2.26.2 - diff --git a/0002-Handle-renamed-structures-enums-and-values-in-libgit.patch b/0002-Handle-renamed-structures-enums-and-values-in-libgit.patch deleted file mode 100644 index dd1c9a2..0000000 --- a/0002-Handle-renamed-structures-enums-and-values-in-libgit.patch +++ /dev/null @@ -1,379 +0,0 @@ -From 77cc5e5268bb028f3d75afc69078fd49acf1379a Mon Sep 17 00:00:00 2001 -From: Stefan Widgren -Date: Wed, 15 Apr 2020 22:53:22 +0200 -Subject: [PATCH 2/3] Handle renamed structures, enums and values in libgit2 - v0.99 - -Several structures, enums and values have been renamed in libgit -version 0.99.0. The former names are deprecated. See -https://github.com/libgit2/libgit2/releases/tag/v0.99.0 - -Signed-off-by: Stefan Widgren -(cherry picked from commit e55f435cb3d241004e42226ce2d247d03fbc1f42) ---- - src/git2r_blob.c | 6 +++--- - src/git2r_clone.c | 4 ++-- - src/git2r_cred.c | 36 +++++++++++++++++++----------------- - src/git2r_cred.h | 5 +++-- - src/git2r_deprecated.h | 26 +++++++++++++++++++++++++- - src/git2r_remote.c | 6 +++--- - src/git2r_transfer.c | 7 ++++--- - src/git2r_transfer.h | 5 +++-- - 8 files changed, 62 insertions(+), 33 deletions(-) - -diff --git a/src/git2r_blob.c b/src/git2r_blob.c -index e79021b9..2b941419 100644 ---- a/src/git2r_blob.c -+++ b/src/git2r_blob.c -@@ -1,6 +1,6 @@ - /* - * git2r, R bindings to the libgit2 library. -- * Copyright (C) 2013-2019 The git2r contributors -+ * Copyright (C) 2013-2020 The git2r contributors - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, -@@ -100,7 +100,7 @@ SEXP git2r_blob_create_fromdisk(SEXP repo, SEXP path) - git_blob *blob = NULL; - SEXP item; - -- error = git_blob_create_fromdisk( -+ error = GIT2R_BLOB_CREATE_FROM_DISK( - &oid, - repository, - CHAR(STRING_ELT(path, i))); -@@ -167,7 +167,7 @@ SEXP git2r_blob_create_fromworkdir(SEXP repo, SEXP relative_path) - git_blob *blob = NULL; - SEXP item; - -- error = git_blob_create_fromworkdir( -+ error = GIT2R_BLOB_CREATE_FROM_WORKDIR( - &oid, - repository, - CHAR(STRING_ELT(relative_path, i))); -diff --git a/src/git2r_clone.c b/src/git2r_clone.c -index 64adc6e0..5cf6e091 100644 ---- a/src/git2r_clone.c -+++ b/src/git2r_clone.c -@@ -1,6 +1,6 @@ - /* - * git2r, R bindings to the libgit2 library. -- * Copyright (C) 2013-2019 The git2r contributors -+ * Copyright (C) 2013-2020 The git2r contributors - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, -@@ -34,7 +34,7 @@ - * @return 0 - */ - static int git2r_clone_progress( -- const git_transfer_progress *progress, -+ const GIT2R_INDEXER_PROGRESS *progress, - void *payload) - { - int kbytes = progress->received_bytes / 1024; -diff --git a/src/git2r_cred.c b/src/git2r_cred.c -index efe424cf..79d8f26a 100644 ---- a/src/git2r_cred.c -+++ b/src/git2r_cred.c -@@ -1,6 +1,6 @@ - /* - * git2r, R bindings to the libgit2 library. -- * Copyright (C) 2013-2019 The git2r contributors -+ * Copyright (C) 2013-2020 The git2r contributors - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, -@@ -35,6 +35,7 @@ - - #include "git2r_arg.h" - #include "git2r_cred.h" -+#include "git2r_deprecated.h" - #include "git2r_S3.h" - #include "git2r_transfer.h" - -@@ -78,12 +79,12 @@ static int git2r_getenv(char **out, SEXP obj, const char *slot) - * @return 0 on success, else -1. - */ - static int git2r_cred_ssh_key( -- git_cred **cred, -+ GIT2R_CREDENTIAL **cred, - const char *username_from_url, - unsigned int allowed_types, - SEXP credentials) - { -- if (GIT_CREDTYPE_SSH_KEY & allowed_types) { -+ if (GIT2R_CREDENTIAL_SSH_KEY & allowed_types) { - SEXP elem; - const char *publickey; - const char *privatekey = NULL; -@@ -96,7 +97,7 @@ static int git2r_cred_ssh_key( - if (Rf_length(elem) && (NA_STRING != STRING_ELT(elem, 0))) - passphrase = CHAR(STRING_ELT(elem, 0)); - -- if (git_cred_ssh_key_new( -+ if (GIT2R_CREDENTIAL_SSH_KEY_NEW( - cred, username_from_url, publickey, privatekey, passphrase)) - return -1; - -@@ -115,11 +116,11 @@ static int git2r_cred_ssh_key( - * @return 0 on success, else -1. - */ - static int git2r_cred_env( -- git_cred **cred, -+ GIT2R_CREDENTIAL **cred, - unsigned int allowed_types, - SEXP credentials) - { -- if (GIT_CREDTYPE_USERPASS_PLAINTEXT & allowed_types) { -+ if (GIT2R_CREDENTIAL_USERPASS_PLAINTEXT & allowed_types) { - int error; - char *username = NULL; - char *password = NULL; -@@ -134,7 +135,8 @@ static int git2r_cred_env( - if (error) - goto cleanup; - -- error = git_cred_userpass_plaintext_new(cred, username, password); -+ error = GIT2R_CREDENTIAL_USERPASS_PLAINTEXT_NEW( -+ cred, username, password); - - cleanup: - free(username); -@@ -158,11 +160,11 @@ static int git2r_cred_env( - * @return 0 on success, else -1. - */ - static int git2r_cred_token( -- git_cred **cred, -+ GIT2R_CREDENTIAL **cred, - unsigned int allowed_types, - SEXP credentials) - { -- if (GIT_CREDTYPE_USERPASS_PLAINTEXT & allowed_types) { -+ if (GIT2R_CREDENTIAL_USERPASS_PLAINTEXT & allowed_types) { - int error; - char *token = NULL; - -@@ -172,7 +174,7 @@ static int git2r_cred_token( - if (error) - goto cleanup; - -- error = git_cred_userpass_plaintext_new(cred, " ", token); -+ error = GIT2R_CREDENTIAL_USERPASS_PLAINTEXT_NEW(cred, " ", token); - - cleanup: - free(token); -@@ -195,17 +197,17 @@ static int git2r_cred_token( - * @return 0 on success, else -1. - */ - static int git2r_cred_user_pass( -- git_cred **cred, -+ GIT2R_CREDENTIAL **cred, - unsigned int allowed_types, - SEXP credentials) - { -- if (GIT_CREDTYPE_USERPASS_PLAINTEXT & allowed_types) { -+ if (GIT2R_CREDENTIAL_USERPASS_PLAINTEXT & allowed_types) { - const char *username; - const char *password; - - username = CHAR(STRING_ELT(git2r_get_list_element(credentials, "username"), 0)); - password = CHAR(STRING_ELT(git2r_get_list_element(credentials, "password"), 0)); -- if (git_cred_userpass_plaintext_new(cred, username, password)) -+ if (GIT2R_CREDENTIAL_USERPASS_PLAINTEXT_NEW(cred, username, password)) - return -1; - - return 0; -@@ -347,7 +349,7 @@ static int git2r_cred_user_pass( - /* } */ - - /* static int git2r_cred_default_ssh_key( */ --/* git_cred **cred, */ -+/* GIT2R_CREDENTIAL **cred, */ - /* const char *username_from_url) */ - /* { */ - /* #ifdef WIN32 */ -@@ -431,7 +433,7 @@ static int git2r_cred_user_pass( - * @return 0 on success, else -1. - */ - int git2r_cred_acquire_cb( -- git_cred **cred, -+ GIT2R_CREDENTIAL **cred, - const char *url, - const char *username_from_url, - unsigned int allowed_types, -@@ -448,11 +450,11 @@ int git2r_cred_acquire_cb( - td = (git2r_transfer_data*)payload; - credentials = td->credentials; - if (Rf_isNull(credentials)) { -- if (GIT_CREDTYPE_SSH_KEY & allowed_types) { -+ if (GIT2R_CREDENTIAL_SSH_KEY & allowed_types) { - if (td->use_ssh_agent) { - /* Try to get credentials from the ssh-agent. */ - td->use_ssh_agent = 0; -- if (git_cred_ssh_key_from_agent(cred, username_from_url) == 0) -+ if (GIT2R_CREDENTIAL_SSH_KEY_FROM_AGENT(cred, username_from_url) == 0) - return 0; - } - -diff --git a/src/git2r_cred.h b/src/git2r_cred.h -index b519a9a6..13920cfc 100644 ---- a/src/git2r_cred.h -+++ b/src/git2r_cred.h -@@ -1,6 +1,6 @@ - /* - * git2r, R bindings to the libgit2 library. -- * Copyright (C) 2013-2015 The git2r contributors -+ * Copyright (C) 2013-2020 The git2r contributors - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, -@@ -20,9 +20,10 @@ - #define INCLUDE_git2r_cred_h - - #include -+#include "git2r_deprecated.h" - - int git2r_cred_acquire_cb( -- git_cred **out, -+ GIT2R_CREDENTIAL **out, - const char *url, - const char *username_from_url, - unsigned int allowed_types, -diff --git a/src/git2r_deprecated.h b/src/git2r_deprecated.h -index f8f05541..95b6050c 100644 ---- a/src/git2r_deprecated.h -+++ b/src/git2r_deprecated.h -@@ -1,6 +1,6 @@ - /* - * git2r, R bindings to the libgit2 library. -- * Copyright (C) 2013-2019 The git2r contributors -+ * Copyright (C) 2013-2020 The git2r contributors - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, -@@ -70,4 +70,28 @@ - # define GIT2R_OBJECT_T git_otype - #endif - -+#if defined(GIT2R_LIBGIT2_V0_99_0_RENAMES) -+# define GIT2R_CREDENTIAL git_credential -+# define GIT2R_CREDENTIAL_SSH_KEY GIT_CREDENTIAL_SSH_KEY -+# define GIT2R_CREDENTIAL_SSH_KEY_NEW git_credential_ssh_key_new -+# define GIT2R_CREDENTIAL_USERPASS_PLAINTEXT_NEW git_credential_userpass_plaintext_new -+# define GIT2R_CREDENTIAL_SSH_KEY_FROM_AGENT git_credential_ssh_key_from_agent -+# define GIT2R_CREDENTIAL_USERPASS_PLAINTEXT GIT_CREDENTIAL_USERPASS_PLAINTEXT -+# define GIT2R_INDEXER_PROGRESS git_indexer_progress -+# define GIT2R_OID_IS_ZERO git_oid_is_zero -+# define GIT2R_BLOB_CREATE_FROM_DISK git_blob_create_from_disk -+# define GIT2R_BLOB_CREATE_FROM_WORKDIR git_blob_create_from_workdir -+#else -+# define GIT2R_CREDENTIAL git_cred -+# define GIT2R_CREDENTIAL_SSH_KEY GIT_CREDTYPE_SSH_KEY -+# define GIT2R_CREDENTIAL_SSH_KEY_NEW git_cred_ssh_key_new -+# define GIT2R_CREDENTIAL_USERPASS_PLAINTEXT_NEW git_cred_userpass_plaintext_new -+# define GIT2R_CREDENTIAL_SSH_KEY_FROM_AGENT git_cred_ssh_key_from_agent -+# define GIT2R_CREDENTIAL_USERPASS_PLAINTEXT GIT_CREDTYPE_USERPASS_PLAINTEXT -+# define GIT2R_INDEXER_PROGRESS git_transfer_progress -+# define GIT2R_OID_IS_ZERO git_oid_iszero -+# define GIT2R_BLOB_CREATE_FROM_DISK git_blob_create_fromdisk -+# define GIT2R_BLOB_CREATE_FROM_WORKDIR git_blob_create_fromworkdir -+#endif -+ - #endif -diff --git a/src/git2r_remote.c b/src/git2r_remote.c -index c8d02f78..5ba4661c 100644 ---- a/src/git2r_remote.c -+++ b/src/git2r_remote.c -@@ -1,6 +1,6 @@ - /* - * git2r, R bindings to the libgit2 library. -- * Copyright (C) 2013-2019 The git2r contributors -+ * Copyright (C) 2013-2020 The git2r contributors - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, -@@ -95,7 +95,7 @@ static int git2r_update_tips_cb( - git_oid_fmt(b_str, b); - b_str[GIT_OID_HEXSZ] = '\0'; - -- if (git_oid_iszero(a)) { -+ if (GIT2R_OID_IS_ZERO(a)) { - Rprintf("[new] %.20s %s\n", b_str, refname); - } else { - char a_str[GIT_OID_HEXSZ + 1]; -@@ -130,7 +130,7 @@ SEXP git2r_remote_fetch( - { - int error, nprotect = 0; - SEXP result = R_NilValue; -- const git_transfer_progress *stats; -+ const GIT2R_INDEXER_PROGRESS *stats; - git_remote *remote = NULL; - git_repository *repository = NULL; - git_fetch_options fetch_opts = GIT_FETCH_OPTIONS_INIT; -diff --git a/src/git2r_transfer.c b/src/git2r_transfer.c -index b623ffcc..564b5d6a 100644 ---- a/src/git2r_transfer.c -+++ b/src/git2r_transfer.c -@@ -1,6 +1,6 @@ - /* - * git2r, R bindings to the libgit2 library. -- * Copyright (C) 2013-2018 The git2r contributors -+ * Copyright (C) 2013-2020 The git2r contributors - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, -@@ -16,18 +16,19 @@ - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -+#include "git2r_deprecated.h" - #include "git2r_S3.h" - #include "git2r_transfer.h" - - /** - * Init slots in S3 class git_transfer_progress - * -- * @param source A git_transfer_progress object -+ * @param source A GIT2R_INDEXER_PROGRESS object - * @param dest S3 class git_transfer_progress to initialize - * @return void - */ - void git2r_transfer_progress_init( -- const git_transfer_progress *source, -+ const GIT2R_INDEXER_PROGRESS *source, - SEXP dest) - { - SET_VECTOR_ELT( -diff --git a/src/git2r_transfer.h b/src/git2r_transfer.h -index e4f54e33..a13e5a85 100644 ---- a/src/git2r_transfer.h -+++ b/src/git2r_transfer.h -@@ -1,6 +1,6 @@ - /* - * git2r, R bindings to the libgit2 library. -- * Copyright (C) 2013-2018 The git2r contributors -+ * Copyright (C) 2013-2020 The git2r contributors - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, -@@ -22,6 +22,7 @@ - #include - #include - #include -+#include "git2r_deprecated.h" - - /** - * Data structure to hold information when performing a clone, fetch -@@ -54,7 +55,7 @@ typedef struct { - #endif - - void git2r_transfer_progress_init( -- const git_transfer_progress *source, -+ const GIT2R_INDEXER_PROGRESS *source, - SEXP dest); - - #endif --- -2.26.2 - diff --git a/0003-configure-update-for-libgit2-v0.99.0.patch b/0003-configure-update-for-libgit2-v0.99.0.patch deleted file mode 100644 index 4668d39..0000000 --- a/0003-configure-update-for-libgit2-v0.99.0.patch +++ /dev/null @@ -1,142 +0,0 @@ -From b2184350007ea17030bde639dfedecde9ffd466b Mon Sep 17 00:00:00 2001 -From: Stefan Widgren -Date: Sun, 19 Apr 2020 18:40:24 +0200 -Subject: [PATCH 3/3] configure: update for libgit2 v0.99.0 - -Signed-off-by: Stefan Widgren -(cherry picked from commit 163d62a98d980678d5eac7513287346f1a2cc285) ---- - configure | 37 +++++++++++++++++++++++++++++++------ - configure.ac | 27 +++++++++++++++++++++------ - tools/version.c | 2 +- - 3 files changed, 53 insertions(+), 13 deletions(-) - -diff --git a/configure b/configure -index 10d3bb8a..df91a61d 100755 ---- a/configure -+++ b/configure -@@ -3329,9 +3329,8 @@ fi - - ################# Begin configuration to use system libgit2 ################## - if test "x${USE_BUNDLED_LIBGIT2}" = xno; then -- -- # The function 'git_buf_free' is deprecated in libgit2. Use -- # 'git_buf_dispose', if available, instead. -+ # The function 'git_buf_free' is deprecated in libgit2 -+ # v0.28.0. Use 'git_buf_dispose', if available, instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the libgit2 function git_buf_dispose is available" >&5 - $as_echo_n "checking whether the libgit2 function git_buf_dispose is available... " >&6; } - have_buf_dispose=no -@@ -3356,9 +3355,9 @@ $as_echo "${have_buf_dispose}" >&6; } - - # The constants GIT_OBJ_ANY, GIT_OBJ_BLOB, GIT_OBJ_COMMIT, - # GIT_OBJ_TAG_GIT_OBJ_TREE and GIT_REF_OID are deprecated in -- # libgit2. Use GIT_OBJECT_ANY, GIT_OBJECT_BLOB, GIT_OBJECT_COMMIT, -- # GIT_OBJECT_TAG_GIT_OBJECT_TREE and GIT_REFERENCE_DIRECT, if -- # available, instead. -+ # libgit2 v0.28.0. Use GIT_OBJECT_ANY, GIT_OBJECT_BLOB, -+ # GIT_OBJECT_COMMIT, GIT_OBJECT_TAG_GIT_OBJECT_TREE and -+ # GIT_REFERENCE_DIRECT, if available, instead. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the libgit2 constant GIT_OBJECT_ANY is available" >&5 - $as_echo_n "checking whether the libgit2 constant GIT_OBJECT_ANY is available... " >&6; } - have_git_object_any=no -@@ -3405,6 +3404,32 @@ $as_echo "${have_git_error_last}" >&6; } - PKG_CFLAGS="${PKG_CFLAGS} -DGIT2R_HAVE_GIT_ERROR" - fi - -+ # libgit v0.99.0: Several structures, enums and values have been -+ # renamed in libgit version 0.99.0. The former names are -+ # deprecated. See -+ # https://github.com/libgit2/libgit2/releases/tag/v0.99.0 -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the libgit2 function git_oid_is_zero is available" >&5 -+$as_echo_n "checking whether the libgit2 function git_oid_is_zero is available... " >&6; } -+ have_git_oid_is_zero=no -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+git_oid_is_zero(NULL); -+ ; -+ return 0; -+} -+_ACEOF -+ PKG_CFLAGS="${PKG_CFLAGS} -Werror" "$RBIN" CMD SHLIB conftest.c \ -+ 1>&5 2>&5 && have_git_oid_is_zero=yes -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${have_git_oid_is_zero}" >&5 -+$as_echo "${have_git_oid_is_zero}" >&6; } -+ if test "x${have_git_oid_is_zero}" = xyes; then -+ PKG_CFLAGS="${PKG_CFLAGS} -DGIT2R_LIBGIT2_V0_99_0_RENAMES" -+ fi -+ - # For debugging - echo "----- Results of the git2r package configure -----" - echo "" -diff --git a/configure.ac b/configure.ac -index 8c67b5e8..cb15eb77 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -114,9 +114,8 @@ fi - - ################# Begin configuration to use system libgit2 ################## - if test "x${USE_BUNDLED_LIBGIT2}" = xno; then -- -- # The function 'git_buf_free' is deprecated in libgit2. Use -- # 'git_buf_dispose', if available, instead. -+ # The function 'git_buf_free' is deprecated in libgit2 -+ # v0.28.0. Use 'git_buf_dispose', if available, instead. - AC_MSG_CHECKING([whether the libgit2 function git_buf_dispose is available]) - have_buf_dispose=no - AC_LANG_CONFTEST([AC_LANG_PROGRAM( -@@ -131,9 +130,9 @@ if test "x${USE_BUNDLED_LIBGIT2}" = xno; then - - # The constants GIT_OBJ_ANY, GIT_OBJ_BLOB, GIT_OBJ_COMMIT, - # GIT_OBJ_TAG_GIT_OBJ_TREE and GIT_REF_OID are deprecated in -- # libgit2. Use GIT_OBJECT_ANY, GIT_OBJECT_BLOB, GIT_OBJECT_COMMIT, -- # GIT_OBJECT_TAG_GIT_OBJECT_TREE and GIT_REFERENCE_DIRECT, if -- # available, instead. -+ # libgit2 v0.28.0. Use GIT_OBJECT_ANY, GIT_OBJECT_BLOB, -+ # GIT_OBJECT_COMMIT, GIT_OBJECT_TAG_GIT_OBJECT_TREE and -+ # GIT_REFERENCE_DIRECT, if available, instead. - AC_MSG_CHECKING([whether the libgit2 constant GIT_OBJECT_ANY is available]) - have_git_object_any=no - AC_LANG_CONFTEST([AC_LANG_PROGRAM( -@@ -160,6 +159,22 @@ if test "x${USE_BUNDLED_LIBGIT2}" = xno; then - PKG_CFLAGS="${PKG_CFLAGS} -DGIT2R_HAVE_GIT_ERROR" - fi - -+ # libgit v0.99.0: Several structures, enums and values have been -+ # renamed in libgit version 0.99.0. The former names are -+ # deprecated. See -+ # https://github.com/libgit2/libgit2/releases/tag/v0.99.0 -+ AC_MSG_CHECKING([whether the libgit2 function git_oid_is_zero is available]) -+ have_git_oid_is_zero=no -+ AC_LANG_CONFTEST([AC_LANG_PROGRAM( -+ [[#include ]], -+ [[git_oid_is_zero(NULL);]])]) -+ PKG_CFLAGS="${PKG_CFLAGS} -Werror" "$RBIN" CMD SHLIB conftest.c \ -+ 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD && have_git_oid_is_zero=yes -+ AC_MSG_RESULT([${have_git_oid_is_zero}]) -+ if test "x${have_git_oid_is_zero}" = xyes; then -+ PKG_CFLAGS="${PKG_CFLAGS} -DGIT2R_LIBGIT2_V0_99_0_RENAMES" -+ fi -+ - # For debugging - echo "----- Results of the git2r package configure -----" - echo "" -diff --git a/tools/version.c b/tools/version.c -index f12cd804..450f63b7 100644 ---- a/tools/version.c -+++ b/tools/version.c -@@ -4,6 +4,6 @@ - # if LIBGIT2_VER_MINOR < 26 - # error libgit2 version too old - # endif --#else -+#elif LIBGIT2_VER_MAJOR > 1 - # error the libgit2 version is not compatible with git2r - #endif --- -2.26.2 - diff --git a/R-git2r.spec b/R-git2r.spec index 33f7311..8f3d68d 100644 --- a/R-git2r.spec +++ b/R-git2r.spec @@ -38,9 +38,6 @@ running some basic 'Git' commands. pushd %{packname} rm -r src/libgit2 sed -i '/libgit2/d' MD5 -%patch0001 -p1 -%patch0002 -p1 -%patch0003 -p1 popd