Difference between pages "Package:Irssi" and "Repository Configuration"

(Difference between pages)
 
(New repository layout: describe options)
 
Line 1: Line 1:
{{Ebuild
+
{{Warning|This article is a work-in-progress referring to a future Portage version. It does not apply to the current Funtoo Portage version. Please do not update your configuration yet.}}
|Summary=A modular textUI IRC client with IPv6 support.
+
|CatPkg=net-irc/irssi
+
|Maintainer=
+
|Homepage=http://www.irssi.org/
+
}}
+
  
=== Description ===
+
Starting with Portage-2.3.8, a switch to a new repository configuration framework is complete and users may want to update their configuration files. This document aims to describe the goals for the new framework and how to use it.
irssi is a small command line IRC client based on ncurses. It's a great thing to use when you SSH into a server, or just simply for your main IRC client.  
+
  
=== Installation ===
+
== Multiple repository layout ==
The install of irssi is pretty straight forward. There are not many USE flags, but one that is worth looking at is the {{c|SSL}} flag. This enables you to use SSL when connecting to servers.
+
One of the most important changes is the switch from the old ''overlay'' layout to a new cleaner ''repository'' system. The new layout is more flexible and more predictable. For example, repositories can now use resources (eclasses, for example) provided by other repositories.
{{console|body=
+
###i## echo "net-irc/irssi ssl" >> /etc/portage/package.use
+
###i## emerge irssi
+
}}
+
=== Using irssi ===
+
Using irssi initially can be a little intimidating if you're not used to command line programs. To first start irssi, you just simply run:
+
{{console|body=
+
$ ##i##irssi
+
}}
+
There are flags you can pass to the command line while starting irssi, such as:
+
{{console|body=
+
$ ##i##irssi -n mynick -c irc.freenode.org
+
}}
+
This would connect you to Freenode with the nick 'mynick'. Or alternatively you can just run the {{c|irssi}} command and connect via SSL if you need to:
+
{{file|body=
+
/connect -ssl irc.freenode.org
+
}}
+
This will automatically connect you over port 6697.  
+
  
When you have connected to the server of your choice, you can join a channel simply by:
+
The old layout was based on the concept of one ''main tree'' and optionally a number of overlays. The main tree provided base system ebuilds, eclasses, profiles, while overlays mostly were able to provide their own ebuilds. The ebuild provided by overlays overrode the ebuilds in main tree to the extend of making it impossible to install the main tree version. Overlays could also provide eclasses for their own ebuilds and package.* entries that applied to all overlays and to the main tree. The Package Manager is responsible for updating the main tree, while overlays are managed externally.
{{file|body=
+
/j #funtoo
+
}}
+
If you want to leave any channel you've entered you can use the {{c|part}} command:
+
{{file|body=
+
/part #funtoo reasons...
+
}}
+
There are a few ways of navigating through your channels, you can use {{c|alt+<nowiki>{1-9}{q-p}</nowiki>}}, or alternatively you can use the {{c|window}} command that is in irssi:
+
{{file|body=
+
/window 1
+
/window 2
+
/window 3
+
}}
+
For as many channels you are apart of.  
+
  
