Re: [PATCH] bfd/version.h: Add rationale for BFD_VERSION_DATE (Re: meaning of "Automatic date update in version.in" commits)

Joel Brobecker <[email protected]>
Newsgroups gmane.comp.gnu.binutils,gmane.comp.gdb.devel
Message-ID <[email protected]>
> > I assume that the bot is just replacing the line with
> > BFD_VERSION_DATE instead of regenerating the whole file from
> > scratch, but that's just guessing.  (I don't have sourceware
> > shell access; I have no idea how the auto updater is implemented.)
> 
> Back when I ran the cron job on my home machine, it did
> sed -e 's/20[0-9]*/'`date +%Y%m%d`/ < bfd/version.h > bfd/version.h.new
> 
> I'm not sure what is done nowadays.  You could always commit the patch
> and see what happens.  :)

It should work no problem, as long as there is no date in the comment.
The script that we run nightly on sourceware.org (update-git-version)
does pretty much the same as what you were doing:

    sed \
        -e 's/[Y0-9][Y0-9][Y0-9][Y0-9]-[M0-9][M0-9]-[D0-9][D0-9]/'$date'/' \
        -e 's/[Y0-9][Y0-9][Y0-9][Y0-9][M0-9][M0-9][D0-9][D0-9]/'$DATE'/' \
        < ${file} > ${file}.new

-- 
Joel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.