LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 07-28-2011, 03:23 AM   #1
salilgk
LQ Newbie
 
Registered: Jun 2009
Posts: 20

Rep: Reputation: 0
Question rpmbuild : need help with spec file.


Hello

In my rpm spec file I need to put the following command in the post section.

echo "`rpm -qa --qf \"%-11{SIZE} %{NAME}\n\" | sort -k1n`" >>%{mytest_conf}

But during installation it fails . I think the part "\"%-11{SIZE}" is creating the issue. Any idea how to get rid of it?

Thanks
~S
 
Old 07-28-2011, 11:01 AM   #2
dafydd2277
Member
 
Registered: Mar 2010
Posts: 58

Rep: Reputation: 5
This is the first time I've seen those % constructions for use in a spec file, so I can't offer specific advice. My generic troubleshooting thought is to try doing something like

Code:
echo "%-11{SIZE}" >>%{mytest_conf}
echo "%{NAME}" >>%{mytest_conf}
echo "`rpm -qa --qf \"%-11{SIZE} %{NAME}\n\" | sort -k1n`" >>%{mytest_conf}
and see if the basic variable substitution is happening properly.
 
Old 07-29-2011, 10:05 AM   #3
salilgk
LQ Newbie
 
Registered: Jun 2009
Posts: 20

Original Poster
Rep: Reputation: 0
Hi
thanks for the reply. this may not work as I found that the problem is with '-' like in the command

echo "`rpm -qa --qf \"%-11{SIZE} %{NAME}\n\" | sort -k1n`" >>%{mytest_conf}

if I change to

echo "`rpm -qa --qf \"%11{SIZE} %{NAME}\n\" | sort -k1n`" >>%{mytest_conf}

it works.

thanks
~S
 
  


Reply

Tags
rpmbuild, spec


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rpmbuild spec file for virtual rpm - removing obsolete packages - CentOS/RHEL 5.3 DrLove73 Linux - Software 3 10-10-2009 10:22 AM
rpmbuild a spec file when a BuildRequires is not installed carltm Linux - Software 1 12-08-2008 06:45 PM
Need help with RPMBUILD .spec included wadevondoom Linux - Software 3 07-27-2006 06:59 PM
Problem with rpmbuild and template.spec file abefroman Linux - Software 0 11-27-2005 12:18 AM
rpmbuild -ba php.spec pk21 Linux - General 0 09-16-2003 09:34 AM


All times are GMT -5. The time now is 06:59 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration