Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37403002
en ru br
ALT Linux repositórios
S:0.9.1-alt1
5.0: 0.2-alt1

Group :: Sistema/Configurações/Rede
RPM: alterator-preinstall

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

alterator-preinstall-0.2/000075500000000000000000000000001117014223100155115ustar00rootroot00000000000000alterator-preinstall-0.2/Makefile000064400000000000000000000001441117014223100171500ustar00rootroot00000000000000NAME=preinstall

all:
clean:
install: install-module

include /usr/share/alterator/build/module.mak
alterator-preinstall-0.2/backend3/000075500000000000000000000000001117014223100171635ustar00rootroot00000000000000alterator-preinstall-0.2/backend3/preinstall000075500000000000000000000041631117014223100212720ustar00rootroot00000000000000#!/bin/sh
# ***** BEGIN LICENSE BLOCK *****
# * Copyright (C) 2007 Alexey Gladkov <legion@altlinux.org>
# * Copyright (C) 2007 Dmitry V. Levin <ldv@altlinux.org>
# * Copyright (C) 2007 Anton V. Boyarshinov <boyarsh@altlinux.org>
# *
# * This program 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 2 of the License, or
# * (at your option) any later version.
# *
# * This program 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 program; if not, write to the Free Software
# * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
# ***** END LICENSE BLOCK *****

. alterator-sh-functions
. install2-sh-functions

preinstall_dir="/usr/share/install2/preinstall.d"

PROG=preinstall

notify()
{
[ -z "$AUTOINSTALL" ] || return 0
alterator-mailbox-send "$1" ||:
}

run_preinstall()
{
local f max counter=0
max="$(find "$preinstall_dir" "$destdir/$preinstall_dir" -mindepth 1 -maxdepth 1 -type f -perm -u=x |wc -l)"

notify "init #t max $max"

# run scripts from packages first, because basic installer scripts can umount /image
for f in "$destdir/$preinstall_dir"/* "$preinstall_dir"/*; do
[ -f "$f" -a -x "$f" ] || continue

if "$f" >&2; then
notify "package \"${f##*/}\" step $counter"
counter=$(($counter + 1))
printf '%s %s - OK\n' "$(date +%T)" "$f" >&2
else
notify "error \"${f##*/}\""
printf '%s %s - FAILED\n' "$(date +%T)" "$f" >&2
break
fi
done

notify "package \" \" step $max"
notify "done #t"
sync
}

on_message()
{
case "$in_action" in
write)
echo "$PROG: write init" >&2
if [ -z "$AUTOINSTALL" ]; then
run_preinstall &
else
run_preinstall
fi
echo '()'
;;
*)
echo '#f'
;;
esac
}

message_loop
alterator-preinstall-0.2/interfaces/000075500000000000000000000000001117014223100176345ustar00rootroot00000000000000alterator-preinstall-0.2/interfaces/guile/000075500000000000000000000000001117014223100207415ustar00rootroot00000000000000alterator-preinstall-0.2/interfaces/guile/backend/000075500000000000000000000000001117014223100223305ustar00rootroot00000000000000alterator-preinstall-0.2/interfaces/guile/backend/deadline.scm000064400000000000000000000010401117014223100245740ustar00rootroot00000000000000(define-module (alterator backend deadline)
:use-module (alterator woo)
:use-module (alterator plist)
:export (backend))

;;TODO: kill evms
(define install2-backends '( "sysconfig-base" "notes" "datetime" "pkg-init" "pkg-groups" "pkg-install" "preinstall"))

(define (kill-backend x)
(woo-delete (string-append "/ensign/" x)))

(define (backend path args)
(let ((action (cond-plistq 'action args "")))
(if (string=? action "write")
(begin (chroot "/mnt/destination")
(for-each kill-backend install2-backends))))
'())
alterator-preinstall-0.2/ui/000075500000000000000000000000001117014223100161265ustar00rootroot00000000000000alterator-preinstall-0.2/ui/preinstall/000075500000000000000000000000001117014223100203035ustar00rootroot00000000000000alterator-preinstall-0.2/ui/preinstall/index.scm000064400000000000000000000036021117014223100221170ustar00rootroot00000000000000; ***** BEGIN LICENSE BLOCK *****
; * Copyright (C) 2007 Alexey Gladkov <legion@altlinux.org>
; *
; * This program 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 2 of the License, or
; * (at your option) any later version.
; *
; * This program 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 program; if not, write to the Free Software
; * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
; ***** END LICENSE BLOCK *****

(document:surround "/std/frame")

(define (progress-monitor msg)
(case (cond-car msg)
((error)
(remove-mailbox progress-monitor)
(status-l text (format #f "<font color=\"red\"><b>~A:</b></font><br/><p>~A</p>"
(_ "Execution of script failed")
(or (cond-cadr msg) "unknown")))
(frame:next-activity #t)
(frame:back-activity #t))
((init)
(progress text (_ "Saving settings ..."))
(progress maximum (cond-plistq 'max msg 0)))

((done)
(remove-mailbox progress-monitor)
(woo-catch/message (thunk (woo-write "/deadline")))
(frame:next))

((package)
(progress value (cond-plistq 'step msg 0)))))

(vbox max-height 150
(spacer)
(document:id progress (progressbar maximum 0 value 0 text " "))
(document:id status-l (label))
(spacer))

(document:root (when loaded
(add-mailbox progress-monitor)
(frame:next-activity #f)
(frame:back-activity #f)
(woo-write "/preinstall")))
 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009