Check-in [41659b4b96]

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

Overview
Comment:make_index: Make jail attachment optional so this can be reused outside of poudriere
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 41659b4b96428c0e8315c28bdb3c04940a3bddca
User & Date: bdrewery 2013-06-01 01:08:52
Context
2013-06-01
01:10
testport: Make errors more clear Reported by: tj@ check-in: c61b908704 user: bdrewery tags: trunk
01:08
make_index: Make jail attachment optional so this can be reused outside of poudriere check-in: 41659b4b96 user: bdrewery tags: trunk
2013-05-31
16:38
Allow DISTFILES_CACHE=PORTSDIR/distfiles again This was disallowed due to 2.x mounting the DISTFILES_CACHE at MNT/usr/ports/distfiles which would mount on top of itself in a read-only ports dir. This is not a problem in 3.x since the distfiles are mounted at MNT/distfiles Reported by: mat check-in: 72609db144 user: bdrewery tags: trunk
Changes

Changes to src/libexec/poudriere/make_index.c.

1
2

3
4
5
6
7
8
9
..
21
22
23
24
25
26
27


28
29
30
31
32
33
34
...
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
...
415
416
417
418
419
420
421

422
423
424















425
426
427
428
429
430
431
432
433
434
435
436
437

438
439
440
441
442
443
444
/*
 * Copyright (c) 2013 David Demelier <demelier.david@gmail.com>

 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
................................................................................
#include <sys/jail.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <err.h>
#include <jail.h>



/*
 * A field, it helps defining the list of fields such as depends
 * in the line. They are usually separated by spaces. We also
 * define a datatype FieldList which contains all fields.
 */
typedef struct Field Field;
................................................................................

	return str;
}

static void
usage(void)
{
	errx(1, "usage: %s jail_name oldindex newindex", getprogname());
}

/* --------------------------------------------------------
 * Field functions
 * -------------------------------------------------------- */

static Port * ports_find(const Ports *, const char *);
................................................................................
/*
 * Parse 'make describe' output into the proper INDEX output
 */
int
main(int argc, char **argv)
{
	Ports ports;

	int jid;
	const char *jail_str;
















	if (argc < 4)
		usage();
		/* NOTREACHED */

	jail_str = argv[1];

	jid = jail_getid(jail_str);
	if (jid < 0)
		errx(1, "%s", jail_errmsg);

	if (jail_attach(jid) == -1)
		err(1, "jail_attach(%s)", jail_str);


	ports_read(&ports, argv[2]);
	ports_write(&ports, argv[3]);
	ports_free(&ports);

	return 0;
}
#include <stdio.h>


>







 







>
>







 







|







 







>

|

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|



|
<
|
|
|

|
|
|
>
|
|





1
2
3
4
5
6
7
8
9
10
..
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
...
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
...
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448

449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
/*
 * Copyright (c) 2013 David Demelier <demelier.david@gmail.com>
 * Copyright (c) 2013 Bryan Drewery <bdrewery@FreeBSD.org>
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
................................................................................
#include <sys/jail.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <err.h>
#include <jail.h>
#include <sysexits.h>
#include <unistd.h>

/*
 * A field, it helps defining the list of fields such as depends
 * in the line. They are usually separated by spaces. We also
 * define a datatype FieldList which contains all fields.
 */
typedef struct Field Field;
................................................................................

	return str;
}

static void
usage(void)
{
	errx(1, "usage: %s [-j jail_name] oldindex newindex", getprogname());
}

/* --------------------------------------------------------
 * Field functions
 * -------------------------------------------------------- */

static Port * ports_find(const Ports *, const char *);
................................................................................
/*
 * Parse 'make describe' output into the proper INDEX output
 */
int
main(int argc, char **argv)
{
	Ports ports;
	int ch;
	int jid;
	const char *jail_str = NULL;

	while ((ch = getopt(argc, argv, "j:")) != -1) {
		switch (ch) {
			case 'j':
				jail_str = optarg;
				break;
			case '?':
			default:
				usage();
				return (EX_USAGE);
		}
	}

	argc -= optind;
	argv += optind;

	if (argc < 2)
		usage();
		/* NOTREACHED */

	if (jail_str != NULL) {

		jid = jail_getid(jail_str);
		if (jid < 0)
			errx(1, "%s", jail_errmsg);

		if (jail_attach(jid) == -1)
			err(1, "jail_attach(%s)", jail_str);
	}

	ports_read(&ports, argv[0]);
	ports_write(&ports, argv[1]);
	ports_free(&ports);

	return 0;
}
#include <stdio.h>

Changes to src/share/poudriere/bulk.sh.

100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
				injail make -C /usr/ports/${ORIGIN} describe >> ${INDEXF}.1
		done

		msg_n "Generating INDEX..."
		# Move temp INDEX file into the jail. make_index will jail_attach()
		# to the specified jail
		mv ${INDEXF}.1 ${MASTERMNT}${INDEXF_JAIL}.1
		make_index ${MASTERNAME} ${INDEXF_JAIL}.1 ${INDEXF_JAIL}
		mv ${MASTERMNT}${INDEXF_JAIL} ${INDEXF}
		echo " done"

		[ -f ${INDEXF}.bz2 ] && rm ${INDEXF}.bz2
		msg_n "Compressing INDEX-${OSMAJ}..."
		bzip2 -9 ${INDEXF}
		echo " done"







|







100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
				injail make -C /usr/ports/${ORIGIN} describe >> ${INDEXF}.1
		done

		msg_n "Generating INDEX..."
		# Move temp INDEX file into the jail. make_index will jail_attach()
		# to the specified jail
		mv ${INDEXF}.1 ${MASTERMNT}${INDEXF_JAIL}.1
		make_index -j ${MASTERNAME} ${INDEXF_JAIL}.1 ${INDEXF_JAIL}
		mv ${MASTERMNT}${INDEXF_JAIL} ${INDEXF}
		echo " done"

		[ -f ${INDEXF}.bz2 ] && rm ${INDEXF}.bz2
		msg_n "Compressing INDEX-${OSMAJ}..."
		bzip2 -9 ${INDEXF}
		echo " done"