File: travis-init.sh

package info (click to toggle)
libnet-z3950-simpleserver-perl 1.29-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 276 kB
  • sloc: perl: 960; xml: 18; sh: 17; makefile: 5
file content (26 lines) | stat: -rwxr-xr-x 554 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
#!/bin/sh
#
# init IndexData ubuntu deb repository

sources_list_d=/etc/apt/sources.list.d
indexdata_list=indexdata.list
apt_key=http://ftp.indexdata.dk/debian/indexdata.asc
deb_url=http://ftp.indexdata.dk

set -e

init_apt() {
    file="$sources_list_d/$indexdata_list"
    os=ubuntu

    if [ ! -e $file ]; then 
	codename=$(lsb_release -c -s)
        wget -O- $apt_key | sudo apt-key add -
        sudo sh -c "echo deb $deb_url/${os} ${codename} main > $file.tmp"
        sudo mv -f $file.tmp $file
        sudo apt-get update -qq
    fi
}

init_apt