timestamp oddities

Aleksandar Kuktin akuktin at gmail.com
Sun May 2 06:25:10 PDT 2010


>On Sun, 02 May 2010 01:21:23 +0100
>Andrew Benton <b3nton at gmail.com> wrote:
>
> 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

You can also untar them with the '-m' flag. Like so:
tar -m -xf foo.tar

I used to do this, util I realised that there is a problem with this
aproach.

The problem is the build enviroment. As it usualy takes a few seconds
to untar a package, all the files, including Makefile and configure
precursors will have the same modification time. This will cause make
to force rebuilding of configure and Makefile which can have nasty
consequences.

Specificaly, when building BLFS I had at least one package fail to
build because aclocal failed to find some files it needed (I forgot the
details). I managed to make it work by touching build files
(Makefile.am, Makefile.in and others) in order, so make won't try to be
smart.

Unfortunately, I also forgot what was the exact order of touching. :(

-AKuktin



More information about the lfs-chat mailing list