📄 release
字号:
#!/bin/bash -xe## Generate a NASM release## Usage: release {test|real} [branch]#if [ -z "$SFUSER" ]; then if [ -f "$HOME/.sfuser" ]; then sfuser=`cat "$HOME/.sfuser"` else sfuser=`whoami` fifiif [ -z "$1" ]; then echo "Usage: $0 {test|real}" 1>&2 exit 1fiif [ "$1" = "real" ]; then real=trueelse real=falsefirm -rf nasm-release.*work=`pwd`/nasm-release.$$mkdir "$work"cd "$work"# SF uses a mirror server for anonymous CVS now. Therefore, use a real# identity if we have one; otherwise, change the "true" below to "$real".if true; then # Need to tag the tree, use real account CVS="cvs -z3 -d ${sfuser}@cvs.nasm.sourceforge.net:/cvsroot/nasm"else # Don't need to tag the tree, can use anonymous echo ':pserver:anonymous@cvs.nasm.sourceforge.net:/cvsroot/nasm A' > "$work"/cvspass export CVS_PASSFILE="$work"/cvspass CVS="cvs -z3 -d :pserver:anonymous@cvs.nasm.sourceforge.net:/cvsroot/nasm"fiif [ -n "$2" ]; then branchopt="-r $2"fi$CVS co $branchopt nasmversion=`cat nasm/version`v1=`echo $version | cut -d. -f1`v2=`echo $version | cut -d. -f2`v3=`echo $version | cut -d. -f3`# Tag the tree as a releaseif $real; then cvstag=nasm-`echo $version | sed -e 's/\./_/g'` # Create the tag for this release ( cd nasm && $CVS tag -F $cvstag ) # Update the LATEST tag $CVS rtag -r $cvstag -F -a LATEST nasmfi# Extract file names which have the -kb flag set, meaning they# are binary filesbins="$work"/binariesrm -f "$bins"cd nasmfind . -type d -name CVS -print | ( while read dir; do xdir=`echo "$dir" | sed -e 's|^\./||' -e 's|/CVS$||'` egrep '^/[^/]*/[^/]*/[^/]*/[^/]*-kb[^/]*/' < $dir/Entries | \ cut -d/ -f2 | sed -e "s|^|$xdir/|" >> "$bins" done)cd ..# We did "co" instead of "export" -- remove CVS directoriesfind nasm -type d -name CVS -print | xargs rm -rf# Create files which are in the release but automatically generatedcd nasmautoheaderautoconf./configure --prefix=/usr/localmake distcd ..# Clean up any previous attemptrm -f ../nasm-${version}.tar.gz ../nasm-${version}-xdoc.tar.gzrm -f ../nasm-${version}.tar.bz2 ../nasm-${version}-xdoc.tar.bz2rm -f ../nasm-${version}.zip ../nasm-${version}-xdoc.zip# Create tarfile (Unix convention: file includes prefix)mv nasm nasm-$versiontar cvvf nasm-${version}.tar nasm-${version}bzip2 -9k nasm-${version}.targzip -9 nasm-${version}.tarmv nasm-${version}.tar.gz nasm-${version}.tar.bz2 ..# Create zipfile (DOS convention: no prefix, convert file endings)cd nasm-$versionzip -9Dlr ../../nasm-${version}.zip -x@"$bins" * # Text fileszip -9Dgr ../../nasm-${version}.zip -i@"$bins" * # Binary filescd ..# Record what we have already generatedfind nasm-$version -not -type d -print > main# Create documentationcd nasm-${version}./configure --prefix=/usr/localmake doc# Remove intermediate files.make cleanercd ..# Remove non-documentationcat main | xargs rm -f# Create doc tarfiletar cvvf nasm-${version}-xdoc.tar nasm-${version}/docbzip2 -9k nasm-${version}-xdoc.targzip -9 nasm-${version}-xdoc.tarmv nasm-${version}-xdoc.tar.gz nasm-${version}-xdoc.tar.bz2 ..# Create doc zipfile (DOS convention: no prefix, convert file endings)# (Note: generating Win .hlp files requires additional tools)cd nasm-${version}zip -9Dlr ../../nasm-${version}-xdoc.zip doc -x \*.pdfzip -9Dgr ../../nasm-${version}-xdoc.zip doc -i \*.pdf# Clean upcd ..rm -rf "$work"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -