parent
f2e530efc5
commit
cc477de841
1 changed files with 6 additions and 8 deletions
14
cd.sh
14
cd.sh
|
@ -10,6 +10,7 @@ CD_REPOSITORY_NAME='cd'
|
||||||
CD_DNS_FILE='/etc/resolv.conf'
|
CD_DNS_FILE='/etc/resolv.conf'
|
||||||
case "${CD_OS_NAME}" in
|
case "${CD_OS_NAME}" in
|
||||||
'debian')
|
'debian')
|
||||||
|
CD_PYTHON_PACKAGES='/usr/lib/python3/dist-packages'
|
||||||
case "${CD_OS_VERSION}" in
|
case "${CD_OS_VERSION}" in
|
||||||
'bookworm')
|
'bookworm')
|
||||||
echo 'TODO'
|
echo 'TODO'
|
||||||
|
@ -33,7 +34,6 @@ else
|
||||||
echo 'CD_REPOSITORIES_URL'
|
echo 'CD_REPOSITORIES_URL'
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
CD_STEP=0
|
|
||||||
|
|
||||||
function cd_step {
|
function cd_step {
|
||||||
if [ "${1}" ] ; then
|
if [ "${1}" ] ; then
|
||||||
|
@ -185,20 +185,18 @@ function cd_clean_packages_cache {
|
||||||
function cd_install {
|
function cd_install {
|
||||||
local repository
|
local repository
|
||||||
local root
|
local root
|
||||||
local target
|
|
||||||
cd_step "${FUNCNAME}"
|
cd_step "${FUNCNAME}"
|
||||||
case "${CD_OS_NAME}" in
|
|
||||||
'debian') target='/usr/lib/python3/dist-packages' || exit ;;
|
|
||||||
*) exit 1 ;;
|
|
||||||
esac
|
|
||||||
root="$(mktemp --directory)" || exit
|
root="$(mktemp --directory)" || exit
|
||||||
for repository in \
|
for repository in \
|
||||||
"${CD_REPOSITORIES_PARENT}" \
|
"${CD_REPOSITORIES_PARENT}" \
|
||||||
"${CD_REPOSITORY_NAME}" \
|
"${CD_REPOSITORY_NAME}" \
|
||||||
; do
|
; do
|
||||||
git clone \
|
git clone \
|
||||||
"${CD_REPOSITORIES_URL}/${repository}" "{root}/${repository}" || exit
|
"${CD_REPOSITORIES_URL}/${repository}" "${root}/${repository}" \
|
||||||
cp --recursive --verbose "${root}/${repository}" "${target}"
|
|| exit
|
||||||
|
cp --recursive --verbose \
|
||||||
|
"${root}/${repository}" "${CD_PYTHON_PACKAGES}" \
|
||||||
|
|| exit
|
||||||
# TODO commands
|
# TODO commands
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue