Or, if you are using bash then you could use bash's own String manipulation mechanism, e.g.
Code:
echo ${STRING%.rpm*}
[edit]: Just saw your latest post. So is it correct to assume that this line is inside a file and not stored in a variable?
In this case:
Code:
sed 's/\.rpm.*$//' inputfile
You might have to provide a representative sample of you input data.