4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
21 echo "Builds all git repositories under give search dirs"
22 echo "Usage: $0 -m <manifest-dir> -w <work-dir> -r <rpmbuilder-dir> <rpm-create-search-dir> [<rpm-create-search-dir>..]"
26 while getopts "m:w:r:" OPT; do
29 export MANIFEST_PATH=$(readlink -f $OPTARG)
35 export RPMBUILDER_PATH=$(readlink -f $OPTARG)
43 [ -z "$MANIFEST_PATH" ] && usage
44 [ -z "$RPMBUILDER_PATH" ] && usage
45 [ -z "$WORK" ] && usage
49 [ "$#" -eq 0 ] && usage
50 for p in $search_paths; do
51 [ ! -d "$p" ] && usage
54 scriptdir="$(dirname $(readlink -f ${BASH_SOURCE[0]}))"
55 source $scriptdir/lib.sh
57 projects_to_build=$(find $search_paths -name .git -printf "%h\n" | sort)
63 $scriptdir/create_mock_config.sh $BUILD_CONFIG_INI $work/mock_config
65 CENTOS_SOURCES="$(_read_build_config rpm centos_sources)" \
66 $RPMBUILDER_PATH/makebuild.py \
67 -m $work/mock_config/mock.cfg \
69 $projects_to_build #-v --nowipe
71 echo "### Built RPMS #######################################"
72 find $work/projects/ -type f -name '*.rpm' | xargs ls -l
73 echo "### Built RPM details ##########################################"
74 for rpm in $(find $work/projects/ -type f -name '*.rpm'); do
75 echo "=== $rpm ========================"
79 _add_rpms_to_localrepo $(find $work/buildrepository/mock -name '*.rpm')