473,398 Members | 2,403 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

anaconda.real in RH7.1


I'm trying to reinstall RedHat 7.1 Linux on a PC that was disabled when
I tried to upgrade from RH7.1 to RH9. This is presenting lots of unexpected
difficulties. Apart from wanting to keep the old model T in shape, I'm treating
this as a learning experience. Right now, I'm trying to gain more control
over the installation CD. By that I mean, I intend to modify the installation
script and other aspects of the CD and burn a new installation CD. The
installation script starts off as a shell script named anaconda which
then calls a python script named anaconda.real. The former is pretty easy
to understand, but I don't know anything about python. At the moment, I'm
using the book, "Programming Python", by Mark Lutz, as a reference. The
file anaconda.real is about 526 lines long. I've copied out about an eighth
of it into a notebook and am trying to use the book to make sense of what
I have copied. I'm not finding it very helpful. I don't know whether that
is because the script relies on aspects of python that aren't well explained
in the book or because it relies on aspects of RedHat Linux. I thought I
should ask here first about what seem like purely python issues.

The file anaconda.real is invoked with the line
exec /usr/bin/anaconda.real -T "$@"
I don't know what effect the -T "$@" has.

The file anaconda.real begins:

#!/usr/bin/python
signal.signal(signal.SIGINT,signal.SIG_DFL)

There is nothing about signal or signal.signal or the other signal.*
in the book. The file continues:

# For anaconda in test mode
if (os.path.exists('isys'))
sys.path.append('edd')
sys.path.append('libfdisk')
[lots of lines like that]
else:
sys.path.append('/usr/lib/anaconda')
sys.path.append('/usr/lib/anaconda/textw')
sys.path.append('/usr/lib/anaconda/iw')
sys.path.append('/usr/lib/anaconda/installclasses')

Here I'm guessing that the if never happens and the various /usr/lib/anaconda
directories are appended to the PATH environment variable.

Later on, after importing traceback (which is briefly mentioned in the book),
string, isys, iutil, _ from translate, handleException from exception, it
apparently worries about the environment variable ANACONDAARGS and then
executes

