develooper Front page | perl.perl5.porters | Postings from January 2009

Re: Minimal Perl git repostory

Thread Previous | Thread Next
From:
demerphq
Date:
January 7, 2009 11:18
Subject:
Re: Minimal Perl git repostory
Message ID:
9b18b3110901071118h5b534222yffd37af42687ebe6@mail.gmail.com
2009/1/7 Jerry D. Hedden <jdhedden@cpan.org>:
> Building Perl inside a git repository is necessary so that
> the git commands in make_patchnum.pl (and elsewhere) will
> work.

Not true. Its totally possible to build perl without git at all.

You didnt really think I made it necessary to have git around to build did you?

Its just the assumption was that nobody would build without git and
without going to the APC or by getting a preapproved distribution. It
never occured to me that someone would go through the contortions you
seem to be, and especially not so soon after the switchover. (Meaning
I am unprepared for this, but i was planning to have some stuff added
to the repo to deal with this requirement)

Anyway, have you tried rsyncing from the APC? Notice anything
different about it?

:-)

> After building, I tar up the build directory (complete with
> all the object files, etc.) so that I can untar and use it
> again at a later date if needed.
>
> Currently, the Perl git repository uses about 172MB of disk
> space.  If I make a shared clone of the respository, it only
> uses about 74MB.  However, the shared clone is dependent on
> the original respository so that if I tar up my build and
> then untar it later, any git commands issued in it may not
> work.
>
> So, what I need is a way to get a minimal copy of the
> respository set to a particular commit ID that will still
> function for various git commands used as part of the build
> process, yet is independent of the original repository.  The
> copied respository can be read-only in that I won't be using
> it to commit any changes, create any branches and so on.
>
> Is the above possible?

No. But thats ok because its not necessary.

Assuming you have perl already installed:

git pull # whatever, update git.
perl make_patchnum.pl
git archive --format=zip HEAD > $zips/perl.zip
zip $zips/perl.zip lib/Config_git.pl git_version.h

and $zips/perl.zip will contain a minimal archive that is buildable
with full details. If for some reason git_version.h is overwritten by
stock_git_version.h you can touch them before running make to ensure
they are more recent than perl.c. This is done using the zip format
becuase its easy to add files to it, I tried something similar with
tar -A and it didnt work. YMMV.

Alternatively you can replicate the logic used to create the .patch
files on the APC:

chomp(my $describe= `git describe --tags`);
my ($branch)= map { /^\* (.*)/ } `git branch`;
my ($date)= strftime "%Y-%m-%d.%H:%M:%S", gmtime(time);
chomp(my $sha1= `git rev-parse HEAD`);
print join(" ", $branch, $tstamp, $local, $describe);

and take a similar approach to adding the file to an archive generated
by git archive.

Anyway, we should turn this mail into a recipe in Porting.

cheers,
Yves




-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About