【发布时间】:2013-07-03 12:32:38
【问题描述】:
我有一个应用程序,我想在其中获取几个包的 RPM 信息并以令人愉悦和引人注目的方式对其进行格式化。 *繁荣*。
我的问题是rpm想把数据格式化成两列,很烦。
命令
rpm -qi ruby
结果
Name : ruby Relocations: (not relocatable)
Version : 1.8.6.36 Vendor: (none)
Release : 2 Build Date: Thu 18 Sep 2008 10:50:30 AM EDT
Install Date: Thu 25 Sep 2008 12:12:53 PM EDT Build Host: kickbench
Group : Development/Languages Source RPM: ruby-1.8.6.36-2.src.rpm
Size : 1664035 License: Ruby License/GPL - see COPYING
Signature : (none)
URL : http://www.ruby-lang.org/
Summary : An interpreter of object-oriented scripting language.
Description : [truncated]
我想要什么
Name : ruby
Relocations : (not relocatable)
Version : 1.8.6.36
Vendor : (none)
Release : 2
Build Date : Thu 18 Sep 2008 10:50:30 AM EDT
Install Date: Thu 25 Sep 2008 12:12:53 PM EDT
Build Host : kickbench
Group : Development/Languages
Source RPM : ruby-1.8.6.36-2.src.rpm
Size : 1664035
License : Ruby License/GPL - see COPYING
Signature : (none)
URL : http://www.ruby-lang.org/
Summary : An interpreter of object-oriented scripting language.
Description : [truncated]
有没有办法在不手动指定真正长的--queryformat 的情况下获得这种格式?
或者,任何方法都可以在 Ruby 中执行此操作。
【问题讨论】: