Packaging shell functions - Debian

This is a discussion on Packaging shell functions - Debian ; Hi, I'm packaging a little tool called vared. Vared relies on some shell functions and/or aliases that must have been sourced into the environment before usage. What may be the best pratice to package such shell functions? First approch is ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: Packaging shell functions

  1. Packaging shell functions

    Hi,

    I'm packaging a little tool called vared. Vared relies on some shell
    functions and/or aliases that must have been sourced into the
    environment before usage. What may be the best pratice to package
    such shell functions?

    First approch is to put the shell code somewhere under
    /usr/share/vared and let the rest up to the user. If she wants to use
    vared she needs to source the shell code suitable for her shell
    somehow. Second approach is to extend the default config files of the
    supported shells in the /etc directory. Hm, sounds very ugly to me and
    it doesn't really do the job. AFAIK we have no generalized mechanism
    like the one provided by the tcsh (do a foreach in a certain directory
    and source all contained files)?

    Michael

    --
    biff4emacsen - A biff-like tool for (X)Emacs
    http://www.c0t0d0s0.de/biff4emacsen/biff4emacsen.html
    Flood - Your friendly network packet generator
    http://www.c0t0d0s0.de/flood/flood.html


    --
    To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

  2. Re: Packaging shell functions

    Michael Welle wrote:
    > Hi,
    >
    > I'm packaging a little tool called vared. Vared relies on some shell
    > functions and/or aliases that must have been sourced into the
    > environment before usage. What may be the best pratice to package
    > such shell functions?

    I would take a look on packaging of 'apparix' tool, it relies on shell
    aliases too for its work.

    --
    Eugene V. Lyubimkin aka JackYF


    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.9 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iEYEARECAAYFAkjt9MsACgkQchorMMFUmYzmCwCeILJCXIWocX ov9RVMcF4lSdhP
    KrUAnA6ArmR78Ts16qGZyqpG2DAlZajC
    =nAgu
    -----END PGP SIGNATURE-----


  3. Re: Packaging shell functions

    Hi,

    "Eugene V. Lyubimkin" writes:

    > Michael Welle wrote:
    >> Hi,
    >>
    >> I'm packaging a little tool called vared. Vared relies on some shell
    >> functions and/or aliases that must have been sourced into the
    >> environment before usage. What may be the best pratice to package
    >> such shell functions?

    > I would take a look on packaging of 'apparix' tool, it relies on shell
    > aliases too for its work.

    the user have to copy and paste shell code fragments that are
    generated by the apparix binary. This way no person can harm the
    packaging guy if some config files are gone south .

    Michael

    --
    biff4emacsen - A biff-like tool for (X)Emacs
    http://www.c0t0d0s0.de/biff4emacsen/biff4emacsen.html
    Flood - Your friendly network packet generator
    http://www.c0t0d0s0.de/flood/flood.html


    --
    To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

  4. Re: Packaging shell functions

    Hi,

    Michael Meskes writes:

    >> I'm packaging a little tool called vared. Vared relies on some shell
    >> functions and/or aliases that must have been sourced into the
    >> environment before usage. What may be the best pratice to package
    >> such shell functions?
    >> ...

    >
    > How about a little wrapper setting the environment and then executing the real
    > tool?

    vared [1] lets you edit environment variables an a fancy way and than
    it sets their new value in your current shell session. The shell
    functions/aliases are a crude way to work around some limitations
    (environment variables can only be propagated downwards the process
    tree). With this setup I see no way to build a wrapper, in other
    words, the shell functions/aliases are allready a wrapper .

    Michael, too

    [1] http://www.c0t0d0s0.de/vared/

    --
    biff4emacsen - A biff-like tool for (X)Emacs
    http://www.c0t0d0s0.de/biff4emacsen/biff4emacsen.html
    Flood - Your friendly network packet generator
    http://www.c0t0d0s0.de/flood/flood.html


    --
    To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

  5. Re: Packaging shell functions

    > I'm packaging a little tool called vared. Vared relies on some shell
    > functions and/or aliases that must have been sourced into the
    > environment before usage. What may be the best pratice to package
    > such shell functions?
    > ...


    How about a little wrapper setting the environment and then executing the real
    tool?

    Michael
    --
    Michael Meskes
    Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
    Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
    ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
    Go VfL Borussia! Go SF 49ers! Use Debian GNU/Linux! Use PostgreSQL!


    --
    To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

  6. Re: Packaging shell functions

    On Thu, Oct 09, 2008 at 03:04:28PM +0200, Michael Welle wrote:
    > vared [1] lets you edit environment variables an a fancy way and than
    > it sets their new value in your current shell session. The shell
    > functions/aliases are a crude way to work around some limitations
    > (environment variables can only be propagated downwards the process
    > tree). With this setup I see no way to build a wrapper, in other
    > words, the shell functions/aliases are allready a wrapper .


    Or you could switch to zsh, which already has vared implemented in a
    non-hacky way.

    Enjoy!


    --
    To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

  7. Re: Packaging shell functions

    Hi,

    Clint Adams writes:

    > On Thu, Oct 09, 2008 at 03:04:28PM +0200, Michael Welle wrote:
    >> vared [1] lets you edit environment variables an a fancy way and than
    >> it sets their new value in your current shell session. The shell
    >> functions/aliases are a crude way to work around some limitations
    >> (environment variables can only be propagated downwards the process
    >> tree). With this setup I see no way to build a wrapper, in other
    >> words, the shell functions/aliases are allready a wrapper .

    >
    > Or you could switch to zsh, which already has vared implemented in a
    > non-hacky way.

    naughty Clint, no coffee for you the rest of the day . Vared is
    inspired by its zsh pendant. But before changing to zsh I will cut off
    my fingers . So I decided to make this nice feature available for
    (all?) other shells around this world.

    VG
    hmw

    --
    biff4emacsen - A biff-like tool for (X)Emacs
    http://www.c0t0d0s0.de/biff4emacsen/biff4emacsen.html
    Flood - Your friendly network packet generator
    http://www.c0t0d0s0.de/flood/flood.html


    --
    To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

+ Reply to Thread