From 961b1c80dbef4598ae0785aa1bf0bb1be9d69383 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 19 Oct 2011 17:45:00 -0400 Subject: [PATCH] Do "bare" repositories by default Mixing the repository and checkouts is discouraged. --- Makefile-src.am | 1 - src/libostree/ostree-repo.c | 5 +++-- src/libostree/ostree-types.h | 33 --------------------------------- src/libostree/ostree.h | 1 - src/ot-builtin-init.c | 18 ++++++------------ 5 files changed, 9 insertions(+), 49 deletions(-) delete mode 100644 src/libostree/ostree-types.h diff --git a/Makefile-src.am b/Makefile-src.am index 68cd3b52..2c600d5f 100644 --- a/Makefile-src.am +++ b/Makefile-src.am @@ -37,7 +37,6 @@ libostree_la_SOURCES = src/libostree/ostree.h \ src/libostree/ostree-core.h \ src/libostree/ostree-repo.c \ src/libostree/ostree-repo.h \ - src/libostree/ostree-types.h \ $(NULL) libostree_la_CFLAGS = -I$(srcdir)/src/libostree -I$(srcdir)/src/libotutil -DLOCALEDIR=\"$(datadir)/locale\" $(GIO_UNIX_CFLAGS) libostree_la_LIBADD = libotutil.la $(GIO_UNIX_LIBS) diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c index 4c5b10bc..0dfe67d3 100644 --- a/src/libostree/ostree-repo.c +++ b/src/libostree/ostree-repo.c @@ -133,8 +133,9 @@ ostree_repo_constructor (GType gtype, g_assert (priv->path != NULL); priv->repo_file = ot_util_new_file_for_path (priv->path); - priv->head_ref_path = g_build_filename (priv->path, OSTREE_REPO_DIR, "HEAD", NULL); - priv->objects_path = g_build_filename (priv->path, OSTREE_REPO_DIR, "objects", NULL); + + priv->head_ref_path = g_build_filename (priv->path, "HEAD", NULL); + priv->objects_path = g_build_filename (priv->path, "objects", NULL); return object; } diff --git a/src/libostree/ostree-types.h b/src/libostree/ostree-types.h deleted file mode 100644 index 5b306b3b..00000000 --- a/src/libostree/ostree-types.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- - * - * Copyright (C) 2011 Colin Walters . - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * Author: Colin Walters - */ - -#ifndef __OSTREE_TYPES_H__ -#define __OSTREE_TYPES_H__ - -#include - -G_BEGIN_DECLS - -#define OSTREE_REPO_DIR ".ot" - -G_END_DECLS - -#endif diff --git a/src/libostree/ostree.h b/src/libostree/ostree.h index 75cced5f..329d7c71 100644 --- a/src/libostree/ostree.h +++ b/src/libostree/ostree.h @@ -23,6 +23,5 @@ #include #include -#include #endif diff --git a/src/ot-builtin-init.c b/src/ot-builtin-init.c index 9d864645..7e952af4 100644 --- a/src/ot-builtin-init.c +++ b/src/ot-builtin-init.c @@ -37,12 +37,12 @@ ostree_builtin_init (int argc, char **argv, const char *prefix, GError **error) { GOptionContext *context = NULL; gboolean ret = FALSE; - char *htdir_path = NULL; + char *otdir_path = NULL; char *objects_path = NULL; - GFile *htdir = NULL; + GFile *otdir = NULL; GFile *objects_dir = NULL; - context = g_option_context_new ("- Check the repository for consistency"); + context = g_option_context_new ("- Initialize a new empty repository"); g_option_context_add_main_entries (context, options, NULL); if (!g_option_context_parse (context, &argc, &argv, error)) @@ -51,13 +51,7 @@ ostree_builtin_init (int argc, char **argv, const char *prefix, GError **error) if (repo_path == NULL) repo_path = "."; - htdir_path = g_build_filename (repo_path, OSTREE_REPO_DIR, NULL); - htdir = ot_util_new_file_for_path (htdir_path); - - if (!g_file_make_directory (htdir, NULL, error)) - goto out; - - objects_path = g_build_filename (htdir_path, "objects", NULL); + objects_path = g_build_filename (repo_path, "objects", NULL); objects_dir = g_file_new_for_path (objects_path); if (!g_file_make_directory (objects_dir, NULL, error)) goto out; @@ -66,7 +60,7 @@ ostree_builtin_init (int argc, char **argv, const char *prefix, GError **error) out: if (context) g_option_context_free (context); - g_free (htdir_path); - g_clear_object (&htdir); + g_free (otdir_path); + g_clear_object (&otdir); return ret; }