tools/userland-incorporator
changeset 1517 a0e586ad53a2
parent 830 bb9a661e5885
child 1591 24aca88f3e99
equal deleted inserted replaced
1516:e0b42d30e1a3 1517:a0e586ad53a2
    17 # fields enclosed by brackets "[]" replaced with your own identifying
    17 # fields enclosed by brackets "[]" replaced with your own identifying
    18 # information: Portions Copyright [yyyy] [name of copyright owner]
    18 # information: Portions Copyright [yyyy] [name of copyright owner]
    19 #
    19 #
    20 # CDDL HEADER END
    20 # CDDL HEADER END
    21 #
    21 #
    22 # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
    22 # Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
    23 #
    23 #
    24 #
    24 #
    25 # incorporator - an utility to incorporate packages in a repo
    25 # incorporator - an utility to incorporate packages in a repo
    26 #
    26 #
    27 
    27 
    36 		  "-p", $publisher, @fmris) ||
    36 		  "-p", $publisher, @fmris) ||
    37                   die "pkg: $!";
    37                   die "pkg: $!";
    38 	while (<$fp>) {
    38 	while (<$fp>) {
    39 
    39 
    40 		# lines should be in the form:
    40 		# lines should be in the form:
    41 		#   publisher   package   [r|o] version,branch:timestamp
    41 		#   publisher   package   [r|o] version,5.12-branch:timestamp
    42 		if (/^(\S+)\s+(\S+)\s+\S?\s+([\d.]+),[\d.]+-([\d.]+):.+$/) {
    42 		# or lines should be in the form:
       
    43 		#   publisher   package   [r|o] version-branch:timestamp
       
    44 		if ((/^(\S+)\s+(\S+)\s+\S?\s+([\d.]+),[\d.]+-([\d.]+):.+$/) ||
       
    45 		   (/^(\S+)\s+(\S+)\s+\S?\s+([\d.]+)-([\d.]+):.+$/)) { 
    43 			my ($package) = ();
    46 			my ($package) = ();
    44 
    47 
    45 			$package->{publisher} = $1;
    48 			$package->{publisher} = $1;
    46 			$package->{name} = $2;
    49 			$package->{name} = $2;
    47 			$package->{version} = $3;
    50 			$package->{version} = $3;
    48 			$package->{branch} = $4;
    51 			$package->{branch} = $4;
    49 
    52 
    50 			push(@packages, $package);
    53 			if ($package->{name} !~ m/incorporation/) {
       
    54 				push(@packages, $package);
       
    55 			} 
    51 		} else {
    56 		} else {
    52 			printf STDERR "SKIP: %s", $_;
    57 			die "cannot handle: ", $_;
    53 		}
    58 		}
    54 	}
    59 	}
    55 
    60 
    56 	#printf "returning %s\n", $_->{name} for (@packages);
    61 	#printf "returning %s\n", $_->{name} for (@packages);
    57 
    62 
    89 printf "set name=info.classification value='org.opensolaris.category.2008:Meta Packages/Incorporations'\n";
    94 printf "set name=info.classification value='org.opensolaris.category.2008:Meta Packages/Incorporations'\n";
    90 
    95 
    91 @packages = enumerate_packages($repository, $consolidation, @fmris);
    96 @packages = enumerate_packages($repository, $consolidation, @fmris);
    92 for (@packages) {
    97 for (@packages) {
    93 	printf "depend fmri=pkg:/%s@%s-%s %s=true type=incorporate\n",
    98 	printf "depend fmri=pkg:/%s@%s-%s %s=true type=incorporate\n",
    94 		%$_->{name}, %$_->{version}, %$_->{branch},
    99 		$_->{name}, $_->{version}, $_->{branch},
    95 		"facet.version-lock.".%$_->{name};
   100 		"facet.version-lock.".$_->{name}; 
    96 }
   101 }