Skip to content

Commit

Permalink
add patches dir with each change broken into a separate chunk
Browse files Browse the repository at this point in the history
  • Loading branch information
ppurka committed Apr 13, 2012
1 parent 6a6eb84 commit 400d2e4
Show file tree
Hide file tree
Showing 5 changed files with 265 additions and 0 deletions.
138 changes: 138 additions & 0 deletions patches/01-easy_e17-build-in-separate-dirs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
--- easy_e17.sh 2012-04-13 19:08:05.803853281 +0800
+++ easy_e17.sh.01 2012-04-13 19:29:10.919892145 +0800
@@ -20,10 +20,12 @@
status_path="$tmp_path/status"
src_cache_path="$tmp_path/src_cache"
src_path="$HOME/e17_src"
+tmp_compile_dir="$tmp_path/compile"
+tmp_install_dir="$tmp_path/install"

src_url="http://svn.enlightenment.org/svn/e/trunk"
src_rev="HEAD"
-conf_files="/etc/easy_e17.conf $HOME/.easy_e17.conf $PWD/.easy_e17.conf"
+conf_files="/etc/easy_e17.conf $HOME/.config/easy_e17/easy_e17.conf $HOME/.easy_e17.conf $PWD/.easy_e17.conf"

efl_basic="eina eet evas ecore efreet eio eeze e_dbus embryo edje azy ethumb elementary"
efl_extra="imlib2 emotion enlil libast python-evas python-ecore python-e_dbus python-edje python-emotion python-elementary shellementary"
@@ -406,7 +408,7 @@
title=$3
log_title=$4
mode_needed=$5
- cmd=$6
+ cmd="$6"

set_title "$name: $title ($pkg_pos/$pkg_total)"
echo -n "$log_title"
@@ -461,6 +463,8 @@
function compile ()
{
name=$1
+ local curr_dir="$PWD"
+ local installed_files="$HOME/.config/easy_e17/${name}.installed"

write_appname "$name"

@@ -497,9 +501,13 @@
set_notification "critical" "Package '$name': sourcedir not found"
return
fi
+
+ # Copy source files to tmp_compile_dir and change to that directory
+ cp -Rp "$path" "$tmp_compile_dir"
+ path="$tmp_compile_dir/$name"
cd "$path"

- rm -f $status_path/$name.noerrors
+ rm -f "$status_path/$name.noerrors"
rm -f "$logs_path/$name.log"

if [ $clean -ge 1 ]; then
@@ -549,7 +557,7 @@
if [ ! -e "$status_path/$name.noerrors" ] ; then return ; fi
run_command "$name" "$path" "make" "make: " "$mode" "$make -j $threads"
if [ ! -e "$status_path/$name.noerrors" ] ; then return ; fi
- run_command "$name" "$path" "install" "install: " "rootonly" "$make install"
+ run_command "$name" "$path" "install" "install: " "rootonly" "$make DESTDIR=$tmp_install_dir install"
if [ ! -e "$status_path/$name.noerrors" ] ; then return ; fi
elif [ -e "bootstrap" ]; then
run_command "$name" "$path" "bootstrap" "bootstr: " "$mode" "./bootstrap"
@@ -558,25 +566,25 @@
if [ ! -e "$status_path/$name.noerrors" ] ; then return ; fi
run_command "$name" "$path" "make" "make: " "$mode" "$make -j $threads"
if [ ! -e "$status_path/$name.noerrors" ] ; then return ; fi
- run_command "$name" "$path" "install" "install: " "rootonly" "$make install"
+ run_command "$name" "$path" "install" "install: " "rootonly" "$make DESTDIR=$tmp_install_dir install"
if [ ! -e "$status_path/$name.noerrors" ] ; then return ; fi
elif [ -e "Makefile.PL" ]; then
run_command "$name" "$path" "perl" "perl: " "$mode" "perl Makefile.PL prefix=$install_path $args"
if [ ! -e "$status_path/$name.noerrors" ] ; then return ; fi
run_command "$name" "$path" "make" "make: " "$mode" "$make -j $threads"
if [ ! -e "$status_path/$name.noerrors" ] ; then return ; fi
- run_command "$name" "$path" "install" "install: " "rootonly" "$make install"
+ run_command "$name" "$path" "install" "install: " "rootonly" "$make DESTDIR=$tmp_install_dir install"
if [ ! -e "$status_path/$name.noerrors" ] ; then return ; fi
elif [ -e "setup.py" ]; then
run_command "$name" "$path" "python" "python: " "$mode" "python setup.py build build_ext --include-dirs=$PYTHONINCLUDE $args"
if [ ! -e "$status_path/$name.noerrors" ] ; then return ; fi
- run_command "$name" "$path" "install" "install: " "rootonly" "python setup.py install --prefix=$install_path install_headers --install-dir=$PYTHONINCLUDE"
+ run_command "$name" "$path" "install" "install: " "rootonly" "python setup.py install --root=$tmp_install_dir --prefix=$install_path install_headers --install-dir=$PYTHONINCLUDE"
if [ ! -e "$status_path/$name.noerrors" ] ; then return ; fi
elif [ -e "Makefile" ]; then
make_extra="PREFIX=$install_path"
run_command "$name" "$path" "make" "make: " "$mode" "$make $make_extra -j $threads"
if [ ! -e "$status_path/$name.noerrors" ] ; then return ; fi
- run_command "$name" "$path" "install" "install: " "rootonly" "$make $make_extra install"
+ run_command "$name" "$path" "install" "install: " "rootonly" "$make $make_extra DESTDIR=$tmp_install_dir install"
if [ ! -e "$status_path/$name.noerrors" ] ; then return ; fi
else
echo "no build system"
@@ -584,6 +592,19 @@
touch $status_path/$name.nobuild
return
fi
+
+ # Now remove the files that were installed previously
+ [ -e "$installed_files" ] && {
+ cat "$installed_files" | xargs rm -f
+ }
+ # Now move the files in $tmp_install_dir to $install_path
+ run_command "$name" "$path" "install" "cp: " "rootonly" "cp -Rpf ${tmp_install_dir}${install_path}/* ${install_path}"
+ if [ ! -e "$status_path/$name.noerrors" ] ; then
+ rm -rf "${tmp_install_dir}/${install_path}"
+ return
+ fi
+ # Now update the file which records the installed files
+ find "$tmp_install_dir" -type f -o -type l -o -type s -o -type p | sed -e "s@^${tmp_install_dir}@@" > "$installed_files"

if [ "$gen_docs" ]; then
if [ -e "gendoc" ]; then
@@ -597,6 +618,9 @@
rm -f $status_path/$name.noerrors
echo "ok"
set_notification "normal" "Package '$name': build successful"
+ rm -rf "${tmp_install_dir}/${install_path}"
+ rm -rf "${tmp_compile_dir}/${name}"
+ cd "$curr_dir"
}

