ceph/tasks/buildpackages/common.sh
Loic Dachary 970a37226f buildpackages: fetch tags from the official Ceph repository
A clone of Ceph is not automagically updated with the tags from the
official Ceph repository. For a pull request based on master, git
describe will use whatever tags existed at the time the clone was made,
unless the author pull them from the official Ceph repository and later
git push --tags them.

The output of git describe is used to name the packages and if the
official tags are not present, the packages will be incorrectly
named. For instance instead of 9.0.3-34 the packages could be named
0.87-8433 because the v0.87 tag is the most recent tag in the
repository. That confuses the install task that will fail with:

   'ceph version 0.87 was not installed, found 9.0.3.'

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-10-28 00:06:46 +09:00

55 lines
1.6 KiB
Bash

#!/bin/bash
#
# Copyright (C) 2015 Red Hat <contact@redhat.com>
#
# Author: Loic Dachary <loic@dachary.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library Public License for more details.
#
function install_deps() {
git archive --remote=git://git.ceph.com/ceph.git master install-deps.sh | tar -xvf -
bash -x install-deps.sh
}
function git_submodules() {
# see http://tracker.ceph.com/issues/13426
perl -pi -e 's|git://ceph.com/git/ceph-object-corpus.git|https://github.com/ceph/ceph-object-corpus.git|' .gitmodules
local force=$(if git submodule usage 2>&1 | grep --quiet 'update.*--force'; then echo --force ; fi)
git submodule sync || return 1
git submodule update $force --init --recursive || return 1
}
function get_ceph() {
local git_ceph_url=$1
local sha1=$2
test -d ceph || git clone ${git_ceph_url}
cd ceph
git fetch --tags http://github.com/ceph/ceph
git checkout ${sha1}
}
function init_ceph() {
local git_ceph_url=$1
local sha1=$2
get_ceph $git_ceph_url $sha1 || return 1
git_submodules || return 1
install_deps || return 1
}
function flavor2configure() {
local flavor=$1
if test $flavor = notcmalloc ; then
echo --without-tcmalloc --without-cryptopp
fi
}