From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- sys-fs/copyfs/Manifest | 7 ++ sys-fs/copyfs/copyfs-1.0.1.ebuild | 43 +++++++ sys-fs/copyfs/files/copyfs-1.0-unlink.patch | 158 ++++++++++++++++++++++++++ sys-fs/copyfs/files/copyfs-1.0.1-gentoo.patch | 46 ++++++++ sys-fs/copyfs/metadata.xml | 5 + 5 files changed, 259 insertions(+) create mode 100644 sys-fs/copyfs/Manifest create mode 100644 sys-fs/copyfs/copyfs-1.0.1.ebuild create mode 100644 sys-fs/copyfs/files/copyfs-1.0-unlink.patch create mode 100644 sys-fs/copyfs/files/copyfs-1.0.1-gentoo.patch create mode 100644 sys-fs/copyfs/metadata.xml (limited to 'sys-fs/copyfs') diff --git a/sys-fs/copyfs/Manifest b/sys-fs/copyfs/Manifest new file mode 100644 index 000000000000..c4d68a16f6cc --- /dev/null +++ b/sys-fs/copyfs/Manifest @@ -0,0 +1,7 @@ +AUX copyfs-1.0-unlink.patch 4383 SHA256 b442e18bf37b108e661fb641e463cb64d919308a5c9b09c5817fc7f04703f0c1 SHA512 dc4a665e98f5250f36ff5dffb4b1ebe58ce9939724d58a0f99f6b21a7d7440947bc90bd6f07f471774cbcca9da5cc0b9f621081e2384797cf47302cb2769b0bb WHIRLPOOL 01290aafc1d424b93ca32c4f378c99c020729be1366d48d0eec4b535bfd913ce57c360988a9aa1e36b239e8e153138cc7b4ca8808ff9dff4a3058b06370a7cdf +AUX copyfs-1.0.1-gentoo.patch 999 SHA256 6571725e25606c3da8085f442df6a06c3bea93263f2fdf1dc4726cbf21c37c52 SHA512 45cf7dd29ef8deb2421177cf513906fd40864b93192a5cb2556ed3cd85227d173f7fd9a24e1c4ac78426f1059ffa5a05e348bf64ad6759575774f60407d31143 WHIRLPOOL 56ccd2daa226b321bd493bbb1e61037fa563667d49248282a2c57539be4246cb573aa1121659eea3d675fe58568fba4d5e3d9bbc19d7836bdaac58e13caeed0c +DIST copyfs-1.0.1.tar.bz2 38429 SHA256 63022f60e2c6b488bef509add0e7cdb41d597ded22a70c1c6ae74ab4a6b7e0f7 SHA512 abe1a125913f35d8390385562d56a5a1aa238ec03bfa044d61ac8f514a4986bfa70502d30af9dbc90e58910dab7f0ab5e230de0b4fa2eb45fe3a2f6514be0a07 WHIRLPOOL e230bb1f4cf24bbc6cdf9bfcad4324d7861e6b36b3dd5a9611e62e52520635e2605831d697a548f82fb589422ac79e4997efbc9b2ef689746860d04932d3f5f2 +EBUILD copyfs-1.0.1.ebuild 1007 SHA256 1973a75b5ee5d9028e2b4c00befb9990ad8dfbf6ba7f441b90549035310fb7e8 SHA512 b598a3579c2c41a81a3b3fa68014aa290467f84f0e0600402dd9ee8d93ae19aa43344370e7c53c807a7ae847b6d8a95f78ceaf5ff5eae8fa780715056eb13af2 WHIRLPOOL 014dfdfc30daae955454f7bc421b1f85c22aaf4c4049416a90ca5d7a79ea8e6d327a9101febbdf94f18b48cd1b3864c760c95edf5c58a813fc4786aa2fd4316d +MISC ChangeLog 2585 SHA256 19b576283267a6f042a8bf97d75cda9c346dd6aa6a6ada7997c025f79cd39c9f SHA512 03ef66ad539fc5c69a9e2f1e1475059072e5d87242c3b9f86f3b0e9a23f5181faa23abd3343f3e5cf73602a68e1ba1a8cde3f96d3f0908b41ed0c54b2ddd5dbd WHIRLPOOL 635211558796dcff37d42a48d0839d3c2b55138be343a06b53559ab771df25c8201f68b0980ba09db286d89eac6a6f85b9f03a49f2c035d7ce62fb69815f6725 +MISC ChangeLog-2015 1209 SHA256 833009291ef002ba0662c11c7f89aef024c1340531e7799987b640e454e3a7e1 SHA512 e77e16247940e8f9d78c78bd6da286d65c777dd11c328a6c79de20b75d2b913c340b72835d36d145783ead78f3dff435eeed45229174b97e887949d6cdcc9af1 WHIRLPOOL 6c5af7112b29b3b7db87c26355258edce2a3f66d07fa6778627071bffa2ca342a343b835b28caac6a2004abf844de7a22f5e491f44ca75a6a60d401faeba065c +MISC metadata.xml 166 SHA256 2caff447f5bd2701d8456ada5cc633c41ef4373fa4bfeabeb73599d40bcc941b SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 WHIRLPOOL 1ff70497eca6531f0e0614c72a19f4b8e5ff486a58d369f4f0b36308d1d6b01168f9da887740e3b9f536236be251d3fe05f904d27a9233a7cf613416ba882968 diff --git a/sys-fs/copyfs/copyfs-1.0.1.ebuild b/sys-fs/copyfs/copyfs-1.0.1.ebuild new file mode 100644 index 000000000000..dcec1e63bce8 --- /dev/null +++ b/sys-fs/copyfs/copyfs-1.0.1.ebuild @@ -0,0 +1,43 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="2" + +inherit autotools eutils toolchain-funcs + +DESCRIPTION="fuse-based filesystem for maintaining configuration files" +HOMEPAGE="http://invaders.mars-attacks.org/~boklm/copyfs/" +SRC_URI="${HOMEPAGE}/${P}.tar.bz2" +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~x86 ~amd64 ~ppc" +IUSE="" + +DEPEND=">=sys-fs/fuse-2.0 + sys-apps/attr" +RDEPEND="${DEPEND}" + +src_prepare() { + # this patch fixes sandbox violations + epatch "${FILESDIR}"/${P}-gentoo.patch + + # this patch adds support for cleaning up the versions directory + # the patch is experimental at best, but it's better than your + # versions directory filling up with unused files + # + # patch by stuart@gentoo.org + epatch "${FILESDIR}"/${PN}-1.0-unlink.patch + eautoreconf +} + +src_configure() { + econf --bindir="${D}/usr/bin" --mandir="${D}/usr/share/man" +} + +src_compile() { + emake CC=$(tc-getCC) || die +} + +src_install() { + emake DESTDIR="${D}" install || die +} diff --git a/sys-fs/copyfs/files/copyfs-1.0-unlink.patch b/sys-fs/copyfs/files/copyfs-1.0-unlink.patch new file mode 100644 index 000000000000..f4ee28fae148 --- /dev/null +++ b/sys-fs/copyfs/files/copyfs-1.0-unlink.patch @@ -0,0 +1,158 @@ +diff -u --recursive copyfs-1.0-orig/cache.c copyfs-1.0/cache.c +--- copyfs-1.0-orig/cache.c 2004-12-10 13:34:08.000000000 +0000 ++++ copyfs-1.0/cache.c 2004-12-18 20:30:17.945445677 +0000 +@@ -94,6 +94,61 @@ + } + + /* ++ * Remove metadata from the cache ++ */ ++void cache_remove_metadata(metadata_t *metadata) ++{ ++ version_t * version; ++ ++ int atHead = 1; ++ int atTail = 1; ++ ++ if (NULL == metadata) ++ return ; ++ ++ /* Disconnect it from the list */ ++ if (metadata->md_previous) ++ { ++ metadata->md_previous->md_next = metadata->md_next; ++ atHead = 0; ++ } ++ ++ if (metadata->md_next) ++ { ++ metadata->md_next->md_previous = metadata->md_previous; ++ atTail = 0; ++ } ++ ++ if (atHead) ++ { ++ metadata->md_bucket->b_contents = metadata->md_next; ++ if (metadata->md_next != NULL) ++ metadata->md_next->md_previous = NULL; ++ } ++ ++ metadata->md_bucket->b_count--; ++ if (metadata->md_bucket->b_count == 0) ++ metadata->md_bucket->b_contents = NULL; ++ ++ version = metadata->md_versions; ++ ++ while (NULL != version) ++ { ++ metadata->md_versions = version->v_next; ++ free(version); ++ version = metadata->md_versions; ++ } ++ ++ if (metadata->md_vfile != NULL) ++ free (metadata->md_vfile); ++ ++ if (metadata->md_vpath != NULL) ++ free (metadata->md_vpath); ++ ++ free(metadata); ++} ++ ++/* + * Clean the older items out of the cache to free space. The goal is to + * half the number of items, so that we don't get called constantly. + */ +@@ -122,6 +177,7 @@ + bucket = &cache_hash_table[CACHE_HASH(metadata->md_vfile)]; + metadata->md_previous = NULL; + metadata->md_next = bucket->b_contents; ++ metadata->md_bucket = bucket; + if (bucket->b_contents) + bucket->b_contents->md_previous = metadata; + bucket->b_contents = metadata; +diff -u --recursive copyfs-1.0-orig/cache.h copyfs-1.0/cache.h +--- copyfs-1.0-orig/cache.h 2004-12-10 13:34:08.000000000 +0000 ++++ copyfs-1.0/cache.h 2004-12-18 20:04:32.072307652 +0000 +@@ -11,6 +11,7 @@ + void cache_initialize(void); + void cache_finalize(void); + metadata_t *cache_get_metadata(const char *vpath); ++void cache_remove_metadata(metadata_t *metadata); + void cache_add_metadata(metadata_t *metadata); + int cache_find_maximal_match(char **array, metadata_t **result); + +diff -u --recursive copyfs-1.0-orig/interface.c copyfs-1.0/interface.c +--- copyfs-1.0-orig/interface.c 2004-12-18 20:04:21.560474299 +0000 ++++ copyfs-1.0/interface.c 2004-12-18 20:17:22.367357210 +0000 +@@ -137,6 +137,7 @@ + file = helper_build_composite("-S", "/", entry->d_name + + strlen(METADATA_PREFIX)); + metadata = rcs_translate_to_metadata(file, rcs_version_path); ++ + free(file); + if (metadata && !metadata->md_deleted) + { +@@ -176,18 +177,42 @@ + metadata = rcs_translate_to_metadata(path, rcs_version_path); + if (!metadata || metadata->md_deleted) + return -ENOENT; +- version = rcs_find_version(metadata, LATEST, LATEST); +- if (lstat(version->v_rfile, &st_rfile) == -1) +- return -errno; +- if (S_ISDIR(st_rfile.st_mode)) +- return -EISDIR; ++ ++ /* remove all of the versions that we know about */ ++ ++ version = metadata->md_versions; ++ ++ while (NULL != version) ++ { ++ /* if we can't stat the file, we assume it's already toast */ ++ ++ if (lstat(version->v_rfile, &st_rfile) == 0) ++ { ++ if (S_ISDIR(st_rfile.st_mode)) ++ { ++ return -EISDIR; ++ } ++ ++ if (unlink(version->v_rfile) == -1) ++ return -errno; ++ } ++ ++ /* move on to the next version */ ++ metadata->md_versions = version->v_next; ++ free(version); ++ ++ version = metadata->md_versions; ++ } ++ ++ /* if we get to here, we've released all the versions */ + metadata->md_deleted = 1; + metafile = create_meta_name(metadata->md_vfile, "metadata"); +- if (write_metadata_file(metafile, metadata) == -1) { +- free(metafile); ++ if (unlink(metafile) == -1) + return -errno; +- } + free(metafile); ++ ++ cache_remove_metadata(metadata); ++ + return 0; + } + +diff -u --recursive copyfs-1.0-orig/structs.h copyfs-1.0/structs.h +--- copyfs-1.0-orig/structs.h 2004-12-10 13:34:08.000000000 +0000 ++++ copyfs-1.0/structs.h 2004-12-18 20:04:32.073307446 +0000 +@@ -38,6 +38,8 @@ + + metadata_t *md_next; /* Next file in bucket */ + metadata_t *md_previous; /* Previous " */ ++ ++ bucket_t *md_bucket; /* Our container */ + }; + + struct bucket_t diff --git a/sys-fs/copyfs/files/copyfs-1.0.1-gentoo.patch b/sys-fs/copyfs/files/copyfs-1.0.1-gentoo.patch new file mode 100644 index 000000000000..f0ddfab94af4 --- /dev/null +++ b/sys-fs/copyfs/files/copyfs-1.0.1-gentoo.patch @@ -0,0 +1,46 @@ +--- a/ea.c ++++ b/ea.c +@@ -1,10 +1,11 @@ + #include + #include +-#include ++#include + #include + #include + #include + #include ++#include + + #include "helper.h" + #include "structs.h" +--- a/interface.c ++++ b/interface.c +@@ -23,7 +23,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + +--- a/Makefile.in ++++ b/Makefile.in +@@ -27,7 +27,7 @@ + OBJ = $(SRC:.c=.o) + + CC = gcc +-CFLAGS = -Wall -ansi -W -std=c99 -g -ggdb -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 ++CFLAGS += -Wall -ansi -W -std=c99 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 + LIBS = -lfuse + + all: $(TARGET) +@@ -54,7 +54,7 @@ + rm -rf /tmp/copyfs-dist + + $(TARGET): $(OBJ) +- gcc -o $(TARGET) $(OBJ) $(LIBS) ++ $(CC) $(CFLAGS) $(LDFLAGS) -o $(TARGET) $(OBJ) $(LIBS) + + # Dependencies (use gcc -MM -D_FILE_OFFSET_BITS=64 *.c to regenerate) + diff --git a/sys-fs/copyfs/metadata.xml b/sys-fs/copyfs/metadata.xml new file mode 100644 index 000000000000..6f49eba8f496 --- /dev/null +++ b/sys-fs/copyfs/metadata.xml @@ -0,0 +1,5 @@ + + + + + -- cgit v1.2.3