[3592] in SIPB_Linux_Development

home help back first fref pref prev next nref lref last post

testing failure

daemon@ATHENA.MIT.EDU (Angie Kelic)
Fri Nov 30 18:35:50 2001

Message-Id: <200111302335.SAA02914@prowler.mit.edu>
To: linux-dev@MIT.EDU
Date: Fri, 30 Nov 2001 18:35:39 -0500
From: Angie Kelic <sly@MIT.EDU>

Note: someone who knows python should sanity check the command.

So, it turns out that the script runs in a CHROOT'd environment
of /mnt/sysimage -- this means that any reference to / will
do the wrong thing.

Can you please revert the changes I made?

I submit the following as a slightly cleaner way to do the whole
thing in python that won't actually require anyone to change
anything in this script or extraneous files when they copy in
new RPMS -- basically, it figures out which athena version it
is on its own (we hope):

prowler:~ % diff -u installclass.py.src installclass.py
--- installclass.py.src	Fri Nov 30 18:32:16 2001
+++ installclass.py	Fri Nov 30 18:12:01 2001
@@ -220,7 +220,7 @@
 	self.setPostScript('''
 #!/bin/sh
 
-ATHENAVERSION=8.4.0
+ATHENAVERSION=`machtype -L`
 ROOT=/
 
 # Get network address:
@@ -290,14 +290,14 @@
   fi
 fi
 
-# This is a kluge and requires knowing how rpmupdate parses the
-# release-rpms file.  It also assumes we are not doing any custom
-# installs, since it lists every installed rpm in release-rpms.
-# rpmupdate knows that any rpm listed in release-rpms was all
-# installed by the release, and if the release doesn't think the rpm
-# should be installed any more, rpmupdate will remove it.
-rpm -qa --queryformat '/%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm\n' | \
-	grep -v '^kernel-smp' > /var/athena/release-rpms
+#Let's try this in Python, it's cleaner and will require fewer changes
+#This copies the correct version of release-rpms out of afs using the
+#web (we need to export the variable before python can use it)
+
+ATHENA_URL="http://web.mit.edu/afs/athena/system/rhlinux/control/list-$ATHENAVERSION"
+export ATHENA_URL
+
+python -c "import os, urllib; open('/var/athena/release-rpms', 'w').write(urllib.urlopen(os.environ['ATHENA_URL'])).read())"
 
 cp /tmp/install.log /var/athena/install.log
 chmod 600 /var/athena/install.log


home help back first fref pref prev next nref lref last post