From 0ebd6dda30b7d55ff8cdbddf0e1e4eeafc6494ac Mon Sep 17 00:00:00 2001 From: Tollef Fog Heen Date: Wed, 26 Dec 2007 09:58:52 +0100 Subject: [PATCH] Initial prototype for excluding parts of packages This only supports a single, hard-coded file for now, but the initial support is there. --- src/archives.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/archives.c b/src/archives.c index df21d277..3dd715a9 100644 --- a/src/archives.c +++ b/src/archives.c @@ -403,6 +403,26 @@ int tarobject(struct TarInfo *ti) { nifd->namenode->divert && nifd->namenode->divert->useinstead ? nifd->namenode->divert->useinstead->name : ""); + if (strcmp(ti->Name, "./usr/share/doc/pkg-config/copyright") == 0) { + struct filenamenode *fnn = findnamenode(ti->Name, 0); + fnn->flags &= ~fnnf_new_inarchive; + obstack_free(&tar_obs, nifd); + tc->newfilesp= oldnifd; + *oldnifd = 0; + + /* We need to advance the tar file to the next object, so read the + * file data and set it to oblivion. + */ + if ((ti->Type == NormalFile0) || (ti->Type == NormalFile1)) { + char fnamebuf[256]; + fd_null_copy(tc->backendpipe, ti->Size, _("gobble replaced file `%.255s'"),quote_filename(fnamebuf,256,ti->Name)); + r= ti->Size % TARBLKSZ; + if (r > 0) r= safe_read(tc->backendpipe,databuf,TARBLKSZ - r); + } + + return 0; + } + if (nifd->namenode->divert && nifd->namenode->divert->camefrom) { divpkg= nifd->namenode->divert->pkg; -- 2.39.5