Commit 165df52b authored by Lorenzo Martinico's avatar Lorenzo Martinico

Escape variables in bashrc

parent b0c3f086
......@@ -99,7 +99,7 @@ context =
recipe = slapos.recipe.template:jinja2
template = {{ software_dir }}/scripts/cros_full_build.in
rendered = ${directory:run}/cros_full_build
md5sum = 3b553e2f5800eb421f89723ede00c6ef
md5sum = 931c7e03f4460b76dfbb339242cd23f9
mode = 0700
context =
key bash_path bin:bash
......
......@@ -275,16 +275,16 @@ sudodd() { sudo dd "\$@" ; }
sudosafewrite() { __safewrite sudodd "\$@" ; }
crew() {
if [[ -x "$(command -v crew)" ]] ; then
if [[ -x "\$(command -v crew)" ]] ; then
read -p "Chromebrew is not on this machine; do you want to install it? [Y/n] " -r -n 1 crew_install
echo "Fetching installation file..."
if [[ ! $crew_install =~ ^[Nn]$ ]] ; then
if [[ ! \$crew_install =~ ^[Nn]$ ]] ; then
curl -Ls git.io/vddgY | bash
else
return 1
fi
else
command crew "$@"
command crew "\$@"
fi
}
......@@ -356,8 +356,8 @@ mv {{ cros_location }}/{{ branch }}/chroot/tmp/*.img ${DIR_IMAGE_LOCATION}
cd ${DIR_IMAGE_LOCATION}
for hashfunction in md5sum sha1sum sha256sum sha512sum; do
echo ${hashfunction} >> hashes.txt
${hashfunction} *.img >> hashes.txt
echo ${hashfunction} >> unzipped_hashes.txt
${hashfunction} *.img >> unzipped_hashes.txt
printf "\n\n" >> hashes.txt
done
......@@ -365,4 +365,15 @@ for file in $(ls *.img); do
gzip -9 -f ${file}
done
for hashfunction in md5sum sha1sum sha256sum sha512sum; do
echo ${hashfunction} >> hashes.txt
${hashfunction} *.img.gz >> hashes.txt
printf "\n\n" >> hashes.txt
done
for file in $(ls *.img.gz); do
imageparent="public\/R[0-9]+\/(.*\/)*"
networkcache-upload --prefix-key packerimage- --url https://softinst62285.host.vifib.net/$BASH_REMATCH$(basename $file) --file $file --config {{ shacache_location }}/shacache.cfg && rm $file
done
exit 0
......@@ -26,7 +26,7 @@ recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance.cfg
rendered = ${buildout:directory}/instance.cfg
mode = 0644
md5sum = 7cbc3e35d5228680611aaa61ae1b5cde
md5sum = 11935a03f01796998e68f8d651eaf5ee
context =
key software_dir :_profile_base_location_
key instance_dir buildout:directory
......
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