libdevuansdk

common library for devuan's simple distro kits
git clone https://git.parazyd.org/libdevuansdk
Log | Files | Refs | Submodules | README | LICENSE

commit d7abbc1393f9c7b085a7a5c65fb2fdf5f736bec6
parent ec1c3080bde86e542925aeabc842a9bfaa115ce4
Author: KatolaZ <katolaz@freaknet.org>
Date:   Thu, 16 Jun 2016 08:21:42 +0100

minimal blend management and stub for package management

Diffstat:
Azlibs/blends | 97+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Azlibs/packages | 64++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 161 insertions(+), 0 deletions(-)

diff --git a/zlibs/blends b/zlibs/blends @@ -0,0 +1,97 @@ +#!/usr/bin/env zsh +# +# Copyright (c) 2016 Dyne.org Foundation +# libdevuansdk is written and maintained by +# Jaromil <jaromil@dyne.org> +# KatolaZ <katolaz@freaknet.org> +# parazyd <parazyd@dyne.org> +# +# This file is part of libdevuansdk +# +# This source code is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This software is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this source code. If not, see <http://www.gnu.org/licenses/>. + +## blend-related functions + + +## Apply a blend, i.e. read the "blend" file and source the +## corresponding *_init and *_run files +## +## FIXME!!!! We need a way to check that the source of init and run +## files were successful, so that we can popd as necessary upon failure +## +blend_apply(){ + fn blend_apply $@ + + blenddir=$1 + req=(blenddir strapdir arch) + reqck || return 1 + + if [[ ! -d $blenddir || ! -f ${blenddir}/blend ]]; then + error "::1 dir:: is not a valid blend" $blenddir + return 1 + fi + + pushd $blenddir + source blend + + ## Check if release is among the supported blend_releases + [[ -z ${blend_releases[(r)$release]} ]] && { + error "::1 rel:: is not among the releases supported by blend ::2 dir:: " $rel $blenddir; + popd; + return 1 + } + + [[ -z ${blend_archs[(r)$arch]} ]] && { + error "::1 arch:: is not among the architectures supported by blend ::2 dir:: " $arch $blenddir; + popd; + return 1 + } + + notice "Selecting blend architecture ::1 arch:: " $arch + pushd ${arch} + + [[ -n ${blend_init} ]] && { + notice "Initialising blend ::1 blend:: " $blenddir + ## + [[ ! -f ${blend_init} ]] && { + error "Blend initialisation file \"::1 file::\" not found" ${blend_init} + popd + popd + return 1 + } + + source ${blend_init} + act "Initialisation successful" + } + + [[ -n ${blend_run} ]] && { + + notice "Applying blend ::1 blend:: " $blenddir + ## + [[ ! -f ${blend_run} ]] && { + error "Blend run file \"::1 file::\" not found" ${blend_run} + popd + popd + return 1 + } + source ${blend_run} + act "Application successful" + } + # come back to blend main dir + popd + # come back to working directory before the call to blend_apply + popd + +} + diff --git a/zlibs/packages b/zlibs/packages @@ -0,0 +1,64 @@ +#!/usr/bin/env zsh +# +# Copyright (c) 2016 Dyne.org Foundation +# libdevuansdk is written and maintained by +# Jaromil <jaromil@dyne.org> +# KatolaZ <katolaz@freaknet.org> +# parazyd <parazyd@dyne.org> +# +# This file is part of libdevuansdk +# +# This source code is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This software is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this source code. If not, see <http://www.gnu.org/licenses/>. + + +pkg_install_chroot(){ + fn pkg_install_chroot $@ + + pkg_name=$1 + root=${2:-$strapdir} + req=(pkg_name root) + reqck || return 1 + + mountdevprocsys ${root} + + sudo chroot ${root} apt-get --yes --force-yes install $kernel + + umountdevprocsys ${root} + + +} + + +pkg_install_ssh(){ + + +} + + +pkg_remove_chroot(){ + + +} + + +pkg_remove_ssh(){ + + +} + + +pkg_set_package_list(){ + + +}