Hi all,
I’m new to PHP and have started to venture into build my first application.
The application will be used to manage system packages but already in the early stages I’ve encountered an issue I’m finding hard to resolve.
The basic idea is to query each package individually in a folder of packages with a ‘rpm -qpi <package name>’ shell command which when run outputs the following to console:
[root@mrbuild CentOS]# rpm -qpi ntp-4.2.2p1-9.el5.centos.2.1.x86_64.rpm
Name : ntp Relocations: (not relocatable)
Version : 4.2.2p1 Vendor: CentOS
Release : 9.el5.centos.2.1 Build Date: Sat 19 Dec 2009 12:56:26 AM GMT
Install Date: (not installed) Build Host: builder10.centos.org
Group : System Environment/Daemons Source RPM: ntp-4.2.2p1-9.el5.centos.2.1.src.rpm
Size : 2594086 License: distributable
Signature : DSA/SHA1, Sat 19 Dec 2009 12:01:47 PM GMT, Key ID a8a447dce8562897
URL : http://www.ntp.org
Summary : Synchronizes system time using the Network Time Protocol (NTP).
Description :
The Network Time Protocol (NTP) is used to synchronize a computer’s
time with another reference time source. The ntp package contains
utilities and daemons that will synchronize your computer’s time to
Coordinated Universal Time (UTC) via the NTP protocol and NTP servers.
The ntp package includes ntpdate (a program for retrieving the date
and time from remote machines via a network) and ntpd (a daemon which
continuously adjusts system time).
Install the ntp package if you need tools for keeping your system’s
time synchronized via the NTP protocol.
I’d like to loop this command for each package and somehow capture the output for each package ready to be inserted in to a database.
The end result being I have a database of all package names along with the information about that package.
Any help or ideas would be much appreciated.
Thanks
Mark