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 # mirror repo section
section="main" section="main"
# core packages for the system # core packages for the system
core_packages=(devuan-keyring debian-keyring) core_packages=(devuan-keyring debian-keyring)
core_packages+=(git-core binutils ca-certificates curl) 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) system_packages=(sysvinit ssh)
## libdevuansdk-specific settings ## libdevuansdk-specific settings
workdir="$R/workdir" workdir="$H/workdir"
strapdir="${workdir}/strapdir" 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 devuan_sdk_version=0.1
setopt pushdsilent
SDK_PREFIX=`pwd`
SDK_HOME=`pwd`
SDK_CONF=`pwd`
R=${SDK_PREFIX:-/usr/local/devuan-sdk} R=${SDK_PREFIX:-/usr/local/devuan-sdk}
H=${SDK_HOME:-$HOME/.devuan-sdk} H=${SDK_HOME:-$HOME/.devuan-sdk}
E=${SDK_CONF:-/etc/devuan-sdk} E=${SDK_CONF:-/etc/devuan-sdk}
R=`pwd` # NOTE: for development
[[ -r $R ]] || { [[ -r $R ]] || {
print "Devuan SDK is not installed in: $R" print "Devuan SDK is not installed in: $R"
print "export SDK_PREFIX if installed on a different path" print "export SDK_PREFIX if installed on a different path"
@ -50,7 +54,7 @@ LOG=${LOG:-""}
vars+=(R H E) vars+=(R H E)
# source $R/zlibs/library # source $R/zlibs/library
source $R/config source $E/config
source $R/zlibs/debootstrap source $R/zlibs/debootstrap
source $R/zlibs/helpers source $R/zlibs/helpers
source $R/zlibs/sysconf source $R/zlibs/sysconf
@ -68,6 +72,9 @@ rehash
# For gettext # For gettext
TEXTDOMAIN=devuan TEXTDOMAIN=devuan
# create mandatory workdirs
mkdir -p ${strapdir}
notice "Loading Devuan SDK library v$devuan_sdk_version" notice "Loading Devuan SDK library v$devuan_sdk_version"
# ... # ...

35
zlibs/debootstrap Normal file → Executable file
View File

@ -23,17 +23,21 @@
## Debootstrap things ## Debootstrap things
vars+=(bootstrap_tgz)
bootstrap() { bootstrap() {
fn bootstrap $@ fn bootstrap $@
arch="$1" arch="$1"
req=(os strapdir workdir arch release mirror) req=(os strapdir workdir arch release mirror)
ckreq || return 1 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} tar_unpack ${strapdir}
else else
# Debootstrap stage 1 # Debootstrap stage 1
@ -123,23 +127,34 @@ EOF
tar_bootstrap() { tar_bootstrap() {
fn tar_bootstrap fn tar_bootstrap
req=(bootstrap_tgz)
ckreq || return 1
if [[ -f $R/tmp/${os}-${arch}.tgz ]]; then local _dest=`dirname $bootstrap_tgz`
return 0
if [[ -f $bootstrap_tgz ]]; then
act "tarball found already in ::1 dir::" $_dest
else else
notice "Creating boostrap tarball in ::1 tgz::" $bootstrap_tgz
pushd ${strapdir} pushd ${strapdir}
tar czf ${os}-${arch}.tgz ./* mkdir -p ${_dest}
mkdir -p $R/tmp escalate root "tar czf $bootstrap_tgz . --exclude=dev,sys,proc"
mv ${os}-${arch}.tgz $R/tmp/
popd popd
fi fi
ls -lh $bootstrap_tgz
} }
tar_unpack() { tar_unpack() {
fn tar_unpack $@ fn tar_unpack $@
local unpath="$1" local unpath="$1"
req=(unpath) req=(unpath bootstrap_tgz)
ckreq || return 1 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) req=(user cmnd)
ckreq || return 1 ckreq || return 1
if [[ `command -v sudo` ]]; then if isfound sudo; then
sudo -E -u ${user} ${cmnd} sudo -E -u ${user} ${=cmnd}
else else
su -c ${cmnd} ${user} su -c "${=cmnd}" ${user}
fi fi
} }