function rotate ()
@@ -832,6 +856,10 @@
easy_options=""
command_options=$@
clean=0
+mkdir -p "$HOME/.config/easy_e17" || {
+ echo >&2 "ERROR: Can not create config directory $HOME/.config/easy_e17"
+ exit 1
+}

# Check for alternate conf file first.
test_options=$command_options
@@ -1052,6 +1080,8 @@
echo -e "\033[1m-------------------------------\033[7m Basic system checks \033[0m\033[1m----------------------------\033[0m"
echo -n "- creating temporary dirs .... "
mkdir -p "$tmp_path" 2>/dev/null
+mkdir -p "$tmp_compile_dir" 2>/dev/null
+mkdir -p "$tmp_install_dir" 2>/dev/null
mkdir -p "$logs_path" 2>/dev/null
mkdir -p "$status_path" 2>/dev/null
mkdir -p "$src_cache_path" 2>/dev/null
69 changes: 69 additions & 0 deletions patches/02-easy_e17-remove-clean-option.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
--- easy_e17.sh 2012-04-13 19:29:10.919892145 +0800
+++ easy_e17.sh.new02 2012-04-13 19:31:13.443895908 +0800
@@ -149,10 +149,6 @@
echo " --srcrev=<revision> = set the default source revision"
echo " --asuser = do everything as the user, not as root"
echo " --no-sudopwd = sudo don't need a password..."
- echo " -c, --clean = clean the sources before building"
- echo " (more --cleans means more cleaning, up"
- echo " to a maximum of three, which will"
- echo " uninstall e17)"
echo " -s, --skip-srcupdate = don't update sources"
echo " -a, --ask-on-src-conflicts = ask what to do with a conflicting"
echo " source file"
@@ -510,39 +506,6 @@
rm -f "$status_path/$name.noerrors"
rm -f "$logs_path/$name.log"

