summaryrefslogtreecommitdiffstats
path: root/functions
blob: 8ecd96802ad25262c74d4b4313cd723149c8eaec (plain)
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
# to be sourced

. /etc/mgatools.conf

function isingroup()
{
    grp="$1"
    for group in `groups`; do
        [ "$grp" = "$group" ] && return 0
    done
    return 1
}

function inlist()
{
    k="$1"
    list="$2"
    for e in $list; do
        [ "$k" = "$e" ] && return 0
    done
    return 1
}

function update_hdlist()
{
    repository="$1"
    fdeps="$repository/../../media_info/file-deps"
    test -f "$fdeps" && ofdeps="--file-deps $fdeps"
    /usr/bin/genhdlist2 -v --versioned --allow-empty-media $ofdeps "$repository"
}

function update_common_MD5SUM()
{
    distrorelease="$1"
    for arch in $arches; do
        pushd "$distribdir/$distrorelease/$arch/media/media_info"
        /usr/bin/md5sum hdlist_* synthesis.* > MD5SUM
        popd
    done
}

function mirror_repository()
{
    distrorelease="$1"
    /usr/bin/rsync $mirror_rsync_options "$distribdir/$distrorelease/" "$finaldistribdir/$distrorelease/"
}