summaryrefslogtreecommitdiffstats
path: root/functions
blob: 420114546f01e8c9c0d2f0ddba41543afbe8a738 (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
47
48
49
50
51
52
53
54
55
#!/bin/sh

. /etc/mgatools.conf

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

function inlist()
{
    k="$1"
    list="$2"
    for e in $list
    do
	if [ a"$k" = a"$e" ]
	then
	    return 0
	fi
    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/"
}