LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 06-27-2012, 09:30 AM   #46
solarfields
Member
 
Registered: Feb 2006
Location: Outer Shpongolia
Distribution: Slackware
Posts: 470

Rep: Reputation: 118Reputation: 118

don't worry mate...

as long as they do not make you more happy than a girl
 
Old 06-29-2012, 02:41 AM   #47
sanjioh
Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 48

Rep: Reputation: Disabled
Quote:
Originally Posted by audriusk View Post
Just finished rebuilding additional packages depending on Python, everything went great. Thanks to Pat and the crew for this nice batch of updates!

I have one question though: mercurial's doinst.sh.gz contains the following two lines:
Code:
config etc/mercurial/hgrc.d/hgk.rc.new                                           
rm -f etc/mercurial/hgrc.d/hgk.rc.new
Can someone enlighten me about the reason behind the last line? Is this intentional or simply a leftover from some tinkering with the code?
Hi,
any news on this subject? What do you people think?
 
Old 06-29-2012, 02:29 PM   #48
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 867

Rep: Reputation: 1747Reputation: 1747Reputation: 1747Reputation: 1747Reputation: 1747Reputation: 1747Reputation: 1747Reputation: 1747Reputation: 1747Reputation: 1747Reputation: 1747
Hi, the config() handling of hgk.rc.new is there to let people comment out an optional feature without every package upgrade to mercurial enabling it again.
 
Old 06-29-2012, 03:17 PM   #49
GazL
Senior Member
 
Registered: May 2008
Posts: 3,392

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
I don't think it's the config() handling that is at question here Pat. It's the rm outside of it.
Code:
config() {
  NEW="$1"
  OLD="`dirname $NEW`/`basename $NEW .new`"
  # If there's no config file by that name, mv it over:
  if [ ! -r $OLD ]; then
    mv $NEW $OLD
  elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
    rm $NEW
  fi
  # Otherwise, we leave the .new copy for the admin to consider...
}
config etc/mercurial/hgrc.d/hgk.rc.new
rm -f etc/mercurial/hgrc.d/hgk.rc.new
- If old doesn't exist move new to old
- else if new and old are the same remove new
- else leave it for the admin to sort out
- but then it gets deleted anyway outside of config(), so the admin will never get to see it.
 
Old 06-29-2012, 06:13 PM   #50
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 867

Rep: Reputation: 1747Reputation: 1747Reputation: 1747Reputation: 1747Reputation: 1747Reputation: 1747Reputation: 1747Reputation: 1747Reputation: 1747Reputation: 1747Reputation: 1747
That comment in config() is just part of the boilerplate... in this case the file is not expected to change.
 
Old 06-30-2012, 05:05 AM   #51
sanjioh
Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 48

Rep: Reputation: Disabled
Thanks for your answers, Patrick. But what is still not clear to me is the last statement of the script:
Quote:
rm -f etc/mercurial/hgrc.d/hgk.rc.new
Why remove the .new file if we want to let the admin choose how to deal with it?
Thanks again!
 
Old 06-30-2012, 05:20 AM   #52
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 755

Rep: Reputation: 226Reputation: 226Reputation: 226
I think what he means here is that the config() function is a generic function that he uses for everything but in this case the .rc file should never change so you don't need to even look at it.

And of course keeping with the same old system of .rc.new means that if it does in fact change in the future he can always remove that rm line and let the admin deal with it.

Also note that the check he uses to see if the file is the same requires the file to be exactly the same, even an extra blank line will cause that test to fail.
 
Old 06-30-2012, 05:26 AM   #53
sanjioh
Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 48

Rep: Reputation: Disabled
Oh, ok now it does definetly make sense to me thanks for the clarification!
 
Old 07-01-2012, 08:15 AM   #54
audriusk
Member
 
Registered: Mar 2011
Location: Klaipėda, Lithuania
Distribution: Slackware
Posts: 248

Rep: Reputation: 107Reputation: 107
Ah, so this last line is for disabling the config() code instead of removing it completely, so that in the future it could be re-enabled quickly if needed.

Thanks Pat for answering and wildwizard for detailed explanation!
 
  


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
LXer: Massive updates in slackware-current LXer Syndicated Linux News 0 03-12-2009 03:31 AM
After massive updates new BE is unbootable hscast Solaris / OpenSolaris 5 11-21-2008 05:54 PM
Slackware current updates today! neo Slackware 2 04-22-2005 05:32 PM
VMWare on Slackware Current: massive display corruption senorsnor Slackware 4 02-24-2005 12:30 PM
Why haven't there been any updates to slackware current lately? moger Slackware 18 07-21-2004 10:21 AM


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