add another install failure, convert shell scripting to use posix sh

This commit is contained in:
Sven Vermeulen 2010-09-08 22:52:10 +02:00
parent bb025d6d1b
commit 429f755e20
3 changed files with 66 additions and 19 deletions

View File

@ -1,3 +1,8 @@
** (2010-09-08) Sven Vermeulen <sven.vermeulen@siphos.be>
- Shell scripting using Posix SH, not bash
- Add 'multiple package instances within single package slot' install
failure information
** (2010-09-04) Sven Vermeulen <sven.vermeulen@siphos.be> ** (2010-09-04) Sven Vermeulen <sven.vermeulen@siphos.be>
- Simple spellcheck - Simple spellcheck
- Add in system requirement paragraph (especially disk space) - Add in system requirement paragraph (especially disk space)

View File

@ -1868,6 +1868,48 @@ xen [Subversion] (source: http://overlays....)</programlisting>
using the / help search system).</para> using the / help search system).</para>
</section> </section>
<section>
<title>Multiple packages within a single package slot</title>
<para>When software is being installed, Portage verifies if all
requirements are met. This includes USE requirements that some
packages have on others. For instance, kdelibs requires dbus, built
with the USE="X" setting. If for some other reason dbus is being
pulled in without X (an ebuild requires dbus without X, or you changed
your USE flags to disallow X in USE), you might get the following
error message:</para>
<programlisting>!!! Multiple package instances within a single package slot have been pulled
!!! into the dependency graph, resulting in a slot conflict:
sys-apps/dbus:0
('ebuild', '/', 'sys-apps/dbus-1.2.24', 'merge') pulled in by
&gt;=sys-apps/dbus-1.0.2 required by ('installed', '/', 'x11-libs/qt-dbus-4.6.2', 'nomerge')
sys-apps/dbus required by ('installed', '/', 'app-misc/strigi-0.7.1', 'nomerge')
&gt;=sys-apps/dbus-1.1 required by ('installed', '/', 'dev-libs/dbus-glib-0.86', 'nomerge')
('installed', '/', 'sys-apps/dbus-1.2.24', 'nomerge') pulled in by
sys-apps/dbus[X] required by ('installed', '/', 'kde-base/kdelibs-4.4.5', 'nomerge')
(and 3 more)
Explanation:
New USE for 'sys-apps/dbus:0' are incorrectly set. In order to solve
this, adjust USE to satisfy 'sys-apps/dbus[X]'.</programlisting>
<para>If this is due to a change in USE flags, undo the change (in the
above case, setting USE to "-X" generally was a bad idea). If you need
a particular USE setting, you can use /etc/portage/package.use to
change the USE settings of one or more packages without affecting the
entire system.</para>
<para>If this due to packages with conflicting dependencies, you'll
either need to drop one of the packages, or file a bug at <ulink
url="https://bugs.gentoo.org">https://bugs.gentoo.org</ulink> and ask
for a proper solution.</para>
</section>
<section> <section>
<title>Other Issues</title> <title>Other Issues</title>

View File

