aboutsummaryrefslogtreecommitdiff
path: root/post_process_dist.sh
diff options
context:
space:
mode:
authorkenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2008-12-05 18:05:46 +0000
committerkenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2008-12-05 18:05:46 +0000
commit2f3d8de76795d17b6f3309f7bca5ad5be1f9504d (patch)
tree9a887f8487de901f7fd37ef632f007856ae552d6 /post_process_dist.sh
parent25bc5cdc9c6d2f41a03a3fcbf8d58ef1c0b7edf6 (diff)
downloadprotobuf-2f3d8de76795d17b6f3309f7bca5ad5be1f9504d.tar.gz
protobuf-2f3d8de76795d17b6f3309f7bca5ad5be1f9504d.tar.bz2
protobuf-2f3d8de76795d17b6f3309f7bca5ad5be1f9504d.zip
Submit script used to post-process dist files.
Diffstat (limited to 'post_process_dist.sh')
-rwxr-xr-xpost_process_dist.sh60
1 files changed, 60 insertions, 0 deletions
diff --git a/post_process_dist.sh b/post_process_dist.sh
new file mode 100755
index 00000000..7b2e599d
--- /dev/null
+++ b/post_process_dist.sh
@@ -0,0 +1,60 @@
+#! /bin/sh
+
+# This script takes the result of "make dist" and:
+# 1) Unpacks it.
+# 2) Ensures all contents are user-writable. Some version control systems
+# keep code read-only until you explicitly ask to edit it, and the normal
+# "make dist" process does not correct for this, so the result is that
+# the entire dist is still marked read-only when unpacked, which is
+# annoying. So, we fix it.
+# 3) Convert MSVC project files to MSVC 2005, so that anyone who has version
+# 2005 *or* 2008 can open them. (In version control, we keep things in
+# MSVC 2008 format since that's what we use in development.)
+# 4) Uses the result to create .tar.gz, .tar.bz2, and .zip versions and
+# deposites them in the "dist" directory. In the .zip version, all
+# non-testdata .txt files are converted to Windows-style line endings.
+# 5) Cleans up after itself.
+
+if [ "$1" == "" ]; then
+ echo "USAGE: $1 DISTFILE" >&2
+ exit 1
+fi
+
+if [ ! -e $1 ]; then
+ echo $1": File not found." >&2
+ exit 1
+fi
+
+set -ex
+
+BASENAME=`basename $1 .tar.gz`
+
+# Create a directory called "dist", copy the tarball there and unpack it.
+mkdir dist
+cp $1 dist
+cd dist
+tar zxvf $BASENAME.tar.gz
+rm $BASENAME.tar.gz
+
+# Set the entire contents to be user-writable.
+chmod -R u+w $BASENAME
+
+# Convert the MSVC projects to MSVC 2005 format.
+cd $BASENAME/vsprojects
+./convert2008to2005.sh
+cd ..
+
+# Build the dist again in .tar.gz and .tar.bz2 formats.
+./configure
+make dist-gzip
+make dist-bzip2
+
+# Convert all text files to use DOS-style line endings, then build a .zip
+# distribution.
+todos *.txt */*.txt
+make dist-zip
+
+# Clean up.
+mv $BASENAME.tar.gz $BASENAME.tar.bz2 $BASENAME.zip ..
+cd ..
+rm -rf $BASENAME