lmi
[Top][All Lists]
Advanced

[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: Mon, 9 Apr 2018 22:50:54 +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:
[...]
>  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 think I already had a valid high-level conceptual map, and just needed
to figure out the physical realization. It helped to put some temporary
printf statements into the script, revealing:

  wx_git_url =                    https://github.com/wxWidgets/wxWidgets.git
subpath 3rdparty/catch --> suburl https://github.com/wxWidgets/Catch.git
subpath src/expat      --> suburl https://github.com/wxWidgets/libexpat.git
subpath src/png        --> suburl https://github.com/wxWidgets/libpng.git
subpath src/zlib       --> suburl https://github.com/wxWidgets/zlib.git

So github hosts bare repositories of all the submodules as siblings of wx,
and wx's .gitmodules maps them to subdirectories. All I have to do is make
my own directory that looks like 'https://github.com/wxWidgets/*.git'.

Initial setup:

cd /srv/cache_for_lmi
mkdir vcs
cd vcs
git clone --mirror https://github.com/wxWidgets/wxWidgets.git
git clone --mirror https://github.com/wxWidgets/Catch.git
git clone --mirror https://github.com/wxWidgets/libexpat.git
git clone --mirror https://github.com/wxWidgets/libpng.git
git clone --mirror https://github.com/wxWidgets/zlib.git
for z in *.git; do pushd $z; git fsck --full --strict; popd ; done

All those fscks were perfectly clean.

Module names are hardcoded above for simplicity. Getting the names from
a working copy of wx is easy, and 'install_wx.sh' shows how, but that
presumes that an up-to-date working copy already exists. Alternatively,
the .gitmodules file could be gotten from a bare repository, e.g.:
  git show master:.gitmodules |less -S
and parsed. However, that doesn't seem worth the trouble because
submodules that lmi needs will rarely be added.

Subsequently, to keep everything updated, I'll do something like:
  for z in *.git; do pushd $z; git fetch; popd ; done
Because I used '--mirror', the 'fetch' refs are already set:

/srv/cache_for_lmi/vcs/wxWidgets.git[0]$grep fetch config
        fetch = +refs/*:refs/*

I'm not sure what git-fetch options to use, if any. I tried '--all':

  /srv/cache_for_lmi/vcs/wxWidgets.git[0]$git fetch --all
  Fetching origin
  remote: Counting objects: 26, done.
  remote: Compressing objects: 100% (18/18), done.
  remote: Total 26 (delta 20), reused 12 (delta 8), pack-reused 0
  Unpacking objects: 100% (26/26), done.
  From https://github.com/wxWidgets/wxWidgets
   + 807c963bd9...69fec9c26c refs/pull/280/merge -> refs/pull/280/merge  
(forced update)

"forced update"? Was '--all' too much? Let's fsck it:

  /srv/cache_for_lmi/vcs/wxWidgets.git[0]$git fsck --full --strict
  Checking object directories: 100% (256/256), done.
  Checking objects: 100% (788896/788896), done.
  Checking connectivity: 788896, done.
  dangling commit 807c963bd9c5e46b7c2da7bccbc1e2574418801a

A few minutes later, I tried 'git fetch' again, without '--all':

  /srv/cache_for_lmi/vcs/wxWidgets.git[0]$git fetch
  remote: Counting objects: 24, done.
  remote: Compressing objects: 100% (16/16), done.
  remote: Total 24 (delta 10), reused 11 (delta 8), pack-reused 0
  Unpacking objects: 100% (24/24), done.
  From https://github.com/wxWidgets/wxWidgets
   + 6d9db51dd3...84b60d54c7 refs/pull/739/merge -> refs/pull/739/merge  
(forced update)
   * [new ref]               refs/pull/780/head  -> refs/pull/780/head
   * [new ref]               refs/pull/780/merge -> refs/pull/780/merge

"forced update" apparently wasn't a consequence of using '--all'
previously, because it happened again without '--all'. Maybe that's
just the way it's supposed to work. Now, fsck says that last fetch
gave me one more "dangling commit":

  /srv/cache_for_lmi/vcs/wxWidgets.git[0]$git fsck --full --strict
  Checking object directories: 100% (256/256), done.
  Checking objects: 100% (788896/788896), done.
  Checking connectivity: 788915, done.
  dangling commit 6d9db51dd3f43f0e2eef1af0d2e38e58b4f7b608
  dangling commit 807c963bd9c5e46b7c2da7bccbc1e2574418801a

Maybe I should use '--prune'? Let's see:

  /srv/cache_for_lmi/vcs/wxWidgets.git[0]$git fetch --prune       
  /srv/cache_for_lmi/vcs/wxWidgets.git[0]$git fsck --full --strict
  Checking object directories: 100% (256/256), done.
  Checking objects: 100% (788896/788896), done.
  Checking connectivity: 788915, done.
  dangling commit 6d9db51dd3f43f0e2eef1af0d2e38e58b4f7b608
  dangling commit 807c963bd9c5e46b7c2da7bccbc1e2574418801a

Should I simply ignore any "dangling commit"? Should I run git-gc?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]