pkgng

Check-in [2a8d78975e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove paking_append_file function
Timelines: family | ancestors | trunk | multi-repos | stash
Files: files | file ages | folders
SHA1: 2a8d78975e1c86d51d3c0c345f50840f203c7488
User & Date: bapt@FreeBSD.org 2013-10-05 17:56:51
Context
2013-10-05
17:56
Remove paking_append_file function Leaf check-in: 2a8d78975e user: bapt@FreeBSD.org tags: trunk, multi-repos, stash
17:43
Make pass mode respect properly @owner/@group In pass mode we need to resolv the uid/gid and enforce them. check-in: 28f1fb4a2b user: bapt@FreeBSD.org tags: trunk, multi-repos, stash
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to libpkg/packing.c.

136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
...
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313

cleanup:
	archive_entry_free(entry);

	return (ret);
}

int
packing_append_file(struct packing *pack, const char *filepath,
    const char *newpath)
{
	return (packing_append_file_attr(pack, filepath, newpath,
	    NULL, NULL, 0));
}

int
packing_append_file_attr(struct packing *pack, const char *filepath,
    const char *newpath, const char *uname, const char *gname, mode_t perm)
{
	int fd;
	char *map;
	int retcode = EPKG_OK;
................................................................................
			 sbuf_clear(sb);
			 /* Strip the prefix to obtain the target path */
			 if (newroot) /* Prepend a root if one is specified */
				  sbuf_cat(sb, newroot);
			 /* +1 = skip trailing slash */
			 sbuf_cat(sb, fts_e->fts_path + treelen + 1);
			 sbuf_finish(sb);
			 packing_append_file(pack, fts_e->fts_name,
			    sbuf_get(sb));
			 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 */







<
<
<
<
<
<
<
<







 







|
|







136
137
138
139
140
141
142








143
144
145
146
147
148
149
...
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305

cleanup:
	archive_entry_free(entry);

	return (ret);
}









int
packing_append_file_attr(struct packing *pack, const char *filepath,
    const char *newpath, const char *uname, const char *gname, mode_t perm)
{
	int fd;
	char *map;
	int retcode = EPKG_OK;
................................................................................
			 sbuf_clear(sb);
			 /* Strip the prefix to obtain the target path */
			 if (newroot) /* Prepend a root if one is specified */
				  sbuf_cat(sb, newroot);
			 /* +1 = skip trailing slash */
			 sbuf_cat(sb, fts_e->fts_path + treelen + 1);
			 sbuf_finish(sb);
			 packing_append_file_attr(pack, fts_e->fts_name,
			    sbuf_get(sb), NULL, NULL, 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 */

Changes to libpkg/private/pkg.h.

351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366

int pkg_annotation_new(struct pkg_note **);
void pkg_annotation_free(struct pkg_note *);

struct packing;

int packing_init(struct packing **pack, const char *path, pkg_formats format);
int packing_append_file(struct packing *pack, const char *filepath,
			const char *newpath);
int packing_append_file_attr(struct packing *pack, const char *filepath,
			     const char *newpath, const char *uname,
			     const char *gname, mode_t perm);
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);







<
<







351
352
353
354
355
356
357


358
359
360
361
362
363
364

int pkg_annotation_new(struct pkg_note **);
void pkg_annotation_free(struct pkg_note *);

struct packing;

int packing_init(struct packing **pack, const char *path, pkg_formats format);


int packing_append_file_attr(struct packing *pack, const char *filepath,
			     const char *newpath, const char *uname,
			     const char *gname, mode_t perm);
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);