summaryrefslogtreecommitdiff
path: root/scripts/common-packaging.post
blob: 11943b18d62ae257e8bc7e090768c883a1579fdd (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
#!/bin/sh
echo "############### common-packaging.post ################"

# generate repo files for zypper
function genrepo() {
	local url=$1
	local reponame=$2
	local filename=${3:-$2}
	local enabled=${4:-0}

	local prefix=${TZ_BUILD_VENDOR}-${TZ_BUILD_PROFILE}-${TZ_BUILD_REPO}

	# remove double slashes if any
	url=$(sed -e  's|/\+|/|g' -e 's|:/|://|' <<<$url)

	cat >> /etc/zypp/repos.d/$prefix-${filename}.repo << EOF
[$prefix-${reponame}]
name=$prefix-${reponame}
enabled=$enabled
autorefresh=0
baseurl=${url}?ssl_verify=no
type=rpm-md
gpgcheck=0
 
EOF
}

# source /etc/tizen-build.conf to get more infos about project, repos etc.
. /etc/tizen-build.conf 

# adjust build_id if this scripts executes before the replacement in /etc/tizen-build.conf
TZ_BUILD_ID=$(echo $TZ_BUILD_ID | sed 's|@BUILD_ID[@]|@BUILD_ID@|')

# snapshot repo
genrepo ${TZ_BUILD_SNAPSHOT_URL}/${TZ_BUILD_ID}/repos/${TZ_BUILD_REPO}/packages snapshot snapshot 1
genrepo ${TZ_BUILD_SNAPSHOT_URL}/${TZ_BUILD_ID}/repos/${TZ_BUILD_REPO}/debug snapshot-debug snapshot 1

# latest repo
genrepo ${TZ_BUILD_SNAPSHOT_URL}/latest/repos/${TZ_BUILD_REPO}/packages update update 0
genrepo ${TZ_BUILD_SNAPSHOT_URL}/latest/repos/${TZ_BUILD_REPO}/debug update-debug update 0

# daily repo
genrepo ${TZ_BUILD_DAILY_URL}/latest/repos/${TZ_BUILD_REPO}/packages daily daily 0
genrepo ${TZ_BUILD_DAILY_URL}/latest/repos/${TZ_BUILD_REPO}/debug daily-debug daily 0

# weekly repo
genrepo ${TZ_BUILD_WEEKLY_URL}/latest/repos/${TZ_BUILD_REPO}/packages weekly weekly 0
genrepo ${TZ_BUILD_WEEKLY_URL}/latest/repos/${TZ_BUILD_REPO}/debug weekly-debug weekly 0