Mailinglist Archive: opensuse (3784 mails)

< Previous Next >
Truncating Strings
  • From: Jon Pennington <cowboydren@xxxxxxxxx>
  • Date: Thu, 18 Oct 2001 23:42:37 -0700 (PDT)
  • Message-id: <20011019064238.86577.qmail@xxxxxxxxxxxxxxxxxxxxxxx>
Okay, so it's kind of late (early?) to be looking for gurus, but
here's the bit. I'm trying to fabricate my own YaST-style package
selection list (dren.sel). I started the Eval CD, and did:

# rpm -qa > dren.sel

Which is what I wanted to start with, 'cause it has a good selection
of packages I want, and not too many that I don't want. Then I
sorted it:

# sort eval.sel > dren.sel

Later on, I'll add the necessary header information, but for now, I
need to strip the extra RPM version data from the file. It has a
list of RPMs like this:

WindowMaker-0.64.0-63
a2ps-4.13-74
aaa_base-2001.5.22-0

But I need a list like this:

WindowMaker
a2ps
aaa_base

So I need a quick and dirty way to strip every line of every
"-[0,9]*" and keep the rest of the name intact. It's a bit tricker
since some packages don't use underscores but hyphens to seperate
parts of the package name, such as alsa-devel, which means you can't
just strip everything past the first hypen. Whaddayathink?

=====
--
-=|JP|=- Hit me! - http://www.xanga.com/cowboydren/
Jon Pennington | Debian 2.3 -o)
cowboydren @ yahoo . com | Auto Enthusiast /\\
Kansas City, MO, USA | ICQ UIN 69 67 29 31 _\_V

__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

< Previous Next >