[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Help needed with #159208




> On Thu, Sep 05, 2002 at 07:48:38AM -0500, Dirk Eddelbuettel wrote:
> > 
> > 
> > > You should depend on exactly the Python versions you support, not on
> > > "python". For example
> > > Depends: python1.5 | python2.1 | python2.2
> > 
> > I see. But why not simply   "Depends: python (>= 1.5)"
> 
> I think this is wrong. If this is a package with python scripts, then they
> will probably have '#!/usr/bin/python', in which case the dependancy
should
> be;
> 
> Depends: python (>=1.5), python (<<2.3)
> 
> You could make a package of scripts that could work with "python1.5 |
> python2.1 | python2.2", but it would either require seperate
foo-python1.5,
> foo-python2.1, and foo-python2.2 scripts, or some sort of smart dispatcher
> that could find and run the right installed /usr/bin/pythonX.Y.
> 
> Remember, /usr/bin/python is a symlink installed by the "python" package,
> and without a dependancy on this package there is no gaurentee that it
will
> be there. You can't just use "#!/usr/bin/python" without depending on the
> "python" package.

Aren't we now fully circular?  At first I suggested "Depends: python",
and now you recommend the same to me. I guess I need more coffee...
 
And what about the   #!/usr/bin/env  trick?  Can't that be used to call
whatever suitable python interpreter is found in the $PATH?

> >  
> > > And if you dont compile any Python packages, why do you still have to
> > > build-depend on python-dev?
> > 
> > Quite right, good point -- thanks.
> 
> I _think_ you are saying that this package used to include compiled
> "*.py[oc]" files and now it doesn't. That is good.

Correct.
 
> However, if it still includes *.py modules that are "imported", then you
> still need to be very careful. Python will create and save "*.pyc" files
> when these modules are imported. However, typicaly only root has write
> access to the directories where these *.py files are installed. This means
> these *.pyc files are only created when root runs the scripts that import
> them.
>
> Worse, if the default python is upgraded, then the old *.pyc files
cannot by
> "updated" by python, and hang around until root happens to "import" them
> again.
> 
> I'm pretty sure python silently doesn't save *.pyc files if it can't,
making
> them be re-compiled every "import". It also re-compiles them if the
*.pyc's
> are from a different version of python. This means worst case, python
> silently checks existing *.pyc's, recompiles them, then throws them
away for
> every run.

It is somewhat of a non-issue "by design" as wajig is written to be a
higher-level wrapper around tasks requiring root. But wajig is only ever
called as a normal user, and if and when su powers are needed, sudo is
invoked /from inside the python script/ so that no python code should
ever run as root.
 
> The proper way of handling this is for the postinst scripts to compile the
> *.pyc modules, and the postinst script to remove them. The really
complicated 
> stuff starts to happen when these script+module packages support multiple
> versions of python... If you need more info on this just ask.

I sort-of-know as I once went that route, but it turned out to create
only headaches.  

A simple "Depends: python" still looks terribly appealing to me.

Dirk  (who quite likes the kiss principle)

-- 
According to the latest figures, 43% of all signatures are totally
worthless.   



Reply to: