LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-12-2013, 05:00 AM   #1
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Rep: Reputation: 33
RPM-Script: token place?


I know if you don't want to replace a file you do as follow:

Code:
...
%files -f %{_tmppath}/profile.filelist
%config(noreplace)%{cfg_basedir}/configuration
But if I do want to replace the file (eventhoug it is not changed) how can I do? I try use the (replace) instaed of (noreplace) but I got error message such as :

Code:
...
Invalid %config token: replace
...

Last edited by thomas2004ch; 11-12-2013 at 06:44 AM.
 
Old 11-13-2013, 02:17 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by thomas2004ch View Post
But if I do want to replace the file (eventhoug it is not changed) how can I do?
Question is why do you think you would need to? If the MD5 hash, mtime, user, group, perms and other stat nfo hasn't changed what would overwriting a file accomplish? Exactly. Nothing at all!
 
Old 11-14-2013, 02:33 AM   #3
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
Hi,

You haven't answered my question.

If it's neccesary to change or replayce the file, and/or if it's possible to force to replace the file are two different things. I want the answer to the later one.

Besides, what you said is not correct. I've change only the mtime of file, but it was not replaced. Only I do any change in the file, such as add a space, this file is replaced. This means, only the md5 changed then the file will be replaced.

Last edited by thomas2004ch; 11-14-2013 at 05:22 AM.
 
Old 11-15-2013, 02:35 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Simple: just don't mark it as config.
 
1 members found this post helpful.
Old 11-18-2013, 04:07 AM   #5
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
Wonderful, many thanks!
 
Old 11-19-2013, 02:29 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
That may sound wonderful to you but that may also cause unexpected behaviour as now there's no mechanism for detecting changed configuration files. So until you understand the ways RPM deals with things it would be best not to override defaults with your own ideas.
 
  


Reply



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
symlink tool to pull together rpm components in one place equick Linux - Software 7 03-05-2012 03:02 AM
[SOLVED] rpm build: syntax error near unexpected token `LUA,' mkarlsson Programming 16 03-04-2012 12:27 PM
./script.sh: line 2: syntax error near unexpected token `(' n00balert Programming 3 03-11-2010 04:22 PM
Unable to run script. Unexpected token. andremun Programming 2 09-15-2008 02:47 PM
Why am I getting an unexpected token error in this script? projektdotnet Programming 7 09-01-2007 03:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:10 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration