[RndTbl] up2date and yum updates for CORE 2

Gilbert E. Detillieux gedetil at cs.umanitoba.ca
Thu Jun 10 11:11:35 CDT 2004

According to Mel Seder:
> I went to our site http://www.muug.mb.ca/fedora-updates.html and read it and
> then downloaded the two patch files.  I read about the patch command in
> "Running Linux" published by O'Reilly as well as running and reading "info
> patch".
> As I recall,  for CORE 1 I just went in and edited sources (maybe yum.conf
> also) by hand because I didn't realize that what the gobbly gook in the patch
> file did or that I even needed the patch command.
> I generated a patch file to update a phone list text file just to see how patch
> worked and it worked how I expected.  I did not understand everything in
> "Running Linux" or "info patch" but the following is what I think I should do.
> both patch files are in ~
> I issue "su" from ~ for root access
> #patch < rhn-sources-fc2.patch
> #patch < yum.conf-fc2.patch
> Am I missing something or should the above work?

I would do the following:

	cp -p /etc/sysconfig/rhn/sources /etc/sysconfig/rhn/sources.FC2
	cp -p /etc/yum.conf /etc/yum.conf.FC2
	patch -p0 < rhn-sources-fc2.patch
	patch -p0 < yum.conf-fc2.patch

The first two commands will just make backup copies of the config files
before you patch them.  (I've gotten into the habit of saving a copy of each
original configuration file before modifying it for the first time.  That
way, I can always go back to the original, or use "diff" to find out what
has changed.)

There is a patch option to save a backup of the file before patching it, but
I can never remember what the option is, and it seems to behave slightly
differently depending on what version of patch you have.  So, I find it
simpler to just make my own copies first (which I do out of habit already).

Also, on some versions of patch, the backup copy is made without preserving
the modification time stamp.  I'm anal about these things, and I like my
backups to have an accurate time stamp, which is why I always use "cp -p".

> What I think I will do,  just cause I'm chicken, is run the following before
> the actual/live patches;
> #patch --dry-run < rhn-sources-fc2.patch > sources.dryrun
> #patch --dry-run < yum.conf.fc2.patch > yum.dryrun

Sure, that would be a safe way to try things out first, but of course, if
you've made your backup copies, then you can be a bit more brave!  :)

I wasn't even aware of the --dry-run option.  It appears to be in GNU patch
(even older versions), but wasn't in the original patch command written by
Larry Wall (better known as the author of perl), nor is it in the Solaris
patch command.

> I'm mostly concerned about the patch commands.  Should they work or are other
> parameters needed?

Not sure about the patch command that comes with FC2, but in some earlier
versions, you had to specify at least some options in order to use it in
non-interactive mode.  Otherwise, it would insist on prompting you for file
names, etc.  So, the "patch -p0 < patch_file" command is something I also
now do out of habit.  (Strictly speaking, -p0 should happen by default, i.e.
it tells patch not to strip any directory prefixes from the pathnames in the
patch file, in order to find the correct files to patch.  But in some
versions, that option also told it to pull the file names from the patch
file, rather than asking for them.)

Gilbert E. Detillieux		E-mail:	<gedetil at cs.umanitoba.ca>
Dept. of Computer Science	Web:	http://www.cs.umanitoba.ca/~gedetil/
University of Manitoba		Phone:	(204)474-8161
Winnipeg, MB, CANADA  R3T 2N2	Fax:	(204)474-7609

More information about the Roundtable mailing list