try:
(args, extra) = isys.getopt(theargs, 'GTRxtdr:fm:',
['gui','text','reconfig','xmode','test','debug','no fallback',
'method=','rootpath=',...

Anyway, in a nutshell, whenever I see anything specific in the file
anaconda.real, it isn't mentioned in the book and I don't know how to
get more information about it and I don't know how python gets its information
about it.

What do I need to read?
--
Ignorantly,
Allan Adler <ar*@zurich.csail.mit.edu>
* Disclaimer: I am a guest and *not* a member of the MIT CSAIL. My actions and
* comments do not reflect in any way on MIT. Also, I am nowhere near Boston.
Sep 2 '05 #1
4 2274
Allan Adler wrote:
I'm using the book, "Programming Python", by Mark Lutz, as a reference.


No offence to Mark Lutz or O'Reilly but I consider "Programming Python"
one of the worst books I have read (in my case an old first edition).
It overwhelms the beginning programmer ("Learning Python" is probably
better for that), it bores the experienced programmer to death with
introductory details and does not work as a reference book. It is a
nice survey of application areas for python, but the book lacks a clear
goal, purpose and a problem it tries to address. It needs more focus.
It needs to be marketed correctly also. I believe too many people new
to python buy that book and get discouraged about Python, O'Reilly and
programming when they should buy something else instead.

That said what you probably want is "Python in a Nutshell" by O'Reilly
which is a good reference book it has a concise introduction of Python
in the beginning and after that, documentation for the most usefull
libraries out there.

Personally I use the online documentation a lot:

If I know the the name of the module
(for example it starts with sys.zz) I use:
http://www.python.org/doc/2.4.1/modindex.html

If I know what I want but not the name I use:
http://www.python.org/doc/2.4.1/lib/lib.html

Sep 2 '05 #2
pr*******@latinmail.com wrote:
If I know the the name of the module
(for example it starts with sys.zz) I use:
http://www.python.org/doc/2.4.1/modindex.html

If I know what I want but not the name I use:
http://www.python.org/doc/2.4.1/lib/lib.html


I have a Firefox Quick Search installed with keyword: pymod and location:

http://www.python.org/doc/lib/module-%s.html

or on a Windows box where I have the docs installed locally:

file:///C:/Documentation/Python-Docs-2.4/lib/module-%s.html
--
Michael Hoffman
Sep 2 '05 #3
Allan Adler <ar*@nestle.csail.mit.edu> writes:
I'm trying to reinstall RedHat 7.1 Linux on a PC that was disabled when
I tried to upgrade from RH7.1 [....]
The file anaconda.real is invoked with the line
exec /usr/bin/anaconda.real -T "$@"
I don't know what effect the -T "$@" has.


Tiny progress on this: in a shell script, "$@" apparently lets you refer
to the output of a previous command. I don't know what output would be
relevant, since the last few lines of the shell script anaconda that
invokes anaconda.real are:

cd /usr/sbin
uncpio < sbin.cgz
rm sbin.cgz
cd /lib
uncpio < libs.cgz
rm libs.cgz
cd /
exec /usr/bin/anaconda.real -T "$@"

As for exec itself, the command line
exec -T
leads to a complaint that -T is an illegal option for exec, while
python -T
leads to a usage statement that doesn't list -T among the options for python.
So, I still don't understand the statement that is used to call the python
script anaconda.real.

I also tried to execute in interactive session some of the commands in the
file anaconda.real. E.g. the first command signal.signal(SIGINT,SIG_DFL)

Python 1.5.2 (#1, Mar 3 2001, 01:35:43)
[GCC 2.96 20000731 (Red Hat Linux 7.1 2 on linux-i386
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
signal.signal(SIGINT,SIG_DFL) Traceback (innermost last):
File "<stdin>", line 1, in ?
NameError: signal import signal
signal.signal(SIGINT,SIG_DFL) Traceback (innermost last):
File "<stdin>", line 1, in ?
NameError: SIGINT import SIGINT

Traceback (innermost last):
File "<stdin>", line 1, in ?
ImportError: No module named SIGINT

On the other hand, while looking at Kernighan and Pike, "The Unix programming
environment" (1984), I fortuitously ran across a discussion of signals and
interrupts on p.225, including the example

#include <signal.h>
signal(SIGINT,SIG_DFL)

which restores default action for process termination. The resemblance to the
first command in anaconda.real is so close that I think the intention in
both must be the same. What is the right way to get python to do this?

The file anaconda.real doesn't explicitly execute
import signal
but it still somehow knows what signal means (my example session above shows
that it stops complaining about not knowing what signal means after I import
signal). Presumably there is some way of invoking python that causes signal
and other stuff to be imported automatically. What is it?
--
Ignorantly,
Allan Adler <ar*@zurich.csail.mit.edu>
* Disclaimer: I am a guest and *not* a member of the MIT CSAIL. My actions and
* comments do not reflect in any way on MIT. Also, I am nowhere near Boston.
Sep 7 '05 #4
Allan Adler wrote:
Allan Adler <ar*@nestle.csail.mit.edu> writes:

I'm trying to reinstall RedHat 7.1 Linux on a PC that was disabled when
I tried to upgrade from RH7.1 [....]
The file anaconda.real is invoked with the line
exec /usr/bin/anaconda.real -T "$@"
I don't know what effect the -T "$@" has.

Tiny progress on this: in a shell script, "$@" apparently lets you refer
to the output of a previous command. I don't know what output would be
relevant, since the last few lines of the shell script anaconda that
invokes anaconda.real are:

cd /usr/sbin
uncpio < sbin.cgz
rm sbin.cgz
cd /lib
uncpio < libs.cgz
rm libs.cgz
cd /
exec /usr/bin/anaconda.real -T "$@"

$@ doesn't refer to the output of a previous command. It refers to a
list of quoted arguments of the script it's a part of. It's supposed,
IIRC, to be equivalent to

exec /usr/bin/anaconda.real -T "$1" "$2" "$2" ...

as opposed to $*, which would be equivalent to

exec /usr/bin/anaconda.real -T $1 $2 $3 ...
As for exec itself, the command line
exec -T
leads to a complaint that -T is an illegal option for exec, while
python -T
leads to a usage statement that doesn't list -T among the options for python.
So, I still don't understand the statement that is used to call the python
script anaconda.real.
What's supposed to happen is that anaconda.real is supposed to be
processed by the Python interpreter. You will probably find a "shebang"
line at the start of anaconda.real that reads something like

#!/usr/bin/python1.5.2

The -T argument is, I suspect, intended for anaconda.real - you could
check the source and verify that it looks at sys.argv.
I also tried to execute in interactive session some of the commands in the
file anaconda.real. E.g. the first command signal.signal(SIGINT,SIG_DFL)

Python 1.5.2 (#1, Mar 3 2001, 01:35:43)
[GCC 2.96 20000731 (Red Hat Linux 7.1 2 on linux-i386
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
signal.signal(SIGINT,SIG_DFL)
Traceback (innermost last):
File "<stdin>", line 1, in ?
NameError: signal
import signal
signal.signal(SIGINT,SIG_DFL)
Traceback (innermost last):
File "<stdin>", line 1, in ?
NameError: SIGINT
import SIGINT

Traceback (innermost last):
File "<stdin>", line 1, in ?
ImportError: No module named SIGINT

On the other hand, while looking at Kernighan and Pike, "The Unix programming
environment" (1984), I fortuitously ran across a discussion of signals and
interrupts on p.225, including the example

#include <signal.h>
signal(SIGINT,SIG_DFL)

which restores default action for process termination. The resemblance to the
first command in anaconda.real is so close that I think the intention in
both must be the same. What is the right way to get python to do this?

SIGINT is defined in the signal module so you probably want

signal.signal(signal.SIGINT, signal.SIG_DFL)
The file anaconda.real doesn't explicitly execute
import signal
but it still somehow knows what signal means (my example session above shows
that it stops complaining about not knowing what signal means after I import
signal). Presumably there is some way of invoking python that causes signal
and other stuff to be imported automatically. What is it?


On that one you have me stumped. It's possible it imports some other
module that plays with the namespace in a magical way.

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/

Sep 7 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Ken | last post by:
Hi. Can anyone refer me to any articles about the compatibility between c++ polymorphism and real-time programming? I'm currently on a real-time c++ project, and we're having a discussion...
4
by: Aaron W. West | last post by:
Timings... sometimes there are almost too many ways to do the same thing. The only significant findings I see from all the below timings is: 1) Integer math is generally fastest, naturally....
3
by: Gérard Talbot | last post by:
Hello all, When webfonts are used for purely cosmetic/ornemental reasons and on a large scale, I don't agree. When webfonts are used because Unicode support among browsers for a particular...
10
by: Pavils Jurjans | last post by:
Hallo, It is know issue that due to the fact that computer has to store the real numbers in limited set of bytes, thus causing a minor imprecision from the decimal value that likely was stored....
17
by: David Scemama | last post by:
Hi, I'm writing a program using VB.NET that needs to communicate with a DOS Pascal program than cannot be modified. The communication channel is through some file databases, and I have a huge...
0
by: support | last post by:
Veteran Real Estate Investor Shares some of his best Insider Secrets for successful investments! www.RealEstateBeginners.ws Have you ever wondered about investing in real estate? Maybe one...
34
by: Guch Wu | last post by:
Boost has many terrific libraries. But I want to know whether they are ready for using in real projects. Which of them are mature enough, or just only in progress?
16
by: DirtyHarry | last post by:
Good day everyone. This sounds like a stupid question, but I became just curious yesterday, and I looked up several textbooks. However, no textbooks on computer language (that I have ) mentioned...
3
by: Kurt Mueller | last post by:
David, Am 07.10.2008 um 01:25 schrieb Blubaugh, David A.: As others mentioned before, python is not the right tool for "HARD REAL TIME". But: Maybe you can isolate the part of your...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.