- if [ $clean -ge 1 ]; then
- if [ -e "Makefile" ]; then
- if [ $clean -eq 1 ]; then
- run_command "$name" "$path" "clean" "clean : " "$mode" "$make -j $threads clean"
- if [ ! -e "$status_path/$name.noerrors" ]; then
- if [ "$skip_errors" ]; then
- write_appname "$name" "hidden" # clean might fail, that's ok
- else
- return
- fi
- fi
- fi
- if [ $clean -eq 2 ]; then
- run_command "$name" "$path" "distclean" "distcln: " "$mode" "$make -j $threads clean distclean"
- if [ ! -e "$status_path/$name.noerrors" ]; then
- if [ "$skip_errors" ]; then
- write_appname "$name" "hidden" # distclean might fail, that's ok
- else
- return
- fi
- fi
- fi
- if [ $clean -ge 3 ]; then
- run_command "$name" "$path" "uninstall" "uninst : " "rootonly" "$make -j $threads uninstall clean distclean"
- if [ ! -e "$status_path/$name.noerrors" ] ; then return ; fi
-
- # It's no longer installed if we just uninstalled it.
- # Even if the uninstall failed, it's best to mark it as uninstalled so that a partial uninstall gets fixed later.
- rm -f $status_path/$name.installed
- fi
- fi
- fi
-
# get autogen arguments
args=""
for app_arg in `echo $autogen_args | tr -s '\,' ' '`; do
@@ -855,7 +818,6 @@
accache=""
easy_options=""
command_options=$@
-clean=0
mkdir -p "$HOME/.config/easy_e17" || {
echo >&2 "ERROR: Can not create config directory $HOME/.config/easy_e17"
exit 1
@@ -962,7 +924,6 @@
;;
--asuser) asuser=1 ;;
--no-sudopwd) no_sudopwd=1 ;;
- -c|--clean) clean=$(($clean + 1)) ;;
-d|--docs) gen_docs=1 ;;
--postscript) easy_e17_post_script="$value" ;;
-s|--skip-srcupdate) skip_srcupdate=1 ;;
44 changes: 44 additions & 0 deletions patches/03-easy_e17-add-backup-option.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
--- easy_e17.sh 2012-04-13 19:31:13.443895908 +0800
+++ easy_e17.sh.new03 2012-04-13 19:33:38.739900371 +0800
@@ -42,6 +42,7 @@
packagelist="basic"
packages=$packages_basic

+backup=0 # This will be set to 1 when backing up old install
cmd_src_test="svn info"
cmd_src_list="svn list -r"
cmd_src_checkout="svn checkout -r "
@@ -152,6 +153,10 @@
echo " -s, --skip-srcupdate = don't update sources"
echo " -a, --ask-on-src-conflicts = ask what to do with a conflicting"
echo " source file"
+ echo " -b, --backup = backup the current installation"
+ echo " WARNING: Use this option only if you"
+ echo " installed e17 in its own directory, eg."
+ echo " /usr/e17, /opt/e17, /usr/local/e17, etc."
echo " --skip=<name1>,<name2>,... = this will skip installing the named"
echo " libs/apps"
echo " -d, --docs = generate programmers documentation"
@@ -881,6 +886,7 @@
fi

case "$option" in
+ -b|--backup) backup=1 ;;
-i|--install) action="install" ;;
-u|--update) action="update" ;;
--packagelist)
@@ -1134,6 +1140,14 @@
mode="root"
fi

+ if [ "$backup" -eq 1 ] && [ -d "$install_path" ]; then
+ echo -n "- backing up current installation as ${install_path}-$(date '+%Y-%m-%d-%T') ... "
+ case "$mode" in
+ user|root) cp -Rp "$install_path" "${install_path}-$(date '+%Y-%m-%d-%T')" ;;
+ sudo) echo "$sudopwd" | sudo -S cp -Rp "$install_path" "${install_path}-$(date '+%Y-%m-%d-%T')" ;;
+ esac
+ echo "Done."
+ fi

echo -n "- setting env variables ...... "
export PATH="$install_path/bin:$PATH"
12 changes: 12 additions & 0 deletions patches/04-easy_e17-option-to-apply-custom-patches.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--- easy_e17.sh 2012-04-13 19:33:38.739900371 +0800
+++ easy_e17.sh.new04 2012-04-13 19:39:27.747911088 +0800
@@ -520,6 +520,9 @@
fi
done

+ if [ -e "$HOME/.config/easy_e17/$name.patch" ] ; then
+ run_command "$name" "$path" "patch" "patch: " "$mode" "patch -p1 -i $HOME/.config/easy_e17/$name.patch"
+ fi
if [ -e "autogen.sh" ]; then
run_command "$name" "$path" "autogen" "autogen: " "$mode" "./autogen.sh --prefix=$install_path $accache $args"
if [ ! -e "$status_path/$name.noerrors" ] ; then return ; fi
2 changes: 2 additions & 0 deletions patches/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The patches must be applied in exactly the numbered sequence to
easy-e17.sh r545, that is, 01-* should be applied before 02-*, etc.

0 comments on commit 400d2e4

Please sign in to comment.