Commit 71edee17 authored by Vincent Pelletier's avatar Vincent Pelletier Committed by Kazuhiko Shiozaki

Stop using "git pull" and meaningless identity when updating.

We are never supposed to merge anything. We are supposed to just follow
upstream. pull merges, so it's just the wrong tool.
Instead, fetch and reset.
It is not a problem to always reset, as user already cannot rely on
repository's survival across updates: if there is any error reported by
git command, the repository will be wiped out. So resetting will not do
any more harm than what can already happen.
Also, properly quote paths to protect against spaces (in both command and
update-command).
parent 1766ba21
......@@ -244,8 +244,8 @@ stop-on-error = true
repository = http://git.erp5.org/repos/erp5.git
branch = erp5-component
revision =
command = ${git:location}/bin/git clone --quiet --branch ${:branch} ${:repository} ${:location} && if [ -n "${:revision}" ]; then cd ${:location} && ${git:location}/bin/git reset --quiet --hard ${:revision} ; fi
update-command = cd ${:location} && GIT_COMMITTER_EMAIL=nobody@example.com GIT_AUTHOR_NAME=Nobody GIT_AUTHOR_EMAIL=nobody@example.com ${git:location}/bin/git pull && if [ -n "${:revision}" ]; then echo "Resetting." ; cd ${:location} && ${git:location}/bin/git reset --hard ${:revision} ; fi
command = "${git:location}/bin/git" clone --quiet --branch "${:branch}" "${:repository}" "${:location}" && if [ -n "${:revision}" ]; then cd "${:location}" && "${git:location}/bin/git" reset --quiet --hard "${:revision}" ; fi
update-command = cd "${:location}" && "${git:location}/bin/git" fetch && if [ -n "${:revision}" ]; then "${git:location}/bin/git" reset --hard "${:revision}"; else "${git:location}/bin/git" reset --hard @{upstream} ; fi
[products]
# XXX: ERP5 related products are not defined as python distributions, so it is
......
......@@ -55,7 +55,7 @@ stop-on-error = true
command =
(${git:location}/bin/git clone --quiet http://git.erp5.org/repos/slapos.kvm.git ${:location} ) || (rm -fr ${:location} ; exit 1)
update-command =
cd ${:location} && ${git:location}/bin/git pull --quiet origin master
cd "${:location}" && "${git:location}/bin/git" fetch --quiet && "${git:location}/bin/git" reset --hard --quiet @{upstream}
[instance-recipe]
egg = slapos.cookbook
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment