Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Makefile: rework repo creation target #58

Merged
merged 2 commits into from

2 participants

@drafnel

The current repo target may produce some error messages and creates a tmprepo.XX... directory each time make is called. This series reworks the repo creation target so that it doesn't produce those errors, and also installs the git repository a little more efficiently.

-Brandon

drafnel added some commits
@drafnel drafnel Makefile: improve repo creation target, avoid := notation
The := notation is problematic here since it causes the statements on the
right hand side to be dereferenced immediately even if the repo or .git
target was not specified.  When the source is checked out from a git clone,
the .gitrev file does not exist, but the '$(shell cat .gitrev)' sequence is
executed every time make is called and it produces an error message.  Also,
the '$(shell mktemp -d tmprepo.XXXXXX)' sequence is  executed every time
make is called, which creates a new unique tmprepo.XXXXXX directory each
time.

So, let's rework this target so that the := notation is avoided, and also
to make it a little more efficient by avoiding an unnecessary checkout of
the repository.

There are two functional changes: 1) the temporary directory will just be
called ".repo_tmp" and it will be overwritten each time 'make repo' is
called, and 2) the checked out branch will keep its default name rather
than adopting a new name 'working'.  The user can create a new branch if
they desire and the original remote branch state is already available in
origin/master.
cc20297
@drafnel drafnel Makefile: checkout all missing files for repo target
Rather than try to maintain a list of the file differences between the
git repository and the source distribution tarball, just get a listing from
git itself and use it to check out the missing files.
ff66808
@robertwb robertwb merged commit 34a1c3a into cython:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 24, 2011
  1. @drafnel

    Makefile: improve repo creation target, avoid := notation

    drafnel authored
    The := notation is problematic here since it causes the statements on the
    right hand side to be dereferenced immediately even if the repo or .git
    target was not specified.  When the source is checked out from a git clone,
    the .gitrev file does not exist, but the '$(shell cat .gitrev)' sequence is
    executed every time make is called and it produces an error message.  Also,
    the '$(shell mktemp -d tmprepo.XXXXXX)' sequence is  executed every time
    make is called, which creates a new unique tmprepo.XXXXXX directory each
    time.
    
    So, let's rework this target so that the := notation is avoided, and also
    to make it a little more efficient by avoiding an unnecessary checkout of
    the repository.
    
    There are two functional changes: 1) the temporary directory will just be
    called ".repo_tmp" and it will be overwritten each time 'make repo' is
    called, and 2) the checked out branch will keep its default name rather
    than adopting a new name 'working'.  The user can create a new branch if
    they desire and the original remote branch state is already available in
    origin/master.
  2. @drafnel

    Makefile: checkout all missing files for repo target

    drafnel authored
    Rather than try to maintain a list of the file differences between the
    git repository and the source distribution tarball, just get a listing from
    git itself and use it to check out the missing files.
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 8 deletions.
  1. +5 −8 Makefile
View
13 Makefile
@@ -6,17 +6,14 @@ all: local
local:
${PYTHON} setup.py build_ext --inplace
-.git: REV := $(shell cat .gitrev)
-.git: TMPDIR := $(shell mktemp -d tmprepo.XXXXXX)
-.git:
+TMPDIR = .repo_tmp
+.git: .gitrev
rm -rf $(TMPDIR)
- git clone $(REPO) $(TMPDIR)
- cd $(TMPDIR); git checkout -b working $(REV)
- mv $(TMPDIR)/.hgtags .
- mv $(TMPDIR)/.hgignore .
+ git clone -n $(REPO) $(TMPDIR)
+ cd $(TMPDIR) && git reset -q "$(shell cat .gitrev)"
mv $(TMPDIR)/.git .
- mv $(TMPDIR)/Doc/s5 Doc/s5
rm -rf $(TMPDIR)
+ git ls-files -d | xargs git checkout --
repo: .git
Something went wrong with that request. Please try again.