Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
manual-packaging
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
user-manual
manual-packaging
Commits
5d86df6d
Commit
5d86df6d
authored
Oct 21, 2016
by
Jonathan Harker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update the Python environment at the appropriate junctures.
parent
12e0f077
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
14 deletions
+21
-14
maharadocs-1.7/debian/maharadocs.postinst
maharadocs-1.7/debian/maharadocs.postinst
+21
-14
No files found.
maharadocs-1.7/debian/maharadocs.postinst
View file @
5d86df6d
...
...
@@ -24,6 +24,21 @@ case "$1" in
;;
esac
function
update_venv
{
echo
"Updating Python virtual environment:"
# If the Python virtual environment doesn't exist, try creating it.
if
[
!
-d
$DIRNAME
/venv
]
;
then
echo
"Virtual environment missing, creating a new one."
virtualenv
$DIRNAME
/venv
||
\
echo
"
${
bold
}
*** ERROR: failed to create a virtual environment in
$DIRNAME
/venv
${
normal
}
"
fi
echo
"
${
bold
}
Updating Python virtual environment...
${
normal
}
"
.
$DIRNAME
/venv/bin/activate
pip
install
--upgrade
-r
$DIRNAME
/requirements.txt
||
\
echo
"
${
bold
}
*** ERROR: pip install failed, you may need to use a wheelhouse.
${
normal
}
"
deactivate
}
# Check if we seem to have the correct git contents, not very trustworthy
# but better than no check :D
...
...
@@ -36,6 +51,10 @@ then
# packaging do its thing.
echo
"Data already exists pulling from the correct source."
echo
"Not doing any alteration of
$DIRNAME
."
# Update the Python virtual environment first, though
update_venv
exit
else
# However if it looks wrong, check if its a-ok to overwrite
...
...
@@ -85,20 +104,8 @@ else
exit
-1
fi
# Set up the Python virtual environment
if
[
-d
$DIRNAME
/venv
]
then
echo
"Python virtual environment already exists, skipping."
else
echo
"
${
bold
}
Setting up Python virtual environment...
${
normal
}
"
# TODO: If this fails, see README about installing from the wheelhouse.
virtualenv
$DIRNAME
/venv
.
$DIRNAME
/venv/bin/activate
pip
install
-r
$DIRNAME
/requirements.txt
||
\
echo
"
${
bold
}
*** ERROR: pip install failed, you may need to use a wheelhouse.
${
normal
}
"
deactivate
fi
# Update the Python virtual environment
update_venv
# Make the sitelogs directory...
mkdir
-p
/var/log/sitelogs/mahara-manual-sphinx
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment