source: tags/arb_5.2/util/arb_save

Last change on this file was 6116, checked in by westram, 15 years ago
  • arb_save inserts 'arbsrc_REV' as directory prefix to source-tarball
  • ignore all of names_*.dat
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.1 KB
Line 
1#!/bin/bash
2
3NAME=`date '+arbsrc_%Y_%m_%d__%H_%M.tgz'`
4
5dump_revision() {
6    ./SOURCE_TOOLS/build_info.pl && \
7        grep ARB_SVN_REVISION ./TEMPLATES/svn_revision.h | \
8        perl -ne 'if (/ARB_SVN_REVISION\s+\"(.*)\"/) { $_=$1; s/:/_/; print $_; }'
9}
10
11
12REVISION=`dump_revision`
13REVISION_DIR=arbsrc_$REVISION
14echo REVISION_DIR=$REVISION_DIR
15
16
17rm_noerr() {
18    test -f $1 && rm -f $1 
19}
20cleanup() {
21    # rm_noerr arbsrc.lst
22    rm_noerr arbsrc.lst.tmp
23    test -L $REVISION_DIR && rm $REVISION_DIR
24    true
25}
26
27gen_list() {
28    util/arb_srclst.pl $* > arbsrc.lst.tmp || \
29        ( echo "Failed to build arbsrc.lst" ; echo "To save manually use 'make save2'"; false )
30}
31sort_list() {
32    sort < arbsrc.lst.tmp | perl -pne "s/^\./.\/$REVISION_DIR/g;" > arbsrc.lst
33}
34gen_tarball() {
35    ln -s . $REVISION_DIR && \
36    tar -zcf $NAME --files-from=arbsrc.lst && \
37        ( rm -f arbsrc.tgz ; \
38        ln -s $NAME arbsrc.tgz ; \
39        true )
40}
41
42save() {
43    gen_list $* && sort_list && gen_tarball
44}
45
46(save $* && cleanup && (ls -alG -rt arbsrc*;true)) || \
47(cleanup;echo "Failed to create source tarball";false)
Note: See TracBrowser for help on using the repository browser.