usr.bin/dsynth/pkglist.c
/*
 * Parse a specific list of ports via origin name (portdir/subdir)
 */
Parse a specific list of ports via origin name (portdir/subdir)
Parse a specific list of ports via origin name ( portdir / subdir )
pkg_t *
ParsePackageList(int n, char **ary, int debugstop)
{
	pkg_t *list;
	int i;
	int total;
	total = 0;
	initbulk(childGetPackageInfo, MaxBulk);
	queuebulk("ports-mgmt", "pkg", NULL, "x");
	for (i = 0; i < n; ++i) {
		char *l1;
		char *l2;
		char *l3;
		struct stat st;
		l1 = strdup(ary[i]);
		if (stat(l1, &st) == 0 && S_ISREG(st.st_mode)) {
			total += parsepkglist_file(l1, debugstop);
			continue;
		}
		l2 = strchr(l1, '/');
		if (l2 == NULL) {
			printf("Bad portdir specification: %s\n", l1);
			free(l1);
			continue;
		}
		*l2++ = 0;
		l3 = strchr(l2, '@');
		if (l3)
			*l3++ = 0;
		queuebulk(l1, l2, l3, (debugstop ? "d" : NULL));
		++total;
		free(l1);
	}
	printf("Processing %d ports\n", total);
	list = processPackageListBulk(total);
	return list;
}
pkg_t * ParsePackageList ( int n , char * * ary , int debugstop ) { pkg_t * list ; int i ; int total ; total = 0 ; initbulk ( childGetPackageInfo , MaxBulk ) ; queuebulk ( " " , " " , NULL , " " ) ; for ( i = 0 ; i < n ; ++ i ) { char * l1 ; char * l2 ; char * l3 ; struct stat st ; l1 = strdup ( ary [ i ] ) ; if ( stat ( l1 , & st ) == 0 && S_ISREG ( st . st_mode ) ) { total += parsepkglist_file ( l1 , debugstop ) ; continue ; } l2 = strchr ( l1 , ' ' ) ; if ( l2 == NULL ) { printf ( " \n " , l1 ) ; free ( l1 ) ; continue ; } * l2 ++ = 0 ; l3 = strchr ( l2 , ' ' ) ; if ( l3 ) * l3 ++ = 0 ; queuebulk ( l1 , l2 , l3 , ( debugstop ? " " : NULL ) ) ; ++ total ; free ( l1 ) ; } printf ( " \n " , total ) ; list = processPackageListBulk ( total ) ; return list ; }
Parse a specific list of ports via origin name (portdir/subdir)
Parse a specific list of ports via origin name ( portdir / subdir )
/*
	 * Always include ports-mgmt/pkg.  s4 is "x" meaning not a manual
	 * selection, "d" meaning DEBUGSTOP mode, or NULL.
	 */