various fixes for smooth operation

also translatable string formatting
This commit is contained in:
Jaromil 2016-06-08 16:48:46 +02:00
parent 651c477dbf
commit 044eb279e1
4 changed files with 45 additions and 17 deletions

8
config Normal file → Executable file
View File

@ -38,6 +38,7 @@ mirror="http://packages.devuan.org/merged"
# mirror repo section
section="main"
# core packages for the system
core_packages=(devuan-keyring debian-keyring)
core_packages+=(git-core binutils ca-certificates curl)
@ -50,5 +51,10 @@ base_packages=(bzip2 dialog apt-utils fakeroot e2fsprogs parted)
system_packages=(sysvinit ssh)
## libdevuansdk-specific settings
workdir="$R/workdir"
workdir="$H/workdir"
strapdir="${workdir}/strapdir"
# declare zuper globals
vars+=(os release version mirror section)
vars+=(workdir strapdir)

13
libdevuansdk Normal file → Executable file
View File

@ -23,12 +23,16 @@
devuan_sdk_version=0.1
setopt pushdsilent
SDK_PREFIX=`pwd`
SDK_HOME=`pwd`
SDK_CONF=`pwd`
R=${SDK_PREFIX:-/usr/local/devuan-sdk}
H=${SDK_HOME:-$HOME/.devuan-sdk}
E=${SDK_CONF:-/etc/devuan-sdk}
R=`pwd` # NOTE: for development
[[ -r $R ]] || {
print "Devuan SDK is not installed in: $R"
print "export SDK_PREFIX if installed on a different path"
@ -50,7 +54,7 @@ LOG=${LOG:-""}
vars+=(R H E)
# source $R/zlibs/library
source $R/config
source $E/config
source $R/zlibs/debootstrap
source $R/zlibs/helpers
source $R/zlibs/sysconf
@ -68,6 +72,9 @@ rehash
# For gettext
TEXTDOMAIN=devuan
# create mandatory workdirs
mkdir -p ${strapdir}
notice "Loading Devuan SDK library v$devuan_sdk_version"
# ...

35
zlibs/debootstrap Normal file → Executable file
View File

@ -23,17 +23,21 @@
## Debootstrap things
vars+=(bootstrap_tgz)
bootstrap() {
fn bootstrap $@
arch="$1"
req=(os strapdir workdir arch release mirror)
ckreq || return 1
notice "Bootstrapping ${os} base"
notice "Bootstrapping ::1 OS:: base" ${os}
mkdir -p ${strapdir}
bootstrap_tgz=$H/tmp/${os}-${arch}.tgz
if [[ -f $R/tmp/${os}-${arch}.tgz ]]; then
if [[ -f $bootstrap_tgz ]]; then
notice "Using the existing bootstrap tarball found in ::1 tmpdir::" $H/tmp
ls -lh $bootstrap_tgz
tar_unpack ${strapdir}
else
# Debootstrap stage 1
@ -123,23 +127,34 @@ EOF
tar_bootstrap() {
fn tar_bootstrap
req=(bootstrap_tgz)
ckreq || return 1
if [[ -f $R/tmp/${os}-${arch}.tgz ]]; then
return 0
local _dest=`dirname $bootstrap_tgz`
if [[ -f $bootstrap_tgz ]]; then
act "tarball found already in ::1 dir::" $_dest
else
notice "Creating boostrap tarball in ::1 tgz::" $bootstrap_tgz
pushd ${strapdir}
tar czf ${os}-${arch}.tgz ./*
mkdir -p $R/tmp
mv ${os}-${arch}.tgz $R/tmp/
mkdir -p ${_dest}
escalate root "tar czf $bootstrap_tgz . --exclude=dev,sys,proc"
popd
fi
ls -lh $bootstrap_tgz
}
tar_unpack() {
fn tar_unpack $@
local unpath="$1"
req=(unpath)
req=(unpath bootstrap_tgz)
ckreq || return 1
tar xf $R/tmp/${os}-${arch}.tgz -C ${unpath}
[[ -r ${unpath}/bin/bash ]] && {
warning "bootstrap already unpacked in ::1 dir::" $unpath
return 1 }
mkdir -p ${unpath}
tar xf $bootstrap_tgz -C ${unpath}
}

6
zlibs/helpers Normal file → Executable file
View File

@ -30,10 +30,10 @@ escalate() {
req=(user cmnd)
ckreq || return 1
if [[ `command -v sudo` ]]; then
sudo -E -u ${user} ${cmnd}
if isfound sudo; then
sudo -E -u ${user} ${=cmnd}
else
su -c ${cmnd} ${user}
su -c "${=cmnd}" ${user}
fi
}