08-05-2009
Shell Program to create a RPM name
Hi Guru,s/Geek,s
I need help to create RPM names from rpms.
Example :
a2ps-4.14-6.fc10.i386
perl-Email-Find-0.10-2.fc10.noarch
directfb-1.2.7-2.fc10.i386
libid3tag-0.15.1b-7.fc10.i386
apr-util-1.3.7-1.fc10.i386
libquicktime-1.0.3-4.fc10.i386
The Desired Output is :
a2ps
perl-Email-Find
directfb
libid3tag
apr-util
libquicktime
The characters from package version in a line should be removed in order to get the rpm name. I need the rpm names to do a yum.
Please help :P
Last edited by anand.linux1984; 08-05-2009 at 10:41 AM..
10 More Discussions You Might Find Interesting
1. Programming
I have a function in a c program that I want to to share with other programs.
How do I create a lib using the cc compiler ? (9 Replies)
Discussion started by: npires
9 Replies
2. Red Hat
Hi All,
I had created a installer (RPM), but later I came across that Netbeans (netbeans-6.9-ml-linux), Flex Builder Linux Alpha (flexbuilder_linux_install_a4_081408.bin) and JDK (jdk-6u20-linux-i586-rpm.bin) dont provide any RPM but they provide a huge binary executable shell script.
My... (0 Replies)
Discussion started by: jw_amp
0 Replies
3. Shell Programming and Scripting
Hi ,
Please help me getting this done.
Write an automated shell program(s) that can create, monitor the log files and report the issues for matching pattern.
(i) Conditions for creating log files.
Log file is created with date (example 2010_03_27.log). If the log file size is 10 Mb for... (1 Reply)
Discussion started by: itian2010
1 Replies
4. Shell Programming and Scripting
How to make RPM not write to RPM database if RPM fails to deploy?
IE I create an rpm spec file that contains the following
if
then
exit 1
fi
My rpm will fail at deployment, but if I do rpm -qa , I can see the rpm in the rpm db (3 Replies)
Discussion started by: 3junior
3 Replies
5. UNIX for Dummies Questions & Answers
I m planning to use puppet to implement organizational linux hardening policies across the linux servers.
To begin with i have downloaded.
puppet-2.7.1.tar.gz and tried some basic configuration to get start with puppet.
Now i want to roll out the puppet but before that i would like to make... (7 Replies)
Discussion started by: pinga123
7 Replies
6. Red Hat
I would like to package my developed application and deploy it using RPM to my users. Understand that RHEL5 has the following directories created:
/usr/src/redhat/BUILD
/usr/src/redhat/RPMS
/usr/src/redhat/SOURCES
/usr/src/redhat/SPECS
/usr/src/redhat/SRPMS
Using KDevelop as my... (0 Replies)
Discussion started by: tanlccc
0 Replies
7. Programming
I would like to package my developed application and deploy it using RPM to my users. Understand that RHEL5 has the following directories created:
/usr/src/redhat/BUILD
/usr/src/redhat/RPMS
/usr/src/redhat/SOURCES
/usr/src/redhat/SPECS
/usr/src/redhat/SRPMS
Using KDevelop as my... (0 Replies)
Discussion started by: tanlccc
0 Replies
8. UNIX for Dummies Questions & Answers
I m referring below article for creating rpm.
Installation and Setup Rpmbuild Tutorial
As per the document i will need rpmdevtools and rpmlint to begin with.
However i have yum installed and whenever i run them i get below output.
# yum install rpmdevtools rpmlint
Setting up Install Process... (0 Replies)
Discussion started by: pinga123
0 Replies
9. UNIX for Advanced & Expert Users
I am trying to figure out what rpm package a program is a part of. I have tried the normal way.
rpm -qa | grep -i programname
What other ways can you try? (3 Replies)
Discussion started by: cokedude
3 Replies
10. Red Hat
i would like to package up an rpm from pre-installed files, say i have a program called "widget" installed under "/opt/widget"
/opt/widget/bin/*
/opt/widget/lib/*
/opt/widget/etc/*
/opt/widget/log/*
and i want to create an rpm from those already installed files, what would the spec file... (2 Replies)
Discussion started by: melixir
2 Replies
RPM2(3) User Contributed Perl Documentation RPM2(3)
NAME
RPM2 - Perl bindings for the RPM Package Manager API
SYNOPSIS
use RPM2;
my $db = RPM2->open_rpm_db();
my $i = $db->find_all_iter();
print "The following packages are installed (aka, 'rpm -qa'):
";
while (my $pkg = $i->next) {
print $pkg->as_nvre, "
";
}
$i = $db->find_by_name_iter("kernel");
print "The following kernels are installed (aka, 'rpm -q kernel'):
";
while (my $pkg = $i->next) {
print $pkg->as_nvre, " ", int($pkg->size()/1024), "k
";
}
$i = $db->find_by_provides_iter("kernel");
print "The following packages provide 'kernel' (aka, 'rpm -q --whatprovides kernel'):
";
while (my $pkg = $i->next) {
print $pkg->as_nvre, " ", int($pkg->size()/1024), "k
";
}
print "The following packages are installed (aka, 'rpm -qa' once more):
";
foreach my $pkg ($db->find_by_file("/bin/sh")) {
print $pkg->as_nvre, "
";
}
my $pkg = RPM2->open_package("/tmp/XFree86-4.1.0-15.src.rpm");
print "Package opened: ", $pkg->as_nvre(), ", is source: ", $pkg->is_source_package, "
";
DESCRIPTION
The RPM2 module provides an object-oriented interface to querying both the installed RPM database as well as files on the filesystem.
CLASS METHODS
Pretty much all use of the class starts here. There are two main entrypoints into the package -- either through the database of installed
rpms (aka the rpmdb) or through a file on the filesystem (such as kernel-2.4.9-31.src.rpm or kernel-2.4.9-31.i386.rpm
You can have multiple RPM databases open at once, as well as running multiple queries on each.
open_rpm_db(-path => "/path/to/db")
As it sounds, it opens the RPM database, and returns it as an object.
open_package("foo-1.1-14.noarch.rpm")
Opens a specific package (RPM or SRPM). Returns a Header object.
RPM DB object methods
find_all_iter()
Returns an iterator object that iterates over the entire database.
find_all()
Returns an list of all of the results of the find_all_iter() method.
find_by_file_iter($filename)
Returns an iterator that returns all packages that contain a given file.
find_by_file($filename)
Ditto, except it just returns the list
find_by_name_iter($package_name)
You get the idea. This one is for iterating by package name.
find_by_name($package_name)
Ditto, except it returns a list.
find_by_provides_iter($provides_string)
This one iterates over provides.
find_by_provides($provides_string)
Ditto, except it returns a list.
find_by_requires_iter($requires_string)
This one iterates over requires.
find_by_requires($requires_string)
Ditto, except it returns a list.
RPM Header object methods
stuff goes here
TODO
Package installation and removal.
Signature validation.
HISTORY
0.01 Initial release
AUTHOR
Chip Turner <cturner@redhat.com>
SEE ALSO
perl. The original RPM module.
perl v5.8.0 2002-11-08 RPM2(3)