File: cizislova_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 (54 lines) | stat: -rwxr-xr-x 1,340 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
#!/bin/sh
#
# Script to create tarballs of Slovník cizích slov
#
# 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

NAME=stardict-czech
dir="$NAME-`date +%Y%m%d`"
dirs="$dir-source"

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

rm -rf $dir
mkdir $dir

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

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

# Compress
dictzip $dir/*.dict

# Split to separate dirs
rm -rf $dirs
mkdir $dirs

cp $dir/README $dirs/

mv $dir/czech.txt $dirs/

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