@ -103,14 +103,15 @@ Try 'ls --help' for more information
to chain such commands. Its use is less pertinent in regular shell to chain such commands. Its use is less pertinent in regular shell
operations, but more in shell scripts (for instance for error operations, but more in shell scripts (for instance for error
handling). Yet, it is still useful for regular shell operations, as handling). Yet, it is still useful for regular shell operations, as
the following (perhaps too simple, yet explanatory) example shows:</para> the following (perhaps too simple, yet explanatory) example
shows:</para>
<programlisting>~$ <command>mount /media/usb || sudo mount /media/usb</command></programlisting> <programlisting>~$ <command>mount /media/usb || sudo mount /media/usb</command></programlisting>
<para>The command sequence tries to mount the /media/usb location. If <para>The command sequence tries to mount the /media/usb location. If
for any reason this fails (for instance, because the user does not for any reason this fails (for instance, because the user does not
have the rights to mount), retry but using <command>sudo</command>. have the rights to mount), retry but using
</para> <command>sudo</command>.</para>
</section> </section>
<section> <section>
@ -163,9 +164,9 @@ dev-perl/libwww-perl-5.836
containing the string 'completed emerge'. The results of the containing the string 'completed emerge'. The results of the
<command>grep</command> operation is then piped to the <command>grep</command> operation is then piped to the
<command>awk</command> application which prints out the 8th field <command>awk</command> application which prints out the 8th field
(where white space is a field separator), which is the category/package (where white space is a field separator), which is the
set. This allows you to follow a lengthy emerge process without having category/package set. This allows you to follow a lengthy emerge
to keep an eye on the entire output of process without having to keep an eye on the entire output of
<command>emerge</command>.</para> <command>emerge</command>.</para>
<para>The | sign passes through the standard output of a process. If <para>The | sign passes through the standard output of a process. If
@ -187,7 +188,7 @@ dev-perl/libwww-perl-5.836
</indexterm> assigned. This is a number that uniquely identifies a </indexterm> assigned. This is a number that uniquely identifies a
file for a specific application. The file descriptors 0, 1 and 2 are file for a specific application. The file descriptors 0, 1 and 2 are
reserved for standard input, standard output and standard error reserved for standard input, standard output and standard error
output. </para> output.</para>
<para>The 2&gt;&amp;1 suffix tells Unix/Linux that the file descriptor <para>The 2&gt;&amp;1 suffix tells Unix/Linux that the file descriptor
2 (standard error) should be redirected (&gt;) to file descriptor 1 2 (standard error) should be redirected (&gt;) to file descriptor 1
@ -224,7 +225,7 @@ dev-perl/libwww-perl-5.836
<para>Shells also offer a way to group commands. If you do this, it is <para>Shells also offer a way to group commands. If you do this, it is
said that you create a sub-shell that contains the commands you want to said that you create a sub-shell that contains the commands you want to
execute. Now why would this be interesting? </para> execute. Now why would this be interesting?</para>
<para>Well, suppose that you want to update your system, followed by an <para>Well, suppose that you want to update your system, followed by an
update of the file index. You don't want them to be ran simultaneously update of the file index. You don't want them to be ran simultaneously
@ -285,7 +286,7 @@ iptables -A FORWARD -i tap0 -o eth0 -s 192.168.100.1/24 ! -d 192.168.100.1/24 -j
iptables -A FORWARD -o tap0 -i eth0 -d 192.168.100.1/24 ! -s 192.168.100.1/24 -j ACCEPT</programlisting> iptables -A FORWARD -o tap0 -i eth0 -d 192.168.100.1/24 ! -s 192.168.100.1/24 -j ACCEPT</programlisting>
<para>Can you imagine having to retype all that (let alone on a single <para>Can you imagine having to retype all that (let alone on a single
command line, separated with ;) </para> command line, separated with ;)</para>
<para>To execute the script, give it an appropriate name (say <para>To execute the script, give it an appropriate name (say
"enable_virt_internet"), mark it as executable, and execute it:</para> "enable_virt_internet"), mark it as executable, and execute it:</para>
@ -333,7 +334,7 @@ iptables -A FORWARD -o tap0 -i eth0 -d 192.168.100.1/24 ! -s 192.168.100.1/24 -j
the file (this must be the first line of the script), in this case to the file (this must be the first line of the script), in this case to
inform Linux that this is a bash shell script:</para> inform Linux that this is a bash shell script:</para>
<programlisting>#!/bin/bash <programlisting>#!/bin/sh
# Load in virtualisation modules # Load in virtualisation modules
modprobe tun modprobe tun
...</programlisting> ...</programlisting>
@ -350,16 +351,16 @@ modprobe tun
<para>A shell script like the above is still quite simple, but also <para>A shell script like the above is still quite simple, but also
error-prone. If you had your share of issues / incidents with that error-prone. If you had your share of issues / incidents with that
script, you will most likely start adding error conditions inside it. script, you will most likely start adding error conditions inside
</para> it.</para>
<para>First, make sure that we are root. We can verify this by reading <para>First, make sure that we are root. We can verify this by reading
the special variable $UID (a read-only variable giving the user id of the special variable $UID (a read-only variable giving the user id of
the user executing the script):</para> the user executing the script):</para>
<programlisting>#!/bin/bash <programlisting>#!/bin/sh
if [[ $UID -ne 0 ]]; if [ $UID -ne 0 ];
then then
echo "Sorry, this file needs to be executed as root!" echo "Sorry, this file needs to be executed as root!"
exit 1; exit 1;
@ -478,11 +479,10 @@ Failed to load in module tun
<section> <section>
<title>Want more?</title> <title>Want more?</title>
<para>This is as far as I want to go with a book targeting Linux <para>This is as far as I want to go with a book targeting Linux starters.
starters. You should now have enough luggage to make it through various You should now have enough luggage to make it through various online
online resources and other books, and still have a reference at your resources and other books, and still have a reference at your disposal for
disposal for your day-to-day activities on your (Gentoo) Linux your day-to-day activities on your (Gentoo) Linux system.</para>
system.</para>
<para>I would like to thank you for reading this document, and if you have <para>I would like to thank you for reading this document, and if you have
any particular questions or feedback, please don't hesitate to contact me any particular questions or feedback, please don't hesitate to contact me