public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Philippe Lafoucrière" <lafou@wanadoo.fr>
To: Gentoo-dev <gentoo-dev@gentoo.org>
Subject: [gentoo-dev] Shell script help - emerge frontend.
Date: 20 Jun 2003 15:47:01 +0200	[thread overview]
Message-ID: <1056116821.32688.160.camel@biproc> (raw)

[-- Attachment #1: Type: text/plain, Size: 397 bytes --]

Hello

Last month, I took a look at FreeBSD which really surprised me. However,
gentoo rocks so much I can't give it up. I started yesterday to create a
shell script that would help newbies with Gentoo, and especially
PORTAGE.
This script would be very similar to /stand/sysinstall of Freebsd. Are
there some volonteers to work on it with me ? 

(script is attached, don't worry about filename.)


[-- Attachment #2: dia-emerge.sh --]
[-- Type: text/x-sh, Size: 1737 bytes --]

#! /bin/sh

# Front end to emerge and portage (gentoo Linux) using dialog.
# Philippe Lafoucrière <lafou@wanadoo.fr> - 2003
#
# This utility only use dialog so it can be used with a minimal installation.
#

VERSION="0.0.1"

#DIALOG=Xdialog
DIALOG="dialog"

PORTAGE_DIR="/usr/portage"

# Return codes used in this program:
E_SUCCESS=0
E_FAILURE=1


######### EMERGE_MENU #########
emerge_menu() {
    local RESULT=${E_FAILURE}
    local LIST=$(ls ${PORTAGE_DIR})
    local DLIST=
    for N in ${LIST} ; do
        DLIST="${DLIST} $N -"
    done
    CATEGORY=$(dialog --stdout \
            --backtitle "portage categories" \
             --menu "Choose category" 0 0 0\
             ${DLIST})
    RESULT=$?
    select_package_menu
}
######### EMERGE_MENU #########
select_package_menu() {
    local RESULT=${E_FAILURE}
    local LIST=$(ls ${PORTAGE_DIR}/${CATEGORY})
    local DLIST=

    for N in ${LIST} ; do
        DLIST="${DLIST} $N - "
    done
    PACKAGE=$(dialog --stdout \
            --backtitle "Packages in ${CATEGORY}" \
             --menu "Choose Package" 0 0 0\
             ${DLIST})
    RESULT=$?
    return ${RESULT}
}
######### EMERGE_MENU #########
conf_menu() {
    dialog --backtitle 'Configuration' \
    --msgbox "                  Not yet implemented" 5 60
}

######### INTRO #########
intro() {
    dialog --backtitle 'portage' \
    --msgbox "              Welcome to portage utilities" 5 60
}

######### MAIN #########
main_menu () {
    RESULT=$(dialog --stdout \
        --backtitle 'portage' --menu "Select a function" 10  60 0 \
        1   'Install package (emerge)' \
        2   'Configure portage')

    case $RESULT in
        1) emerge_menu;;
        2) conf_menu;;
    esac
}


intro
main_menu
#


[-- Attachment #3: Type: text/plain, Size: 37 bytes --]

--
gentoo-dev@gentoo.org mailing list

             reply	other threads:[~2003-06-20 13:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-20 13:47 Philippe Lafoucrière [this message]
2003-06-20 15:20 ` [gentoo-dev] Shell script help - emerge frontend Michael Kohl
2003-06-20 16:06   ` Philippe Lafoucrière
2003-06-20 16:16     ` Philippe Lafoucrière
2003-06-20 16:56       ` Philippe Lafoucrière
2003-06-20 19:15     ` Svyatogor
2003-06-20 18:08       ` Philippe Lafoucrière
2003-06-20 20:24         ` bdharring
2003-06-20 20:31           ` Philippe Lafoucrière
     [not found]             ` <20030620231603.1aba32dd.genone@genone.homeip.net>
2003-06-20 21:32               ` Philippe Lafoucrière
2003-06-20 21:38                 ` bdharring
2003-06-20 21:50                   ` Thomas de Grenier de Latour
2003-06-20 22:38                   ` Marius Mauch
2003-06-20 21:33             ` bdharring
2003-06-21  3:52           ` Michael Kohl
2003-06-21 10:56     ` Michael Kohl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1056116821.32688.160.camel@biproc \
    --to=lafou@wanadoo.fr \
    --cc=gentoo-dev@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox