Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
packing: remove never used function
Baptiste Daroussin committed 4 years ago
commit b1bb8059253737d77dc7f3c6f426022946ae72ae
parent 111e3dd
2 files changed +0 -55
modified libpkg/packing.c
@@ -278,59 +278,6 @@ cleanup:
	return (retcode);
}

-
int
-
packing_append_tree(struct packing *pack, const char *treepath,
-
    const char *newroot)
-
{
-
	FTS *fts = NULL;
-
	FTSENT *fts_e = NULL;
-
	size_t treelen;
-
	xstring *sb = NULL;
-
	char *paths[2] = { __DECONST(char *, treepath), NULL };
-

-
	treelen = strlen(treepath);
-
	fts = fts_open(paths, FTS_PHYSICAL | FTS_XDEV, NULL);
-
	if (fts == NULL)
-
		goto cleanup;
-

-
	while ((fts_e = fts_read(fts)) != NULL) {
-
		xstring_renew(sb);
-
		switch(fts_e->fts_info) {
-
		case FTS_D:
-
		case FTS_DEFAULT:
-
		case FTS_F:
-
		case FTS_SL:
-
		case FTS_SLNONE:
-
			 /* Entries not within this tree are irrelevant. */
-
			 if (fts_e->fts_pathlen <= treelen)
-
				  break;
-
			 xstring_reset(sb);
-
			 /* Strip the prefix to obtain the target path */
-
			 if (newroot) /* Prepend a root if one is specified */
-
				  fputs(newroot, sb->fp);
-
			 /* +1 = skip trailing slash */
-
			 fputs(fts_e->fts_path + treelen + 1, sb->fp);
-
			 fflush(sb->fp);
-
			 packing_append_file_attr(pack, fts_e->fts_name,
-
			    sb->buf, NULL, NULL, 0, 0);
-
			 break;
-
		case FTS_DC:
-
		case FTS_DNR:
-
		case FTS_ERR:
-
		case FTS_NS:
-
			 /* XXX error cases, check fts_e->fts_errno and
-
			  *     bubble up the call chain */
-
			 break;
-
		default:
-
			 break;
-
		}
-
	}
-
	xstring_free(sb);
-
cleanup:
-
	fts_close(fts);
-
	return EPKG_OK;
-
}
-

void
packing_finish(struct packing *pack)
{
modified libpkg/private/pkg.h
@@ -686,8 +686,6 @@ int packing_append_file_attr(struct packing *pack, const char *filepath,
     u_long fflags);
int packing_append_buffer(struct packing *pack, const char *buffer,
			  const char *path, int size);
-
int packing_append_tree(struct packing *pack, const char *treepath,
-
			const char *newroot);
void packing_get_filename(struct packing *pack, const char *filename);
void packing_finish(struct packing *pack);
pkg_formats packing_format_from_string(const char *str);