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

Re: Small [patch] (install_depends) and should I apply it?



On Mon, Apr 09, 2001 at 07:12:47PM -0400, Adam Di Carlo wrote:
> Ian Lynagh <igloo@earth.li> writes:
> 
> > I've just started looking at the boot floppies and I am unclear on this.
> > As a Debian developer to I have write access to the CVS repository, and
> > if so, should I send patches here or apply them myself?
> 
> If there is any doubt, you should send patches here for review.
> 
> In this case, I'm glad you sent it here for review first.

OK, cool.

> > I have attached a patch that creates an install_depends to complement
> > check_depends, as well as laying the code out slightly more clearly.
> > +	   $$_=`sed -n s/^Depends://Ip debian/control`."$(depends_checks)"; \
> 
> Shouldn't we be looking at Build-Depends now?  Actually, they are the
> same...  I'm not really sure...

No. Build depends are what is needed to build the boot-floppies package,
depends is what is needed to use it. We are looking for the packages we
need to use it.

> > +	   $$/="\n\n"; y/,/ /; s/\(.*?\)//g; @M{split()}=""; \
> > +	   while (<>) { \
> >  	     /^Status: \S+ \S+ installed$$/ms or next; \
> >  	     delete $$M{$$1} if /^Package: (\S+)/ms; \
> >  	     delete @M{split(/ *, */,$$1)} if /^Provides: (.+?)$$/ms; \
> > -	   } foreach my $$m (keys %M) { print "  didn'\''t find $$m\n" } \
> > -	   exit 1 if %M' /var/lib/dpkg/status
> > +	   } \
> > +	   my @to_install; \
> > +	   my $$package; \
> > +	   foreach my $$m (keys %M) { \
> > +	       print "  didn'\''t find $$m\n"; \
> > +	       if ($$install_missing) { \
> > +	           ($$package = $$m) =~ s/glibc-pic/libc6-pic/; \
> > +	           push @to_install, $$package; \
> 
> Um, this is not kosher.  Why are you replacing glibc-pic with
> libc6-pic?  That will break on alpha.  Don't do that.

Ah, hmmm, hadn't thought of other architectures.
The reason it was necessary is that apt won't pick a package when
you give it a virtual package (even if there is only 1 candidate).

> > +	       } \
> > +	   } \
> > +	   if (%M) { \
> > +	       unshift @to_install, "apt-get", "install"; \
> > +	       unshift @to_install, "$(ROOTCMD)" if "$(ROOTCMD)"; \
> > +	       exit system(@to_install) >> 8 \
> > +	           if $$install_missing; \
> 
> Woah woah woah... do *not* start installing packages -- you have to
> assume this is being run as a user, not root.

Why? I thought the idea was that if they could build boot disks then
they could get root via $(ROOTCMD)?

> Perhaps it would be good to emit the apt-get install cmdline they need
> to run.  But do *not* just run it...

I think if someone types "make install_depends" then they should expect
things to be installed?

With the virtual packages problem I suggest we ask Jason about an option
to force apt to pick something to provide a package (based on priority
and then just pick a random one if that doesn't work) (I'm not missing
an option that does that already am I?), and if he says that isn't
possible then just print it out in check_depends instead?


Thanks
Ian



Reply to: