def build_unix( self, release_version, cvs_tag, sf_user, temp_dir, win_build_dir ): self.start_step( "unix.export", "Exporting unix copy" ) temp_unix = self.make_temp_platform( temp_dir, "unix" ) os.chdir( temp_unix ) exported_dir = self.cvs_export( sf_user, cvs_tag, release_version, "bash -c \"/usr/bin/%s\"" ) self.correct_executable_permissions( "." ) self.finish_step( "unix.export" ) self.copy_docs_to_unix( os.path.abspath( exported_dir ) , win_build_dir ) if self.start_step( "unix.make_readonly", "Making all files readonly" ): utils.checked_system( [ "chmod -R a-w+r,u+w %s" % temp_unix ] ) utils.checked_system( [ "bash -c /usr/bin/find %s -type d -exec chmod u+w {} ;" % temp_unix ] ) self.finish_step( "unix.make_readonly" ) gz_archive_name = "boost_%s" % release_version + ".tar.gz" if self.start_step( "unix.gz", " Making .gz" ): if os.path.exists( gz_archive_name ): os.unlink( gz_archive_name ) os.system( "tar cfz %s %s" % ( gz_archive_name, "boost_%s" % release_version ) ) self.finish_step( "unix.gz" ) bz2_archive_name = "boost_%s" % release_version + ".tar.bz2" if self.start_step( "unix.bz2", " Making .bz2" ): if os.path.exists( bz2_archive_name ): os.unlink( bz2_archive_name ) os.system( 'bash -c "gunzip -c %s | bzip2 > %s"' % ( gz_archive_name, bz2_archive_name ) ) self.finish_step( "unix.bz2" ) return [ os.path.abspath( x ) for x in ( gz_archive_name, bz2_archive_name ) ]
def generate( output_format ): if self.start_step( "win.make_docs.%s" % output_format, ' Generating %s' % output_format ): utils.checked_system( [ # "set HOME=%s" % my_location "%s -d2 --v2 %s " % ( bjam_path(), output_format ) ] ) self.finish_step( "win.make_docs.%s" % output_format )
def build_win( self, release_version, cvs_tag, sf_user, temp_dir ): if "win.export": self.start_step( "win.export", "Exporting windows copy" ) temp_win = self.make_temp_platform( temp_dir, "win" ) os.chdir( temp_win ) exported_dir = self.cvs_export( sf_user, cvs_tag, release_version ) self.finish_step( "win.export" ) self.make_docs( os.path.abspath( exported_dir ), temp_dir ) if self.start_step( "win.make_readonly", "Making all files writable" ): os.chdir( temp_win ) utils.checked_system( [ "attrib /S -R *.*" ] ) self.finish_step( "win.make_readonly" ) zip_name = "boost_%s.zip" % release_version os.chdir( temp_win ) if self.start_step( "win.zip", " Zipping" ): print " Zipping" if os.path.exists( zip_name ): os.unlink( zip_name ) utils.checked_system( ["7z a -r -tzip %s %s\* > %s" % ( zip_name, "boost_%s" % release_version, zip_name + ".log" ) ] ) self.finish_step( "win.zip" ) return ( os.path.abspath( exported_dir ), [ os.path.abspath( zip_name ) ] )
def untar(archive, user, background): checked_system([ 'cd %s' % os.path.join(site_dir, os.path.dirname(archive)), 'tar -x -z --overwrite --mode=+w -f %s' % os.path.basename(archive), 'rm -f %s' % archive ], user=user, background=background)
def untar( archive, user, background ): checked_system( [ 'cd %s' % os.path.join( site_dir, os.path.dirname( archive ) ) , 'tar -x -z --overwrite --mode=+w -f %s' % os.path.basename( archive ) , 'rm -f %s' % archive ] , user = user , background = background )
def copy_docs_to_unix( self, unix_boost_directory, win_boost_directory ): if self.start_step( "unix.copy_docs", "Copying docs to unix copy" ): doc_directory = os.path.join( unix_boost_directory, "doc" ) doc_html_directory = os.path.join( doc_directory, "html" ) remove_directory( doc_html_directory ) utils.checked_system( [ "cp -R %s %s " % ( os.path.join( win_boost_directory, "doc", "html" ) , doc_html_directory ) ] ) for f in [ "boost.docbook", "boost.fo" ]: utils.checked_system( [ "cp %s %s" % ( os.path.join( win_boost_directory, "doc", f ) , os.path.join( doc_directory, f ) ) ] ) self.remove_x_permission( doc_directory ) boost_build_doc_directory = os.path.join( unix_boost_directory, "tools", "build", "v2", "doc" ) boost_build_doc_html_directory = os.path.join( boost_build_doc_directory, "html" ) remove_directory( boost_build_doc_html_directory ) utils.checked_system( [ "cp -R %s %s " % ( os.path.join( win_boost_directory, "tools", "build", "v2", "doc", "html" ) , boost_build_doc_html_directory ) ] ) for f in [ "userman.pdf" ]: utils.checked_system( [ "cp %s %s " % ( os.path.join( win_boost_directory, "tools", "build", "v2", "doc", f ) , os.path.join( boost_build_doc_directory, f ) ) ] ) self.remove_x_permission( boost_build_doc_directory ) self.finish_step( "unix.copy_docs" )
def make_docs( self, boost_directory, temp_dir ): boostbook_temp = os.path.join( boost_directory, "bin.v2" ) tools_directory = os.path.join( temp_dir, "tools" ) if not os.path.exists( tools_directory ): os.makedirs( tools_directory ) if self.start_step( "win.make_docs.setup_tools", "Setting up BoostBook tools" ): sys.path.append( sys.path[0] + "/../boostbook" ) print sys.path import setup_boostbook os.environ[ "BOOST_ROOT" ] = boost_directory setup_boostbook.setup_boostbook( os.path.join( temp_dir, "tools" ) ) if self.start_step( "win.make_docs.clean", "Clearing \"bin.v2" ): if os.path.exists( boostbook_temp ): shutil.rmtree( boostbook_temp ) self.finish_step( "win.make_docs.clean" ) cd = os.getcwd() os.chdir( os.path.join( boost_directory, "doc" ) ) if self.start_step( "win.make_docs.correct_permissions", "Making html's writable" ): utils.checked_system( [ "cd html" , "attrib -R *" , "cd .." ] ) self.finish_step( "win.make_docs.correct_permissions" ) def generate( output_format ): if self.start_step( "win.make_docs.%s" % output_format, ' Generating %s' % output_format ): utils.checked_system( [ # "set HOME=%s" % my_location "%s -d2 --v2 %s " % ( bjam_path(), output_format ) ] ) self.finish_step( "win.make_docs.%s" % output_format ) generate( "html" ) generate( "docbook" ) generate( "fo" ) if self.start_step( "win.make_docs.copy_docs", "Copying docs into doc directory" ): shutil.copy( os.path.join( boostbook_temp, "doc", self.toolset_, "debug", "boost.docbook" ), "boost.docbook" ) shutil.copy( os.path.join( boostbook_temp, "doc", self.toolset_, "debug", "boost.fo" ), "boost.fo" ) self.finish_step( "win.make_docs.copy_docs" ) if self.start_step( "win.make_docs.clean2", "Copying docs into doc directory" ): shutil.rmtree( boostbook_temp ) shutil.rmtree( "xml" ) self.finish_step( "win.make_docs.clean2" ) if self.start_step( "win.make_docs.bb_userman", "Creating Boost.Build user manual" ): os.chdir( os.path.join( boost_directory, "tools", "build", "v2", "doc" ) ) utils.checked_system( [ # "set HOME=%s" % my_location "%s -d2 --v2 pdf" % bjam_path() ] ) for f in [ "userman.pdf" ]: shutil.copy( find_file( os.path.join( boostbook_temp ), f ), f ) shutil.rmtree( boostbook_temp ) self.finish_step( "win.make_docs.bb_userman" ) if self.start_step( "win.make_docs.clean3", boost_directory ): for i in os.walk( boost_directory ): for f in i[2]: full_path = os.path.join( i[0], f ) if os.path.splitext( f )[1] in [ ".boostbook" ] \ and os.access( full_path, os.W_OK ): os.unlink( full_path ) self.finish_step( "win.make_docs.clean3" )