Ugh, tardist prereq generator

IRIX/Nekoware development, porting and related topics.
Forum rules
Any posts concerning pirated software or offering to buy/sell/trade commercial software are subject to removal.
User avatar
semi-fly
Posts: 786
Joined: Fri Feb 21, 2003 5:29 am
Location: Ypsitucky, MI
Contact:

Ugh, tardist prereq generator

Unread postby semi-fly » Sat May 15, 2004 5:18 pm

I know there's a way to automatically generate tardist prereqs but I couldn't find / rember a way to properly do it (lots of head scratching here). So, I whiped up a little script to do it for me! 'prereq_gen' takes a filename and generates a pre-formated, sorted prereq list to your home directory ready for tardists. Just cut-in-paste! Here's a sample:

Code: Select all

prereq (
compiler_eoe.sw.lib 1279199510 maxint
compiler_eoe.sw64.lib 1279199510 maxint
dmedia_eoe.sw.base 1289570120 maxint
dmedia_eoe.sw64.lib 1289570120 maxint
eoe.sw.base 1289570120 maxint
eoe.sw64.lib 1289570120 maxint
ftn_eoe.sw64.lib 1279199510 maxint
ftn_eoe.sw64.libblas 1279199510 maxint
fw_gettext.sw.lib 1278985220 maxint
fw_glib.sw.lib 1278773620 maxint
fw_gtk+.sw.lib 1278773820 maxint
fw_xmms.sw.lib 1278774820 maxint
)


If winds up being in the least bit useful I'll add command line ops, a menu and batching. It's extensive, so it gets everything. Tardist available with release notes and docs or...




Code: Select all

#!/bin/sh

# See '/usr/local/relnotes/prereq_gen.txt' for more info

echo ""
# Friendly welcome screen
echo "#######################################################"
echo "# Handy-Dandy prereq generator for irix 6.5 and others"
echo "# Version 0.0.0.1 alpha"
echo "#######################################################"
echo ""

# Check for the target folder, which is located in users
# home directory
if ! [ -d $HOME/generated ]
then
   mkdir -p $HOME/generated
fi

# check the tmp file(s) used for data parsing left over from
# previous generated files.  If found, dump 'em. $USER variable
# is added to avoid overlaping files

if [ -w /tmp/$USER.req_tmp -o -w /tmp/$USER.req_sorted ]
then
   rm /tmp/req_tmp 2> /dev/null ; rm /tmp/req_sorted 2> /dev/null
fi

# Read in user selected file to be generated
echo "^^^^^^^^^^^^^^^"
echo "Enter filename: "
read FILENAME

ldd $FILENAME > /dev/null 2> /dev/null
if [ $? -eq 0 ]
then
   echo "File looks good, proceding.."
else
   echo "File not executable or in binary format, bailing out.."
   exit 1
fi

# perfer cut to awk here
for x in `ldd $FILENAME | cut -d" " -f 1`
do
  versions long | grep $x | awk '{print $4}' | sort -u >> /tmp/$USER.req_tmp
done

if [ `echo $FILENAME | grep '\/'` ]
then
   FILENAME_MOD=`echo $FILENAME | sed 's/^.*\///g'`
fi
# This section needs fixing
echo "prereq (" > $HOME/generated/$FILENAME_MOD.req

for y in `cat /tmp/$USER.req_tmp`
do
   versions -n | grep $y | awk '{print $2,$3, "maxint"}' >> /tmp/$USER.req_sorted
done

# Finally, sort it all out
cat /tmp/$USER.req_sorted | sort -u >> $HOME/generated/$FILENAME_MOD.req

echo ")" >> $HOME/generated/$FILENAME_MOD.req

echo ""
echo "Prereq file generated!"
echo "Generated file name: $FILENAME_MOD.req"
echo ""
configure complete, now type 'make' and pray.

User avatar
whiter
Posts: 972
Joined: Tue Apr 29, 2003 2:02 pm
Location: Winterthur, Switzerland
Contact:

Unread postby whiter » Mon May 17, 2004 1:27 am

autopkg ( http://www.nekochan.net/wiki/downloads/contr ... kg.tardist ) comes with a nice script for a long time already that does that for ya ;-)
But I'll be looking to your progress on this subject since I realy have no time for this stuff at the moment.
Shall I describe it to you? Or do you want me to get you a box?


Return to “SGI: Development”

Who is online

Users browsing this forum: Google [Bot] and 2 guests