diff options
author | Stephane Desneux <stephane.desneux@open.eurogiciel.org> | 2014-10-04 11:24:55 +0200 |
---|---|---|
committer | Stephane Desneux <stephane.desneux@open.eurogiciel.org> | 2014-10-04 11:24:55 +0200 |
commit | 1071c301c12500e7aae7b459a61e8fce1e855ff4 (patch) | |
tree | 1787977927d7098b518222339f48c9f1bf83da85 | |
parent | 66fa3556170668cf55d5ea19add14665ed2c5e36 (diff) | |
download | meta-1071c301c12500e7aae7b459a61e8fce1e855ff4.tar.gz meta-1071c301c12500e7aae7b459a61e8fce1e855ff4.tar.bz2 meta-1071c301c12500e7aae7b459a61e8fce1e855ff4.zip |
common-packaging.post: better generation of .repo filessubmit/tizen_common/20141004.092923accepted/tizen/common/20141004.112056
Zypper repo files are now generated using the information
stored in /etc/tizen-build.conf.
This allows to generate 4 repo files with accurate information
whatever the profile, obs repository etc.:
- snapshot: corresponds to the current snapshot
- update: latest snapshot
- daily: latest daily release
- weekly: latest weekly release
Debug repositories are also defined in the same .repo files.
Change-Id: I0ea07d7383499529d74a764de0ec69e9333ae54f
Signed-off-by: Stephane Desneux <stephane.desneux@open.eurogiciel.org>
-rw-r--r-- | scripts/common-packaging.post | 46 |
1 files changed, 34 insertions, 12 deletions
diff --git a/scripts/common-packaging.post b/scripts/common-packaging.post index 1aade3d..11943b1 100644 --- a/scripts/common-packaging.post +++ b/scripts/common-packaging.post @@ -3,25 +3,47 @@ echo "############### common-packaging.post ################" # generate repo files for zypper function genrepo() { - local reponame=$1 - local url=$2 + local url=$1 + local reponame=$2 + local filename=${3:-$2} + local enabled=${4:-0} -cat >> /etc/zypp/repos.d/${reponame}.repo << EOF -[${reponame}] -name=${reponame} -enabled=1 + 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= baseurl=${url}?ssl_verify=no type=rpm-md gpgcheck=0 + EOF } -arch=ia32 -[ -d /usr/lib64 ] && arch=x86_64 +# 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 -# quick fix for TC-1198 -# will not work for emulator32 -genrepo common-wayland-${arch} http://download.tizen.org/snapshots/tizen/common/@BUILD_ID@/repos/${arch}-wayland/packages/ +# 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 |