📄 makedist.sh
字号:
#!/bin/bash# This script creates a source tarball. Unfortunately I can't# figure out a way to simulate 'make dist' with SCons :(PACKAGE=grftoolVERSION=0.9.0TYPE=bz2# Uncomment the next line if you want a tar.gz archive# TYPE=gzDIRS=(. lib lib/zlib tools gtk win32 doc autopackage)PACKAGEDIR=$PACKAGE-$VERSIONADDITIONAL=(Distfiles makedist.sh SConstruct SConscript README.txt TODO.txt LICENSE.txt)export GZIP=--bestexport BZIP2=-9# Bail out on errorerr() { if [ "x$1" != "x" ]; then echo "*** Error: $1" else echo "*** Error" fi exit 1}# Preparation: create the dist folderrm -rf "$PACKAGEDIR" || errmkdir "$PACKAGEDIR" || err# Copy the files to the dist folderprocess() { local TARGET="$PACKAGEDIR/$1/" local IFS=$'\n' local FILES=`cat "$1/Distfiles" 2>/dev/null | sed 's/\r//g'` echo "# Processing $1 :" if ! [ -d "$TARGET" ]; then mkdir -p "$TARGET" || err fi for F in "${ADDITIONAL[@]}"; do if [ -f "$1/$F" ]; then echo "Copying $1/$F" cp "$1/$F" "$TARGET" || err fi done for F in ${FILES[@]}; do echo "Copying $1/$F" cp "$1/$F" "$TARGET" || err done}for D in ${DIRS[@]}; do process "$D"done# Create tarballecho "Creating distribution archive..."if [ "$TYPE" = "gz" ]; then tar -czf "$PACKAGEDIR.tar.gz" "$PACKAGEDIR" || err echo "$PACKAGEDIR.tar.gz"else tar --bzip2 -cf "$PACKAGEDIR.tar.bz2" "$PACKAGEDIR" || err echo "$PACKAGEDIR.tar.bz2"firm -rf "$PACKAGEDIR"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -