File: slovnik_tarball.sh

package info (click to toggle)
stardicter 1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 268 kB
  • sloc: python: 1,047; sh: 124; makefile: 4
file content (69 lines) | stat: -rwxr-xr-x 1,871 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/sh
#
# Script to create tarballs of GNU/FDL Anglicko-Český slovník
#
# Copyright (c) 2006 - 2017 Michal Čihař
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see http://www.gnu.org/licenses/.

set -e

if [ "x$1" = 'x--wrap' ] ; then
    WRAP="$2"
    shift 2
fi

NAME=stardict-english-czech
dir="$NAME-`date +%Y%m%d`"
dira="$dir-ascii"
diran="$dir-ascii-notags"
dirn="$dir-notags"
dirs="$dir-source"

rm -rf $dir
mkdir $dir

$WRAP ./sdgen.py --all --change --write-source --directory $dir "$@" czechenglish

if [ ! -f $dir/README ] ; then
    rm -rf $dir
    exit 0
fi

# Compress
dictzip $dir/*.dict

# Split to separate dirs
rm -rf $dira $dirn $diran $dirs
mkdir $dira
mkdir $dirn
mkdir $diran
mkdir $dirs

cp $dir/README $dira/
cp $dir/README $dirn/
cp $dir/README $diran/
cp $dir/README $dirs/

mv $dir/*-ascii-notags* $diran/
mv $dir/*-ascii* $dira/
mv $dir/*-notags* $dirn/
mv $dir/en-cs.txt $dirs/

# Create tarballs
tar --owner=root --group=root --numeric-owner -czf $dir.tar.gz $dir
tar --owner=root --group=root --numeric-owner -czf $dira.tar.gz $dira
tar --owner=root --group=root --numeric-owner -czf $dirn.tar.gz $dirn
tar --owner=root --group=root --numeric-owner -czf $diran.tar.gz $diran
tar --owner=root --group=root --numeric-owner -czf $dirs.tar.gz $dirs
rm -rf $dir $dira $dirn $diran $dirs