timestamp oddities

Andrew Benton b3nton at gmail.com
Sat May 1 17:21:23 PDT 2010


On 02/05/10 00:51, Ken Moffat wrote:
>   So, I tried touching the "marker" file a second ago:
> touch --date='1 second ago' filename
>
>   This helped, because even the files with truncated seconds now
> showed up as newer.
>
>   Unfortunately, both of these packages took next to no time to
> untar and install.  So, for the first package everything showed up
> in the log.  And for the second package, all its own files, plus some
> of the files from the *first* package showed up!
>
>   Solved this, at the cost of a slight delay in the overall script,
> by making sure that when I find the installed files, if the time
> spent running 'find' is less than a second, I sleep for a full second.
>

I do something similar, but less sophisticated. I simply put a sleep of 1
second between all packages to make sure that I don't get files from one
package showing up in the buildlog of the next. For what it's worth I build
packages with functions that look like this

function template()
{
echo $1
space_check
sleep 1s
(echo $1 > timestamp &&
rm -rf /tmp/$1 &&
tar xfC $1.tar.* /tmp &&
pushd /tmp/$1 &&
bash configure --prefix=/usr &&
make $THREADED &&
make install &&
popd &&
echo "Installed Files" &&
find /{usr,etc,lib,bin,sbin} -newer timestamp &&
rm -f timestamp &&
rm -rf /tmp/$1 ) &> /var/buildlogs/$1.txt &&
xz /var/buildlogs/$1.txt
}

space_check is another function to check if I'm running out of disk space and
THREADED=-j$(grep siblings /proc/cpuinfo|uniq|cut -d " " -f 2)
ie, make -j4 or whatever

Andy



More information about the lfs-chat mailing list