First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 48950
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo Quality Assistance Team <qa@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Aron Griffis (RETIRED) <agriffis@gentoo.org>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
econf-no-die.txt list of offending ebuilds text/plain Aron Griffis (RETIRED) 2004-04-25 09:44 0000 76.10 KB Details
econf-no-die.txt updated attachment to fix false hits text/plain Aron Griffis (RETIRED) 2004-04-25 09:48 0000 69.21 KB Details
econf-no-die.txt sorted list text/plain Aron Griffis (RETIRED) 2004-04-25 09:55 0000 71.45 KB Details
econf-no-die.txt remove more false positives text/plain Aron Griffis (RETIRED) 2004-04-25 14:27 0000 58.08 KB Details
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 48950 depends on: Show dependency tree
Bug 48950 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2004-04-25 09:43 0000
resently the econf function in /usr/sbin/ebuild.sh calls die on its
own.  This is unfortunate, because die is designed to tell you at what
line, with a custom message, an ebuild failed.  When functions in
ebuild.sh call die directly, then both those features are thwarted.
The line number is useless (we don't _care_ where it died in
ebuild.sh) and the message is hard-coded.

It would be really good to (1) educate developers to never assume that
die() is called automatically from ebuild.sh, (2) fix the ebuilds to
call die when econf fails, (3) remove the automatic die from econf()

------- Comment #1 From Aron Griffis (RETIRED) 2004-04-25 09:44:46 0000 -------
Created an attachment (id=30018) [edit]
list of offending ebuilds

------- Comment #2 From Aron Griffis (RETIRED) 2004-04-25 09:48:25 0000 -------
Created an attachment (id=30019) [edit]
updated attachment to fix false hits

find . -name \*.ebuild | xargs perl -0777 -ne 's/\\\n/ /g; s/\n\s*assert\b/ ||
die/g; s/\beconf\b.*\bdie\b//g; s/#.*econf//g; /^.*\beconf\b.*$/m && print
"$ARGV: $&\n"' > econf-no-die.txt

------- Comment #3 From Aron Griffis (RETIRED) 2004-04-25 09:55:28 0000 -------
Created an attachment (id=30021) [edit]
sorted list

find . -name \*.ebuild | xargs perl -0777 -ne 's/\\\n/ /g; s/\n\s*assert\b/ ||
die/g; s/\beconf\b.*\bdie\b//g; s/#.*econf//g; while (/^.*\beconf\b.*$/mg) {
print "$ARGV: $&\n" }' | sort > econf-no-die.txt

------- Comment #4 From Aron Griffis (RETIRED) 2004-04-25 14:27:43 0000 -------
Created an attachment (id=30039) [edit]
remove more false positives

find . -name \*.ebuild | xargs perl -0777 -ne 's/\\\n/ /g; s/\n\s*assert\b/ ||
die/g; s/^.*\beconf\b.*\bdie\b.*//gm; s/#.*econf.*//g; while
(/^.*\beconf\b.*$/mg) { print "$ARGV: $&\n" }' | sort > econf-no-die.txt 

------- Comment #5 From Aron Griffis (RETIRED) 2004-04-26 13:05:25 0000 -------
Ok, I finished #2, now for #1 and #3

------- Comment #6 From Aron Griffis (RETIRED) 2004-04-26 13:18:37 0000 -------
Here is what I did for #2, btw

$ sed -e 's/^..//; s|/[^/]*:.*||;' econf-no-die.txt | sort -u | while read p; do pushd $p; rm *.ebuild .#* ChangeLog; cvs up; echo "**** $p **************************************"; perl -0777 -i -pe 's/^[^#\n]*\beconf\b(?:.*?[^\\\n])*?(?=\n)/($t = $&) =~ m{\bdie\b} ? $t : $t . " || die \"econf failed\""/mges' *.ebuild; cvs diff || { read -p "Look good?" yesno </dev/tty; if [[ $yesno != [nN]* ]]; then echangelog "Add die following econf for bug 48950"; rc; else xterm; fi; }; popd; done

rc is a bash function that runs repoman commit with the most recent ChangeLog entry as the commit message.  This bash one-liner let me verify each cvs diff before hitting <enter> to make the commit.

I'm just posting this for interest's sake, and for future reference.

------- Comment #7 From Mr. Bones. 2004-04-26 13:28:06 0000 -------
How about adding rc as an attachment for completion?

------- Comment #8 From Aron Griffis (RETIRED) 2004-04-26 13:53:56 0000 -------
I don't think it needs to be an attachment.  Here is rc() and er().  I didn't
use er() in this exercise, but it is useful in other cases.  Most developers
would need to modify the list of architectures in rc().  I develop for alpha,
ia64 and x86, so I ignore repoman's complaining if it is made up of entirely
other-architecture-specific problems.  Of course, this means that I refrain
from using rc() in situations where I might have actually broken something
related to another architecture.

# repoman commit with the message from the ChangeLog
rc ()  
{
  local msg=`perl <ChangeLog -00 -ne \
    's/^  \d{2} \w{3} \d{4};.*?:\n  //s and chomp, s/\s+/ /g, print($_), exit'`
  if [[ -z "$msg" ]]; then
      echo "no ChangeLog message found" 1>&2
      return 1
  fi  
  local out=`repoman commit -m "$msg" "$@" | tee /dev/tty`
  echo "$out" | grep -Eq 'CVS commit complete' && return 0
  echo "$out" | grep -Eq 'alpha|ia64|x86' && return 1
  repoman commit -m "$msg" --ignore-other-arches "$@"
}   

# echangelog and repoman combined
er() {
  rm -f ChangeLog
  cvs up ChangeLog || return 1
  echangelog "$*" || return 1
  rc
}

------- Comment #9 From Aron Griffis (RETIRED) 2004-05-25 12:10:01 0000 -------
testing bugzilla ... ignore this comment

------- Comment #10 From Alec Warner 2007-03-26 07:00:54 0000 -------
Can probably close this, die has supported tracebacks for nearly 12 months.  It
should no longer matter if econf has || die after it or not.

First Last Prev Next    No search results available      Search page      Enter new bug