diff options
author | V3n3RiX <venerix@koprulu.sector> | 2021-10-08 23:06:07 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2021-10-08 23:06:07 +0100 |
commit | e23a08d0c97a0cc415aaa165da840b056f93c997 (patch) | |
tree | 4c5f7db60483518201fef36f8cc0712789a08db2 /app-arch/tarsync | |
parent | 391b5b359a346aff490103da7dddc85047f83830 (diff) |
gentoo resync : 08.10.2021
Diffstat (limited to 'app-arch/tarsync')
-rw-r--r-- | app-arch/tarsync/Manifest | 2 | ||||
-rw-r--r-- | app-arch/tarsync/files/tarsync-0.2.1-symlink.patch | 139 | ||||
-rw-r--r-- | app-arch/tarsync/tarsync-0.2.1-r2.ebuild | 34 |
3 files changed, 175 insertions, 0 deletions
diff --git a/app-arch/tarsync/Manifest b/app-arch/tarsync/Manifest index 788bf7152f10..05829ff60179 100644 --- a/app-arch/tarsync/Manifest +++ b/app-arch/tarsync/Manifest @@ -1,5 +1,7 @@ AUX tarsync-0.2.1-gcc5.patch 2069 BLAKE2B eaa4c529c95caa2d70eda5c9a6901cc92ca3e885a0fd2ef3c4df1a6e53d6b1febe8aba4a043844dd31334aea0d58df964152c1245cccdc112658d2bdc229cf1e SHA512 f62fa7f65e506d34d6f9a90579cda2e0568da55cd11c0926dc8f39b5f3d0f4952e6984bd4b6913f3bff938271d37e689e2b8168f393382a04ae269aafbebcd8c AUX tarsync-0.2.1-make.patch 295 BLAKE2B e8356136db5fa470d65691703c57a3fe86fc04857407cb99effe7a0aecfd0822dfbfcf37d6a6413c59d1aaef83df14b02e2d9342618cf849b90baddedaddab09 SHA512 ce1449e91dabb54f82535669010662237878c1e843c4f4505333cfdc4accd3c3923887f564c63ad3e5a91474878d05176103a83f65d9d82fde42ed3edf965bad +AUX tarsync-0.2.1-symlink.patch 4136 BLAKE2B f62da5293228efe173631e14c4edccb61d3ad4ad922e293ee0af77ccc60258509ee22720045d8fd2cfbb58e781ab215c834bc6904ca8864d5a8134271c57a754 SHA512 b52f24b4d3c17178a25e2d1b9299bed06e398512d0d05f866828c207bbd578b344ff071acdd09e159812cc962ac7a1931462dc67c9347e4e286164115ccf29f4 DIST tarsync-0.2.1.tar.bz2 13593 BLAKE2B 4841d501587c8d4932031fe939fce9f41019622af2a4253bfe12c01160956e7eaeebf5ff00174332dce6b17ae150ead42b7c1a57483f948ba191b5c3943f6596 SHA512 bebf8e495ad196c002414c41f9fe9737b5300de18b7c3b16576a7d3bfd94608f36f1b86cb6ed4879c600b71c7706255d9b2d4140b73c5743a473fa2500dbca2d EBUILD tarsync-0.2.1-r1.ebuild 644 BLAKE2B 9acccec023866ba2fc292a39b3188223ad9da173551518a1b816805f9eff837154f978b4af2e4fe6469c5a3ee96cdd9d6b349ce600f1f78171ab56e090292e6c SHA512 7eca8c473f3f1e6970c954eea0fbccbb42859f60f3cd57a3f8ad650a5c301106e8a98b75fda2e6a64351eab39bfd23159a26d380e7ad453f37c7c1a9e44f7b7b +EBUILD tarsync-0.2.1-r2.ebuild 681 BLAKE2B 1531a46317024f461dba4eac46e9eb6cf9b2041905acc9837f65970be01152baa90ad2d69df12e7f67c635f2ec8988e9ff693fbf62c1fcc65ba57493fd056cbd SHA512 9b47422ffeda01db5daa775c61870be96670fb0e1f59af1bd5c147527ba5dd65e6921820f1406c5ac6c6c3d4a0fcd6703dcac5acf9eb04d9162358b9981cd461 MISC metadata.xml 167 BLAKE2B 868e3b584722eaacf68273db062bb773d8c7e5d7ab2b81ca7e8397643bf7cc106c3a1033594401c99c54f667bb45d6b73f9048fc335580bbd44b4589ad26a832 SHA512 30caadd1496c3b9969136038239a1d8e01f236726b4022c2d7e19ca7575f25f735e556835e581afbf44fbd3e4104c40f2b5ef5fa70118d75c881fdf871962d0a diff --git a/app-arch/tarsync/files/tarsync-0.2.1-symlink.patch b/app-arch/tarsync/files/tarsync-0.2.1-symlink.patch new file mode 100644 index 000000000000..cb0efd01b1ba --- /dev/null +++ b/app-arch/tarsync/files/tarsync-0.2.1-symlink.patch @@ -0,0 +1,139 @@ +From 6654d41a14da2fc521e889f01669f0dbb89aef15 Mon Sep 17 00:00:00 2001 +From: Zac Medico <zmedico@gentoo.org> +Date: Tue, 5 Oct 2021 23:21:53 -0700 +Subject: [PATCH] Symlink support + +Bug: https://bugs.gentoo.org/815823 +Signed-off-by: Zac Medico <zmedico@gentoo.org> +--- + main.c | 37 +++++++++++++++++++++++++++++++++++-- + tar.c | 16 ++++++++++++++-- + tar.h | 2 ++ + 3 files changed, 51 insertions(+), 4 deletions(-) + +diff --git a/main.c b/main.c +index 2c2da3e..448a9d0 100644 +--- a/main.c ++++ b/main.c +@@ -257,7 +257,14 @@ main(int argc, char **argv) + // no need to seek. cfile handles resetting streams as needed + + for(x=0; x < missing_count; x++) { +- if(copy_whole_file(&tar_cfh, missing[x]) != 0) { ++ if (missing[x]->type == SYMTYPE) { ++ if(copy_symlink(&tar_cfh, missing[x]) != 0) { ++ v0printf("failed transfering symlink %s\n", missing[x]->fullname); ++ exit(9); ++ } ++ continue; ++ } ++ else if(copy_whole_file(&tar_cfh, missing[x]) != 0) { + v0printf("failed transfering file %s\n", missing[x]->fullname); + exit(9); + } +@@ -673,6 +680,8 @@ int + check_existing_node(const struct dirent *de, const tar_entry *t, struct stat *st) + { + int type; ++ unsigned char linkname[TAR_LINKNAME_LEN]; ++ ssize_t linkname_len; + type = convert_lstat_type_tar_type(de->d_name, st); + if(type < 0) + return -1; +@@ -682,6 +691,15 @@ check_existing_node(const struct dirent *de, const tar_entry *t, struct stat *st + return 2; + if(REGTYPE == type && (st->st_size != t->size || (check_mtime && t->mtime != st->st_mtime))) + return 3; ++ if (SYMTYPE == type) { ++ if ((linkname_len = readlink(de->d_name, linkname, TAR_LINKNAME_LEN)) == -1) { ++ return -1; ++ } ++ if(strncmp((const char *)linkname, (const char *)t->linkname, linkname_len) != 0) { ++ remove_node(de->d_name, st); ++ return 3; ++ } ++ } + return 0; + } + +@@ -703,7 +721,22 @@ enforce_owner(const char *path, const tar_entry *t, struct stat *st) + } + return 0; + } +- ++ ++int ++copy_symlink(cfile *tar_cfh, const tar_entry *ttent) ++{ ++ v1printf("creating %s\n", ttent->fullname); ++ ++ if (symlink(ttent->linkname, ttent->fullname) != 0) { ++ v0printf("failed creating symlink %s -> %s\n", ttent->fullname, ttent->linkname); ++ return -1; ++ } ++ if(lchown(ttent->fullname, ttent->uid, ttent->gid) != 0) { ++ v0printf("failed chown'ing %s\n", ttent->fullname); ++ return -1; ++ } ++ return 0; ++} + + int + copy_whole_file(cfile *tar_cfh, const tar_entry *ttent) +diff --git a/tar.c b/tar.c +index 42dc8e7..514e5fb 100644 +--- a/tar.c ++++ b/tar.c +@@ -214,8 +214,7 @@ read_entry(cfile *src_cfh, off_u64 start, tar_entry *entry) + case AREGTYPE: + entry->type = REGTYPE; break; + case SYMTYPE: +- v0printf("symlinks not supported\n"); +- entry->type = TTAR_UNSUPPORTED_TYPE; break; ++ entry->type = SYMTYPE; break; + case LNKTYPE: + v0printf("hardlinks not supported!\n"); + entry->type = TTAR_UNSUPPORTED_TYPE; break; +@@ -242,6 +241,17 @@ read_entry(cfile *src_cfh, off_u64 start, tar_entry *entry) + if(get_uid(block + TAR_UNAME_LOC, &entry->uid)) + entry->uid = octal_str2long(block + TAR_UID_LOC, TAR_UID_LOC); + ++ if (entry->type == SYMTYPE) { ++ name_len = strnlen((char *)block + TAR_LINKNAME_LOC, TAR_LINKNAME_LEN); ++ if((entry->linkname = (char *)malloc(name_len + 1)) == NULL){ ++ v0printf("unable to allocate needed memory, bailing\n"); ++ return MEM_ERROR; ++ } ++ memcpy(entry->linkname, block + TAR_LINKNAME_LOC, name_len); ++ entry->linkname[name_len] = '\0'; ++ entry->linkname_len = name_len; ++ } ++ + // if(entry->end % 512) + // entry->end += 512 - (entry->end % 512); + return 0; +@@ -256,6 +266,8 @@ convert_lstat_type_tar_type(const char *path, struct stat *st) + if(S_ISREG(st->st_mode)) { + if(st->st_nlink == 1) + return REGTYPE; ++ } else if(S_ISLNK(st->st_mode)) { ++ return SYMTYPE; + } else if(S_ISDIR(st->st_mode)) + return DIRTYPE; + +diff --git a/tar.h b/tar.h +index e9d9ee9..95f957c 100644 +--- a/tar.h ++++ b/tar.h +@@ -78,6 +78,8 @@ typedef struct { + off_u64 size; + unsigned int fullname_len; + char *fullname; ++ unsigned int linkname_len; ++ char *linkname; + time_t mtime; + uid_t uid; + gid_t gid; +-- +2.32.0 + diff --git a/app-arch/tarsync/tarsync-0.2.1-r2.ebuild b/app-arch/tarsync/tarsync-0.2.1-r2.ebuild new file mode 100644 index 000000000000..295c7e7cbef1 --- /dev/null +++ b/app-arch/tarsync/tarsync-0.2.1-r2.ebuild @@ -0,0 +1,34 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit toolchain-funcs + +DESCRIPTION="Delta compression suite for using/generating binary patches" +HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage" +SRC_URI="mirror://gentoo/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~hppa ~ppc ~x86 ~amd64-linux" + +DEPEND=">=dev-util/diffball-0.7" +RDEPEND="${DEPEND}" + +S="${WORKDIR}/${PN}" + +PATCHES=( + "${FILESDIR}"/${P}-make.patch + "${FILESDIR}"/${P}-gcc5.patch + "${FILESDIR}"/${P}-symlink.patch +) + +src_configure() { + tc-export CC +} + +src_install() { + dobin tarsync #make install doesn't support prefix + einstalldocs +} |