[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] [PATCH] Add script allowing to install any wxWidgets version f
From: |
Greg Chicares |
Subject: |
Re: [lmi] [PATCH] Add script allowing to install any wxWidgets version from Git |
Date: |
Sat, 7 Apr 2018 09:35:02 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
On 2018-04-06 22:42, Vadim Zeitlin wrote:
> On Fri, 6 Apr 2018 13:31:31 +0000 Greg Chicares <address@hidden> wrote:
>
> [...]
> GC> > Should we do it like this?
> GC>
> GC> If I've understood this correctly, then yes, please.
>
> I think https://github.com/vadz/lmi/pull/80 should do it, at least it
> seems to work for me both when cloning from the GitHub wxWidgets repository
> and when cloning from a local mirror.
Let me ask a couple questions about 'skip_update'.
(1) It occurs only on these three lines:
$grep skip_update install_wx.sh
skip_update=1
[ -n "$skip_update" ] || git checkout "$wx_commit_sha"
if [ "$skip_update" != 1 ]
so it can only be either null or 1, but the tests differ. Can I replace the
last line as follows, just for uniformity, or am I missing some nuance?
-if [ "$skip_update" != 1 ]
+if [ -n "$skip_update" ]
Oh, wait: '-n" doesn't test whether it's null: it tests whether it's nonnull.
So '-z' would be the appropriate alternative there. But because I obviously
can't make sense of '-n' without extreme effort, let me ask instead whether
the middle line could be replaced thus:
- [ -n "$skip_update" ] || git checkout "$wx_commit_sha"
+ [ "$skip_update" = 1 ] || git checkout "$wx_commit_sha"
(2) Wouldn't the following be a pure refactoring (and simpler)?
if [ $(git rev-parse HEAD) = "$wx_commit_sha" ]
then
+ git checkout "$wx_commit_sha"
# Don't bother updating anything if we already had the correct version
# of the tree.
skip_update=1
else
# Get the missing commit from the upstream repository if we don't have
# it yet.
if ! git rev-parse --quiet --verify "$wx_commit_sha^{commit}" >/dev/null
then
git fetch "$wx_git_url"
fi
[or move the '+' line here if I still don't understand 'test -n']
fi
- [ -n "$skip_update" ] || git checkout "$wx_commit_sha"
> Please note that if you use a local mirror in some/where/wxWidgets, you
> need to set up the submodule mirrors under some/where directory and use
> the last component of their URLs, _not_ paths, as the repositories names
> (which is confusing because they're similar, or even identical, for zlib,
> but not the same). I.e. you need to have Catch.git, libexpat.lib,
> libpng.git and zlib.git (and not "catch", "expat", "png" and "zlib"). Also
> note that while they can (and arguably should) be bare repositories, you
> can also just use symlinks to the existing subdirectories of your wxWidgets
> working tree, e.g. I just did
>
> $ cd some/where
> $ ln -s wxWidgets/3rdparty/catch Catch.git
> $ ln -s wxWidgets/src/expat libexpat.git
> $ ln -s wxWidgets/src/png libpng.git
> $ ln -s wxWidgets/src/zlib zlib.git
>
> here. And, of course, if you want to make the "real" bare repositories, you
> can clone from these existing directories too, in order to avoid
> re-downloading everything from GitHub.
I feel certain that I want a local mirror, and I imagine I want it to
contain "real" bare repositories.
Let's take libpng as an example.
- Do I mirror "git://git.code.sf.net/p/libpng/code"? Or does wx git
contain its own libpng git repository that I can mirror instead?
And if so, would you please tell me the command to do that?
[Unless you already did tell me--see my confusion below.]
- If I can mirror a bare libpng repository from wx, then does that
avoid the
https://github.com/wxWidgets/wxWidgets/blob/master/docs/contributing/how-to-update-third-party-library.md
"We use a special hack for libpng"
issues, or do I have to implement that special hack myself?
I ran './install_wx.sh' before PR #80, which executed this line:
git clone "$wx_git_url" ${wx_dir##*/}
and I ran
wx_skip_clean=1 ./install_wx.sh
after applying PR #80. Now the clone is up to date:
/opt/lmi/third_party/src/wxWidgets[0]$git rev-parse HEAD
41045df7ea5f93e4c07c1bd846d7127a372705bd
and, if I understand the 'skip_update' logic correctly, there's
nothing more that the script should do--the new PR #80 section
is skipped. If that's right, then I should have all the submodules
I need. But I seem to have none, because there's no '.gitmodules':
/opt/lmi/third_party/src/wxWidgets[0]$ls -a .git/
. .. HEAD branches config description hooks index info logs objects
packed-refs refs
And I had hoped that maybe wxWidgets/src/png would contain its
own '.git' subdirectory, but it doesn't. Is this merely because
41045df7ea didn't yet use submodules?
- [lmi] [PATCH] Add script allowing to install any wxWidgets version from Git, Vadim Zeitlin, 2018/04/01
- Re: [lmi] [PATCH] Add script allowing to install any wxWidgets version from Git, Greg Chicares, 2018/04/05
- Re: [lmi] [PATCH] Add script allowing to install any wxWidgets version from Git, Vadim Zeitlin, 2018/04/05
- Re: [lmi] [PATCH] Add script allowing to install any wxWidgets version from Git, Greg Chicares, 2018/04/05
- Re: [lmi] [PATCH] Add script allowing to install any wxWidgets version from Git, Vadim Zeitlin, 2018/04/05
- Re: [lmi] [PATCH] Add script allowing to install any wxWidgets version from Git, Greg Chicares, 2018/04/06
- Re: [lmi] [PATCH] Add script allowing to install any wxWidgets version from Git, Vadim Zeitlin, 2018/04/06
- Re: [lmi] [PATCH] Add script allowing to install any wxWidgets version from Git, Vadim Zeitlin, 2018/04/06
- Re: [lmi] [PATCH] Add script allowing to install any wxWidgets version from Git,
Greg Chicares <=
- Re: [lmi] [PATCH] Add script allowing to install any wxWidgets version from Git, Vadim Zeitlin, 2018/04/07
- [lmi] I will never understand 'test -n' [Was: Add script allowing to install any wxWidgets version from Git], Greg Chicares, 2018/04/07
- Re: [lmi] [PATCH] Add script allowing to install any wxWidgets version from Git, Greg Chicares, 2018/04/07
- Re: [lmi] [PATCH] Add script allowing to install any wxWidgets version from Git, Greg Chicares, 2018/04/08
- Re: [lmi] [PATCH] Add script allowing to install any wxWidgets version from Git, Greg Chicares, 2018/04/08
- Re: [lmi] [PATCH] Add script allowing to install any wxWidgets version from Git, Vadim Zeitlin, 2018/04/08
- Re: [lmi] [PATCH] Add script allowing to install any wxWidgets version from Git, Greg Chicares, 2018/04/08
- Re: [lmi] [PATCH] Add script allowing to install any wxWidgets version from Git, Greg Chicares, 2018/04/09
- Re: [lmi] [PATCH] Add script allowing to install any wxWidgets version from Git, Vadim Zeitlin, 2018/04/09
- Re: [lmi] [PATCH] Add script allowing to install any wxWidgets version from Git, Greg Chicares, 2018/04/09