File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ tmp/dist/$$(SRC_PKG_NAME)-image: $(PKG_FILES)
7676 @$(call E, making src image)
7777 $(Q ) rm -Rf tmp/dist/$(SRC_PKG_NAME ) -image
7878 $(Q ) mkdir -p tmp/dist/$(SRC_PKG_NAME ) -image/lib/rustlib/src/rust
79+ $(Q ) echo " $( CFG_VERSION) " > tmp/dist/$(SRC_PKG_NAME ) -image/lib/rustlib/src/rust/version
7980 $(Q ) tar \
8081 -C $(S) \
8182 -f - \
Original file line number Diff line number Diff line change @@ -388,6 +388,9 @@ pub fn rust_src(build: &Build) {
388388 // Rename directory, so that root folder of tarball has the correct name
389389 t ! ( fs:: rename( & dst_src, & plain_dst_src) ) ;
390390
391+ // Create the version file
392+ write_file ( & plain_dst_src. join ( "version" ) , build. version . as_bytes ( ) ) ;
393+
391394 // Create plain source tarball
392395 let mut cmd = Command :: new ( "tar" ) ;
393396 cmd. arg ( "-czf" ) . arg ( sanitize_sh ( & distdir ( build) . join ( & format ! ( "{}.tar.gz" , plain_name) ) ) )
@@ -431,3 +434,8 @@ fn sanitize_sh(path: &Path) -> String {
431434 Some ( format ! ( "/{}/{}" , drive, & s[ drive. len_utf8( ) + 2 ..] ) )
432435 }
433436}
437+
438+ fn write_file ( path : & Path , data : & [ u8 ] ) {
439+ let mut vf = t ! ( fs:: File :: create( path) ) ;
440+ t ! ( vf. write_all( data) ) ;
441+ }
You can’t perform that action at this time.
0 commit comments