@@ -23,7 +23,7 @@ const MANIFEST_PATH: &str = "incorporation.p5m";
2323const REPO_PATH : & str = "incorporation" ;
2424pub const ARCHIVE_PATH : & str = "incorporation.p5p" ;
2525
26- pub const PUBLISHER : & str = "helios-dev " ;
26+ pub const PUBLISHER : & str = "helios" ;
2727
2828pub ( crate ) enum Action {
2929 Generate { version : String } ,
@@ -109,6 +109,23 @@ pub(crate) async fn push_incorporation_jobs(
109109 Ok ( ( ) )
110110}
111111
112+ fn parse_version_id < P : AsRef < Path > > ( path : P ) -> io:: Result < u32 > {
113+ let contents = fs:: read_to_string ( path) ?;
114+
115+ let value = contents
116+ . lines ( )
117+ . find_map ( |line| {
118+ line. strip_prefix ( "VERSION_ID=" ) . map ( |v| v. trim_matches ( '"' ) )
119+ } )
120+ . ok_or_else ( || {
121+ io:: Error :: new ( io:: ErrorKind :: InvalidData , "VERSION_ID not found" )
122+ } ) ?;
123+
124+ value
125+ . parse :: < u32 > ( )
126+ . map_err ( |e| io:: Error :: new ( io:: ErrorKind :: InvalidData , e) )
127+ }
128+
112129async fn generate_incorporation_manifest (
113130 logger : Logger ,
114131 path : Utf8PathBuf ,
@@ -119,9 +136,11 @@ async fn generate_incorporation_manifest(
119136 fmri : String ,
120137 }
121138
139+ let dashrev = parse_version_id ( "/etc/os-release" ) ?;
140+
122141 let mut manifest = BufWriter :: new ( File :: create ( path) . await ?) ;
123142 let preamble = format ! (
124- r#"set name=pkg.fmri value=pkg://{PUBLISHER}/{INCORP_NAME}@{version},5.11
143+ r#"set name=pkg.fmri value=pkg://{PUBLISHER}/{INCORP_NAME}@{version}-{dashrev}.0 ,5.11
125144set name=pkg.summary value="Incorporation to constrain software delivered in Omicron Release V{version} images"
126145set name=info.classification value="org.opensolaris.category.2008:Meta Packages/Incorporations"
127146set name=variant.opensolaris.zone value=global value=nonglobal
0 commit comments