3 source "helper-functions.sh"
4 __this_script=`basename $0`
5 __this_script_dir=`dirname $0`
9 __git_clone="$__git clone"
10 __git_pull="$__git pull"
11 __git_clean="$__git clean"
12 __git_repo="git://staff.get-e.org/"
14 # e17 repositories paths
16 __e17_proto="e17/proto"
17 __e17_python_efl="$__e17_proto/python-efl"
18 __e17_python_etk="users/cmarcelo"
21 #__lib_modules="edb eet evas ecore embryo edje efreet epeg epsilon emotion etk ewl e_dbus exml enhance"
22 __lib_modules="eet:evas:ecore:embryo:edje:epsilon:etk:e_dbus"
23 __python_modules="python-evas:python-ecore:python-edje:python-epsilon:python-e_dbus"
24 __python_etk_module="python-etk"
29 __common_build_pkg_options="-rfakeroot -us -uc -D -tc"
30 __build_pkg_options="$__common_build_pkg_options -sa"
31 if [ "x$__arch" = "xarm" ] ; then
32 __build_pkg_options="$__common_build_pkg_options -B"
39 __today=`$__date +%Y%m%d`
42 __distro=`$__head -1 /etc/apt/sources.list|cut -d" " -f3`
44 __base_pkg_dir="$__this_script_dir/packages_$__today"
45 __pkg_dir="$__base_pkg_dir/$__distro/$__arch"
47 __output_file="$PWD/$__base_pkg_dir/packages_$__today.log"
49 # Function definitions
50 function log_to_file() {
55 if [ ! -r $__output_file ]; then
56 error "log_to_file(): Log file does not exist"
59 now=`$__date +%H:%M:%S`
60 echo "$now: $msg" >> $__output_file
63 function start_log() {
67 if [ ! -r $__output_file ]; then
68 msg_begin "Creating log file"
72 echo "" >> $__output_file
76 error "start_log(): Could not create $__output_file file"
79 cat << EOF >> $__output_file
80 *********************************************************
81 * Started $__this_script: $now *
82 *********************************************************
91 function finish_log() {
95 if [ ! -r $__output_file ]; then
96 error "finish_log(): Log file does not exist"
99 cat << EOF >> $__output_file
101 * Finished $__this_script: $now
108 `$__git_clone $repo.git 2>&1>> $__output_file`
113 `$__git_pull 2>&1>> $__output_file`
121 function build_pkg() {
126 function install_pkg() {
131 function uninstall_pkg() {
136 function get_sources() {
139 modules=`echo $1|$__sed -e 's/:/ /g'`
142 for module in $modules; do
143 if [ -d $module/$module/.git ]; then
144 log_to_file "Updating existing repository at $PWD/$module/$module"
146 msg_begin " Updating $module repository"
149 cd - 2>&1 >> /dev/null
150 elif [ -d $module/$module ]; then
151 log_to_file "Removing invalid repository at $PWD/$module/$module"
152 rm -rf $module/$module
155 if [ ! -d $module/$module ]; then
157 msg_begin " Cloning $repo/$module.git"
160 cd - 2>&1 >> /dev/null
161 elif [ ! -d $module ]; then
162 error "Directory $module does not exist."
169 # Distro variable must not be empty
170 msg_begin "Checking maemo distro"
171 test "x$__distro" != "x"
174 # Check if we're running inside scratchbox
175 msg_begin "Checking for scratchbox environment"
176 test -r /targets/links/scratchbox.config
180 $__mkdir -p $__pkg_dir
182 log_to_file "Created $__pkg_dir"
184 # Download modules under e17/libs
185 msg "Downloading e17 modules"
186 get_sources $__lib_modules $__git_repo$__e17_libs
188 # Download python modules under proto/python/efl
189 msg "Downloading python modules"
190 get_sources $__python_modules $__git_repo$__e17_python_efl
192 # Download python-etk module
193 get_sources $__python_etk_module $__git_repo$__e17_python_etk
199 # Download user modules (python-etk)
205 # Uninstall all packages