git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aidan Van Dyk <aidan@highrise.ca>
To: git@vger.kernel.org
Subject: [PATCH] Add NO_RSYNC to allow building without rsync
Date: Wed, 30 Jul 2008 14:52:25 -0400	[thread overview]
Message-ID: <20080730185225.GG10399@yugib.highrise.ca> (raw)

This is similar to NO_CURL.

Signed-off-by: Aidan Van Dyk <aidan@highrise.ca>
---

I came about this because SCO OpenServer doesnt' have mkdtemp.  But I never use
rsync, so making it optional was an easy fix.

 Makefile    |    4 ++++
 transport.c |    9 ++++++++-
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 798a2f2..b0a2985 100644
--- a/Makefile
+++ b/Makefile
@@ -789,6 +789,10 @@ else
        CC_LD_DYNPATH = -R
 endif

+ifdef NO_RSYNC
+       BASIC_CFLAGS += -DNO_RSYNC
+endif
+
 ifdef NO_CURL
        BASIC_CFLAGS += -DNO_CURL
 else
diff --git a/transport.c b/transport.c
index 6eb65b8..867b01f 100644
--- a/transport.c
+++ b/transport.c
@@ -142,6 +142,7 @@ static void insert_packed_refs(const char *packed_refs, struct ref **list)
        }
 }

+#ifndef NO_RSYNC
 static struct ref *get_refs_via_rsync(struct transport *transport)
 {
        struct strbuf buf = STRBUF_INIT, temp_dir = STRBUF_INIT;
@@ -232,6 +233,7 @@ static int fetch_objs_via_rsync(struct transport *transport,

        return result;
 }
+#endif

 static int write_one_ref(const char *name, const unsigned char *sha1,
                int flags, void *data)
@@ -276,6 +278,7 @@ static int write_refs_to_temp_dir(struct strbuf *temp_dir,
        return 0;
 }

+#ifndef NO_RSYNC
 static int rsync_transport_push(struct transport *transport,
                int refspec_nr, const char **refspec, int flags)
 {
@@ -345,6 +348,7 @@ static int rsync_transport_push(struct transport *transport,

        return result;
 }
+#endif

 /* Generic functions for using commit walkers */

@@ -731,10 +735,13 @@ struct transport *transport_get(struct remote *remote, const char *url)
        ret->url = url;

        if (!prefixcmp(url, "rsync://")) {
+#ifdef NO_RSYNC
+               error("git was compiled without rsync support.");
+#else
                ret->get_refs_list = get_refs_via_rsync;
                ret->fetch = fetch_objs_via_rsync;
                ret->push = rsync_transport_push;
-
+#endif
        } else if (!prefixcmp(url, "http://")
                || !prefixcmp(url, "https://")
                || !prefixcmp(url, "ftp://")) {
--
1.6.0.rc1.dirty

             reply	other threads:[~2008-07-30 19:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-30 18:52 Aidan Van Dyk [this message]
2008-07-30 19:33 ` [PATCH] Add NO_RSYNC to allow building without rsync Linus Torvalds
2008-07-30 19:49   ` Aidan Van Dyk
2008-07-30 20:11 ` Junio C Hamano
2008-07-30 20:49   ` Aidan Van Dyk
2008-07-30 21:42     ` Boyd Lynn Gerber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080730185225.GG10399@yugib.highrise.ca \
    --to=aidan@highrise.ca \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).