commit 2a20431e04861ba4ad359cfc5a35981fdc32b432 Author: Misha Bergal Date: Fri Oct 29 12:55:18 2004 +0000 Some automation for making release tarballs [SVN r25947] diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..3e84d7c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,96 @@ +* text=auto !eol svneol=native#text/plain +*.gitattributes text svneol=native#text/plain + +# Scriptish formats +*.bat text svneol=native#text/plain +*.bsh text svneol=native#text/x-beanshell +*.cgi text svneol=native#text/plain +*.cmd text svneol=native#text/plain +*.js text svneol=native#text/javascript +*.php text svneol=native#text/x-php +*.pl text svneol=native#text/x-perl +*.pm text svneol=native#text/x-perl +*.py text svneol=native#text/x-python +*.sh eol=lf svneol=LF#text/x-sh +configure eol=lf svneol=LF#text/x-sh + +# Image formats +*.bmp binary svneol=unset#image/bmp +*.gif binary svneol=unset#image/gif +*.ico binary svneol=unset#image/ico +*.jpeg binary svneol=unset#image/jpeg +*.jpg binary svneol=unset#image/jpeg +*.png binary svneol=unset#image/png +*.tif binary svneol=unset#image/tiff +*.tiff binary svneol=unset#image/tiff +*.svg text svneol=native#image/svg%2Bxml + +# Data formats +*.pdf binary svneol=unset#application/pdf +*.avi binary svneol=unset#video/avi +*.doc binary svneol=unset#application/msword +*.dsp text svneol=crlf#text/plain +*.dsw text svneol=crlf#text/plain +*.eps binary svneol=unset#application/postscript +*.gz binary svneol=unset#application/gzip +*.mov binary svneol=unset#video/quicktime +*.mp3 binary svneol=unset#audio/mpeg +*.ppt binary svneol=unset#application/vnd.ms-powerpoint +*.ps binary svneol=unset#application/postscript +*.psd binary svneol=unset#application/photoshop +*.rdf binary svneol=unset#text/rdf +*.rss text svneol=unset#text/xml +*.rtf binary svneol=unset#text/rtf +*.sln text svneol=native#text/plain +*.swf binary svneol=unset#application/x-shockwave-flash +*.tgz binary svneol=unset#application/gzip +*.vcproj text svneol=native#text/xml +*.vcxproj text svneol=native#text/xml +*.vsprops text svneol=native#text/xml +*.wav binary svneol=unset#audio/wav +*.xls binary svneol=unset#application/vnd.ms-excel +*.zip binary svneol=unset#application/zip + +# Text formats +.htaccess text svneol=native#text/plain +*.bbk text svneol=native#text/xml +*.cmake text svneol=native#text/plain +*.css text svneol=native#text/css +*.dtd text svneol=native#text/xml +*.htm text svneol=native#text/html +*.html text svneol=native#text/html +*.ini text svneol=native#text/plain +*.log text svneol=native#text/plain +*.mak text svneol=native#text/plain +*.qbk text svneol=native#text/plain +*.rst text svneol=native#text/plain +*.sql text svneol=native#text/x-sql +*.txt text svneol=native#text/plain +*.xhtml text svneol=native#text/xhtml%2Bxml +*.xml text svneol=native#text/xml +*.xsd text svneol=native#text/xml +*.xsl text svneol=native#text/xml +*.xslt text svneol=native#text/xml +*.xul text svneol=native#text/xul +*.yml text svneol=native#text/plain +boost-no-inspect text svneol=native#text/plain +CHANGES text svneol=native#text/plain +COPYING text svneol=native#text/plain +INSTALL text svneol=native#text/plain +Jamfile text svneol=native#text/plain +Jamroot text svneol=native#text/plain +Jamfile.v2 text svneol=native#text/plain +Jamrules text svneol=native#text/plain +Makefile* text svneol=native#text/plain +README text svneol=native#text/plain +TODO text svneol=native#text/plain + +# Code formats +*.c text svneol=native#text/plain +*.cpp text svneol=native#text/plain +*.h text svneol=native#text/plain +*.hpp text svneol=native#text/plain +*.ipp text svneol=native#text/plain +*.tpp text svneol=native#text/plain +*.jam text svneol=native#text/plain +*.java text svneol=native#text/plain diff --git a/make_tarballs.py b/make_tarballs.py new file mode 100644 index 0000000..fe1202c --- /dev/null +++ b/make_tarballs.py @@ -0,0 +1,88 @@ +import sys +import os +import shutil + +import optparse + + +dont_export = 0 + +def accept_args( args ): + return ( args[0], args[1], args[2], args[3] ) + + +def clean_directory( directory ): + if os.path.exists( directory ): + print " Removing directory %s" % directory + os.system( 'rd /s /q "%s"' % directory ) + + print " Creating directory %s" % directory + os.makedirs( directory ) + +def make_temp_platform( temp, platform ): + temp_platform = os.path.join( temp, platform ) + if not dont_export: + clean_directory( temp_platform ) + return temp_platform + +def cvs_export( sf_user, cvs_tag, release_version, shell = "%s" ): + if not dont_export: + print " Exporting..." + cvs_export_template = 'cvs -d:ext:%(user)s@cvs.sourceforge.net:/cvsroot/boost -z9 export -r %(branch)s boost' + + cmd = cvs_export_template % { "user": sf_user + , "branch" : cvs_tag } + + os.system( shell % cmd ) + os.system( "del /S/F/Q .cvsignore >nul" ) + os.rename( "boost", "boost_%s" % release_version ) + + +def build_win( release_version, cvs_tag, sf_user, temp_dir ): + print "Preparing windows .zip" + temp_win = make_temp_platform( temp_dir, "win" ) + os.chdir( temp_win ) + + cvs_export( sf_user, cvs_tag, release_version ) + + print " Zipping" + zip_name = "boost_%s.zip" % release_version + if os.path.exists( zip_name ): os.unlink( zip_name ) + + os.system( "7z a -r -tzip %s %s\* > %s" % ( os.path.splitext( zip_name )[0], "boost_%s" % release_version, zip_name + ".log" ) ) + return [ os.path.abspath( zip_name ) ] + +def build_unix( release_version, cvs_tag, sf_user, temp_dir ): + print "Preparing unix .gz and .bz2" + temp_unix = make_temp_platform( temp_dir, "unix" ) + os.chdir( temp_unix ) + + cvs_export( sf_user, cvs_tag, release_version, "bash -c \"%s\"" ) + + print " Making .gz" + gz_archive_name = "boost_%s" % release_version + ".tar.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 ) ) + + bz2_archive_name = "boost_%s" % release_version + ".tar.bz2" + if os.path.exists( bz2_archive_name ): os.unlink( bz2_archive_name ) + + print " Making .bz2" + os.system( 'bash -c "gunzip -c %s | bzip2 > %s"' % ( gz_archive_name, bz2_archive_name ) ) + return [ os.path.abspath( x ) for x in ( gz_archive_name, bz2_archive_name ) ] + +def main(): + start_dir = os.getcwd() + ( release_version, cvs_tag, sf_user, temp_dir ) = accept_args( sys.argv[ 1: ] ) + + archives = build_unix( release_version, cvs_tag, sf_user, temp_dir ) +## build_win( release_version, cvs_tag, sf_user, temp_dir )\ + + + os.chdir( start_dir ) + for archive in archives: + shutil.copy( archive, start_dir ) + +if __name__ == "__main__": + main()