From owner-freebsd-ports Sat Oct 14 11:51:53 2000 Delivered-To: freebsd-ports@freebsd.org Received: from puck.firepipe.net (mcut-b-167.resnet.purdue.edu [128.211.209.167]) by hub.freebsd.org (Postfix) with ESMTP id 55E0237B670; Sat, 14 Oct 2000 11:51:49 -0700 (PDT) Received: by puck.firepipe.net (Postfix, from userid 1000) id 6222C190F; Sat, 14 Oct 2000 13:52:38 -0500 (EST) Date: Sat, 14 Oct 2000 13:52:38 -0500 From: Will Andrews To: Will Andrews Cc: Satoshi - Ports Wraith - Asami , Ade Lovett , Jim Mock , ports@FreeBSD.ORG Subject: Re: New GNOME hacks, etc. Message-ID: <20001014135238.T95891@puck.firepipe.net> Reply-To: Will Andrews Mail-Followup-To: Will Andrews , Satoshi - Ports Wraith - Asami , Ade Lovett , Jim Mock , ports@FreeBSD.ORG References: <20001011134155.A1323@envy.geekhouse.net> <20001011161408.J48659@FreeBSD.org> <20001014075255.M95891@puck.firepipe.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="RnlQjJ0d97Da+TV1" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20001014075255.M95891@puck.firepipe.net>; from will@physics.purdue.edu on Sat, Oct 14, 2000 at 07:52:55AM -0500 X-Operating-System: FreeBSD 4.1-STABLE i386 Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org --RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Oct 14, 2000 at 07:52:55AM -0500, Will Andrews wrote: > I'm on it. :-) Done. This hasn't been tested very well, other than that it compiles cleanly. However, I'd like to see a patch for bsd.port.mk first, then perhaps MTREE_FILES+= for KDE & GNOME ports. Probably it should be tested on bento to make sure it doesn't break the current method of doing things. BTW, I think the *_file() functions in lib/file.c are HACKSHACKSHACKS! *nudge jkh ;-)* -- Will Andrews - Physics Computer Network wench The Universal Answer to All Problems - "It has something to do with physics." -- Comic on door of Room 240, Physics Building, Purdue University http://puck.firepipe.net/will/rm240.jpg --RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="mtreecreate.diff" ? create/.main.c.swp Index: create/create.h =================================================================== RCS file: /project/cvs/FreeBSD/src/usr.sbin/pkg_install/create/create.h,v retrieving revision 1.15 diff -u -u -r1.15 create.h --- create.h 1999/08/28 01:17:58 1.15 +++ create.h 2000/10/14 18:47:34 @@ -35,7 +35,7 @@ extern char *Require; extern char *SrcDir; extern char *ExcludeFrom; -extern char *Mtree; +extern char *Mtree[]; extern char *Pkgdeps; extern char PlayPen[]; extern int Dereference; Index: create/main.c =================================================================== RCS file: /project/cvs/FreeBSD/src/usr.sbin/pkg_install/create/main.c,v retrieving revision 1.21 diff -u -u -r1.21 main.c --- main.c 1999/08/28 01:17:58 1.21 +++ main.c 2000/10/14 18:47:34 @@ -32,7 +32,7 @@ char *Contents = NULL; char *Require = NULL; char *ExcludeFrom = NULL; -char *Mtree = NULL; +char *Mtree[] = { NULL }; char *Pkgdeps = NULL; char PlayPen[FILENAME_MAX]; int Dereference = 0; @@ -44,7 +44,7 @@ main(int argc, char **argv) { int ch; - char **pkgs, **start; + char **pkgs, **start, **tmpPtr; pkgs = start = argv; while ((ch = getopt(argc, argv, Options)) != -1) @@ -122,7 +122,10 @@ break; case 'm': - Mtree = optarg; + for (tmpPtr = Mtree; (*tmpPtr = strsep(&optarg, ",")) != NULL;) + if (**tmpPtr != '\0') + if (++tmpPtr >= &Mtree[sizeof(Mtree)/sizeof(char *)]) + break; break; case 'P': Index: create/perform.c =================================================================== RCS file: /project/cvs/FreeBSD/src/usr.sbin/pkg_install/create/perform.c,v retrieving revision 1.49 diff -u -u -r1.49 perform.c --- perform.c 1999/08/28 01:17:58 1.49 +++ perform.c 2000/10/14 18:47:34 @@ -44,7 +44,7 @@ char *cp; FILE *pkg_in, *fp; Package plist; - int len; + int len, i; char *suf; int compress = 0; @@ -183,8 +183,8 @@ add_plist(&plist, PLIST_FILE, DISPLAY_FNAME); add_plist(&plist, PLIST_DISPLAY, DISPLAY_FNAME); } - if (Mtree) { - copy_file(home, Mtree, MTREE_FNAME); + for (i = 0 ; Mtree[i] != NULL ; i++) { + cat_file(home, Mtree[i], MTREE_FNAME); add_plist(&plist, PLIST_IGNORE, NULL); add_plist(&plist, PLIST_FILE, MTREE_FNAME); add_plist(&plist, PLIST_MTREE, MTREE_FNAME); @@ -291,7 +291,7 @@ fprintf(totar, "%s\n", REQUIRE_FNAME); if (Display) fprintf(totar, "%s\n", DISPLAY_FNAME); - if (Mtree) + if (Mtree[0] != NULL) fprintf(totar, "%s\n", MTREE_FNAME); for (p = plist->head; p; p = p->next) { Index: lib/file.c =================================================================== RCS file: /project/cvs/FreeBSD/src/usr.sbin/pkg_install/lib/file.c,v retrieving revision 1.40.2.3 diff -u -u -r1.40.2.3 file.c --- file.c 2000/09/20 08:53:55 1.40.2.3 +++ file.c 2000/10/14 18:47:34 @@ -361,6 +361,21 @@ } void +cat_file(char *dir, char *fname, char *to) +{ + char cmd[FILENAME_MAX]; + + if (fname[0] == '/') + snprintf(cmd, FILENAME_MAX, "cat %s >> %s", fname, to); + else + snprintf(cmd, FILENAME_MAX, "cat %s/%s > %s", dir, fname, to); + if (vsystem(cmd)) { + cleanup(0); + errx(2, "could not perform '%s'", cmd); + } +} + +void move_file(char *dir, char *fname, char *to) { char cmd[FILENAME_MAX]; --RnlQjJ0d97Da+TV1-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message