[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: No more kernel-source(code) ??? (was: rawhide report: 20040623 changes)



On Jun 23, 2004, Jeremy Katz <katzj redhat com> wrote:

> The run of hardlink could actually be sped up if it were modified to
> only do the md5 checks if the file's basename is the same.

Here's something that's probably even better, if it works.  rpm
already has the md5sums, I'm just not sure querying the database
during %post will already have the info we want.  Does anyone?

Oh, it also assumes that there are no blanks in pathnames within the
kernel, and that /^010....$/  is the correct regular expression to
match regular files.  It works on x86, but I haven't checked other
arches.

rpm -q --dump kernel |
awk '$5 ~ /^010....$/ { mdsums[$4] = mdsums[$4] " " $1; }
     END { for (x in mdsums) print "hardlink" mdsums[x]; }' |
sh

Sure you could just system() hardlink, instead of piping the output to
a shell, but I wrote it this way such that you could tell what it was
going to do before actually running the command.

-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva {redhat com, gcc.gnu.org}
Free Software Evangelist  oliva {lsd ic unicamp br, gnu.org}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]