Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 25216 - mkboot in debianutils uses qpkg to search all packages
Summary: mkboot in debianutils uses qpkg to search all packages
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-24 17:27 UTC by Andy Dustman
Modified: 2003-09-24 19:56 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Make mkboot not read the whole portage tree (debianutils-1.16.7-gentoo.patch,7.35 KB, patch)
2003-07-24 17:29 UTC, Andy Dustman
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Dustman 2003-07-24 17:27:18 UTC
In /usr/sbin/mkboot grubcheck(), grub is tested for by the line:

[ "$(qpkg -nc sys-apps/grub)" = "sys-apps/grub *" ]

This is a big time-waster, because it crawls the entire portage tree. If your
portage tree is mounted via NFS, this is painful...

A better solution is:

[ "$(qpkg -I -nc sys-apps/grub)" = "sys-apps/grub" ]

An updated version of debianutils-1.16.7-gentoo.patch will be attached.

Reproducible: Always
Steps to Reproduce:
1. Use mkboot, usually via kernel's make install
2.
3.

Actual Results:  
It finds grub (slowly)

Expected Results:  
Find grub (quickly)
Comment 1 Andy Dustman 2003-07-24 17:29:26 UTC
Created attachment 14976 [details, diff]
Make mkboot not read the whole portage tree

This is a modified version of debianutils-1.16.7-gentoo.patch in the current
portage tree which makes the grubcheck() function of mkboot much faster.
Comment 2 Jon Riley 2003-08-12 07:38:25 UTC
I bumped up against this but in a worse form - It's not just slow, it doesn't work.

The line
[ "$(qpkg -I -nc sys-apps/grub)" = "sys-apps/grub" ]
Fails to detect my grub because I also have grub-static installed, which causes qpkg to return

sys-apps/grub *
sys-apps/grub-static

which fails the test.

Comment 3 Jon Riley 2003-08-12 07:49:15 UTC
Quick correction - I typoed

[ "$(qpkg -nc sys-apps/grub)" = "sys-apps/grub *" ]

Is the line that doesn't work

[ "$(qpkg -I -nc sys-apps/grub)" = "sys-apps/grub" ]

does work.
Comment 4 Gregorio Guidi (RETIRED) gentoo-dev 2003-09-11 03:07:50 UTC
if [ -x /usr/bin/qpkg ] ; then 
  [ "$(qpkg -I -nc sys-apps/grub)" = "sys-apps/grub" ] 
else 
  return 1 
fi 
 
This never returns zero! 
At least it should be: 
 
if [ -x /usr/bin/qpkg ] ; then 
  [ "$(qpkg -I -nc sys-apps/grub)" = "sys-apps/grub" ] && return 0 
else 
  return 1 
fi 
 
But it cannot fail just because gentoolkit is not installed, and there's the 
grub-static problem... Summing up, why don't we simply have 
if [ -f /boot/grub/grub.conf ] ; then 
  return 0 
else 
  return 1 
fi 
 
Comment 5 Martin Schlemmer (RETIRED) gentoo-dev 2003-09-24 19:26:40 UTC
As /boot might not be mounted ...
Comment 6 Martin Schlemmer (RETIRED) gentoo-dev 2003-09-24 19:56:20 UTC
Anyhow, use portageq and not quickpkg.