When you're ready to leave, you can simply type in:
+
The new layout is based on the concept of one or more configurable repositories. Each repository can either be stand-alone or depend upon other repositories. The distribution provides a repository called ''funtoo'' (a drop-in replacement for Gentoo's ''gentoo'' repository). Users can install more repositories at they will, the repositories providing their own ebuilds, eclasses and profiles as necessary and/or using them from other repositories. Users can explicitly choose the repository they want to install packages from. The Package Manager can update all repositories.
{{file|body=
+
/exit
+
}}
+
Which will close out connections to the IRC networks you've joined, and take you back to your console window.
+
=== Themes and scripts ===
+
==== Scripts ====
+
There are a few things you can do to make irssi look a little bit better and add some cool features. There are a few plugins that are pretty useful, such as {{c|fnotify.pl}} which is a script that utilizes {{f|libnotify}} to send you popup notifications for when your nick is pinged or you are sent a private message.  
+
  
{{file|name=fnotify.pl|lang=perl|desc=fnotify.pl|body=
+
== Portage configuration ==
# todo: grap topic changes
+
=== New repository layout ===
 +
The repository configuration should be stored in ''/etc/portage/repos.conf''. It can be either a single file or a directory containing one or more .conf files.
  
use strict;
+
The default configuration is installed as ''/usr/share/portage/config/repos.conf''. This file must not be modified. Instead, the configuration in ''/etc/portage/repos.conf'' can override the defaults specified there.
use vars qw($VERSION %IRSSI);
+
  
use Irssi;
+
The configuration uses format similar to Windows .ini files. Each section heading (repository name in square brackets) signifies a single repository, followed by one or more key-value option pairs. For example, the following file copies default configuration for Funtoo repository:
$VERSION = '0.0.3';
+
%IRSSI = (
+
authors    => 'Thorsten Leemhuis',
+
contact    => 'fedora@leemhuis.info',
+
name       => 'fnotify',
+
description => 'Write a notification to a file that shows who is talking to you in which channel.',
+
url        => 'http://www.leemhuis.info/files/fnotify/',
+
license    => 'GNU General Public License',
+
changed    => '$Date: 2007-01-13 12:00:00 +0100 (Sat, 13 Jan 2007) $'
+
);
+
  
#--------------------------------------------------------------------
+
{{file|name=/etc/portage/repos.conf/funtoo.conf|desc=Example configuration override for Funtoo repository|body=
# In parts based on knotify.pl 0.1.1 by Hugo Haas
+
[funtoo]
# http://larve.net/people/hugo/2005/01/knotify.pl
+
# moved to non-default location!
# which is based on osd.pl 0.3.3 by Jeroen Coekaerts, Koenraad Heijlen
+
location = /var/db/repos/funtoo
# http://www.irssi.org/scripts/scripts/osd.pl
+
sync-type = git
#
+
sync-uri = git://github.com/funtoo/ports-2015.git
# Other parts based on notify.pl from Luke Macken
+
auto-sync = yes
# http://fedora.feedjack.org/user/918/
+
#
+
#--------------------------------------------------------------------
+
 
+
#--------------------------------------------------------------------
+
# Private message parsing
+
#--------------------------------------------------------------------
+
 
+
sub priv_msg {
+
my ($server,$msg,$nick,$address,$target) = @_;
+
filewrite($nick." " .$msg );
+
}
+
 
+
#--------------------------------------------------------------------
+
# Printing hilight's
+
#--------------------------------------------------------------------
+
 
+
sub hilight {
+
    my ($dest, $text, $stripped) = @_;
+
    if ($dest->{level} & MSGLEVEL_HILIGHT) {
+
filewrite($dest->{target}. " " .$stripped );
+
    }
+
}
+
 
+
#--------------------------------------------------------------------
+
# The actual printing
+
#--------------------------------------------------------------------
+
 
+
sub filewrite {
+
my ($text) = @_;
+
# FIXME: there is probably a better way to get the irssi-dir...
+
        open(FILE,">>$ENV{HOME}/.irssi/fnotify");
+
print FILE $text . "\n";
+
        close (FILE);
+
}
+
 
+
Irssi::signal_add_last("message private", "priv_msg");
+
Irssi::signal_add_last("print text", "hilight");
+
 
+
#- end
+
}}
+
Another very useful script is for colored nicks, to better tell people apart. Which can be found at [http://scripts.irssi.org irssi scripts] called {{f|nickcolor.pl}}. 
+
 
+
When you have the scripts you would like you would put them into {{f|~/.irssi/scripts}} and set a link to {{f|~/.irssi/scripts/autorun}}.
+
{{console|body=
+
$ ##i##wget -O ~/.irssi/scripts/nickcolor.pl http://scripts.irssi.org/scripts/nickcolor.pl
+
$ ##i##cd ~/.irssi/scripts/autorun
+
$ ##i##ln -s ~/.irssi/scripts/nickcolor.pl .
+
$ ##i##ln -s ~/.irssi/scripts/fnotify.pl .
+
}}
+
You can do this for as many scripts as you've chosen to use. They will automatically load when you start irssi. You can also manually load scripts:
+
{{file|body=
+
/load ~/.irssi/scripts/fnotify.pl
+
Irssi: Loaded script fnotify
+
}}
+
Whichever works best for you is what you should do.
+
==== Themes ====
+
You can choose from many themes on the [http://irssi.org/themes irssi themes] page if you don't like the default look of it. Once you've chosen the them you like, you can simply put it in your {{f|~/.irssi/}} directory and when you run just run:
+
{{file|body=
+
/set theme mycooltheme
+
 
}}
 
}}
And there you have it, the theme you have chosen is now there.
 
=== Conclusion ===
 
irssi is a great IRC client, and really helpful if you spend a lot of time in a terminal emulator or on a server.
 
  
== External Resources ==
+
The most useful repository configuration options are listed below:
[http://www.irssi.org/documentation Further documentation]
+
;location: ''Obligatory.'' Specifies the directory where repository is/will be stored. If Portage knows how to sync the repository and the location does not exist, it will be created on next ''emerge --sync''. Otherwise, the directory must exist.
 +
;priority: Specifies the priority used for ordering ebuilds from different repositories. If two repositories provide an ebuild with matching versions, the repository with higher priority will be used.
 +
;auto-sync: Specifies whether ''emerge --sync'' should update the repository. Defaults to ''yes'' if ''sync-type'' is specified, ''no'' otherwise.
 +
;sync-depth: Specifies ''--depth'' for git clone. Used only on initial sync. Defaults to 1. Can be set to 0 to force full clone (not pass ''--depth'' at all).
 +
;sync-type: Specifies syncing/update method. Can be one of: ''cvs'', ''git'', ''rsync'', ''svn''.
 +
;sync-umask: Specifies the umask used when updating/syncing the repository.
 +
;sync-uri: Specifies remote URI from which the repository will be cloned/synced. Can use any syntax valid for a particular syncing method.
 +
;sync-user: Specifies the user[:group] used to update/sync the repository. If ''FEATURES=usersync'' is used, defaults to the credentials of directory owner.
  
{{EbuildFooter}}
+
[[Category:Portage]]
[[Category:IRC]]
+

Revision as of 11:23, February 14, 2015

Warning

This article is a work-in-progress referring to a future Portage version. It does not apply to the current Funtoo Portage version. Please do not update your configuration yet.

Starting with Portage-2.3.8, a switch to a new repository configuration framework is complete and users may want to update their configuration files. This document aims to describe the goals for the new framework and how to use it.

Multiple repository layout

One of the most important changes is the switch from the old overlay layout to a new cleaner repository system. The new layout is more flexible and more predictable. For example, repositories can now use resources (eclasses, for example) provided by other repositories.

The old layout was based on the concept of one main tree and optionally a number of overlays. The main tree provided base system ebuilds, eclasses, profiles, while overlays mostly were able to provide their own ebuilds. The ebuild provided by overlays overrode the ebuilds in main tree to the extend of making it impossible to install the main tree version. Overlays could also provide eclasses for their own ebuilds and package.* entries that applied to all overlays and to the main tree. The Package Manager is responsible for updating the main tree, while overlays are managed externally.

The new layout is based on the concept of one or more configurable repositories. Each repository can either be stand-alone or depend upon other repositories. The distribution provides a repository called funtoo (a drop-in replacement for Gentoo's gentoo repository). Users can install more repositories at they will, the repositories providing their own ebuilds, eclasses and profiles as necessary and/or using them from other repositories. Users can explicitly choose the repository they want to install packages from. The Package Manager can update all repositories.

Portage configuration

New repository layout

The repository configuration should be stored in /etc/portage/repos.conf. It can be either a single file or a directory containing one or more .conf files.

The default configuration is installed as /usr/share/portage/config/repos.conf. This file must not be modified. Instead, the configuration in /etc/portage/repos.conf can override the defaults specified there.

The configuration uses format similar to Windows .ini files. Each section heading (repository name in square brackets) signifies a single repository, followed by one or more key-value option pairs. For example, the following file copies default configuration for Funtoo repository:

/etc/portage/repos.conf/funtoo.conf - Example configuration override for Funtoo repository
[funtoo]
# moved to non-default location!
location = /var/db/repos/funtoo
sync-type = git
sync-uri = git://github.com/funtoo/ports-2015.git
auto-sync = yes

The most useful repository configuration options are listed below:

location
Obligatory. Specifies the directory where repository is/will be stored. If Portage knows how to sync the repository and the location does not exist, it will be created on next emerge --sync. Otherwise, the directory must exist.
priority
Specifies the priority used for ordering ebuilds from different repositories. If two repositories provide an ebuild with matching versions, the repository with higher priority will be used.
auto-sync
Specifies whether emerge --sync should update the repository. Defaults to yes if sync-type is specified, no otherwise.
sync-depth
Specifies --depth for git clone. Used only on initial sync. Defaults to 1. Can be set to 0 to force full clone (not pass --depth at all).
sync-type
Specifies syncing/update method. Can be one of: cvs, git, rsync, svn.
sync-umask
Specifies the umask used when updating/syncing the repository.
sync-uri
Specifies remote URI from which the repository will be cloned/synced. Can use any syntax valid for a particular syncing method.
sync-user
Specifies the user[:group] used to update/sync the repository. If FEATURES=usersync is used, defaults to the credentials of directory owner.