LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
Search this Thread
Old 12-10-2008, 01:26 PM   #1
jakev383
QmailToaster Developer
 
Registered: Dec 2005
Location: Burlington, NC
Distribution: CentOS, Voyage, Debian, Fedora
Posts: 220

Rep: Reputation: 31
Need help with building an RPM and performing a check in the build phase


I'm building an RPM, and can successfully do so.
I'd like to add a check in my .spec file to see if a uid is already in use and exit the whole process if it is already in use. I tried this in %prep:
Code:
if [ -z `/bin/cat /etc/passwd | /bin/grep 89` ]; then
        /bin/echo "User id 89 is already is use. Cannot continue!"
        exit 1
fi
As well as this during %build :
Code:
if [ -z `/bin/grep 89 /etc/passwd` ]; then
        /bin/echo "User id 89 is already is use. Cannot continue!"
        exit 1
fi
And it keeps going through even though it's already in use (I created a user with uid 89 to test).
Anyone have any suggestions?
Thanks in advance.
 
Old 12-10-2008, 02:44 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,561
Blog Entries: 54

Rep: Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927
The %prep phase only concerns building the package so this does not make a lot of sense to me: after all you can not control where the package will be built. If you still want to kill it you could try something like 'getent passwd 89 >/dev/null 2>&1||pkill -9 -f "rpmbuild -"' thought that doesn't leave the process any time to clean up the build dir or whatever else.
 
  


Reply


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble building a Cross Compiler to use to build a x86_64 kernel. nLEyETn Linux - Software 2 05-08-2007 07:35 PM
How can I generate / build and RPM from *.src.rpm file sreekumartg Red Hat 3 02-23-2007 06:23 PM
Help building an .rpm from a .src.rpm ssenuta Linux - Software 6 04-10-2006 11:36 PM
Building RPM via src.Rpm ivanatora Linux - Newbie 2 02-20-2006 05:29 PM
cannot build source rpm/ rpm questions kpachopoulos Fedora 3 07-24-2005 10:15 AM


All times are GMT -5. The time now is 11:41 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