aboutsummaryrefslogtreecommitdiff
path: root/scripts/git-submodule.sh
AgeCommit message (Collapse)Author
2020-02-13git: Make submodule check only needed modulesJuan Quintela
If one is compiling more than one tree from the same source, it is possible that they need different submodules. Change the check to see that all modules that we are interested in are updated, discarding the ones that we don't care about. Signed-off-by: Juan Quintela <quintela@redhat.com> --- v1->v2: patchw insists in not using modules
2018-10-16git-submodule.sh: Modern shell scripting (use $() instead of ``)Mao Zhongyi
Various shell files contain a mix between obsolete `` and modern $(); It would be nice to convert to using $() everywhere. Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2018-02-10build: fix typo in error messageLaurent Vivier
Signed-off-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Fixes: f62bbee55d503f639ee9498878ebf42ff4f4299a
2017-12-18build: fix typo in error messageMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2017-11-06build: delay check for empty git submodule listDaniel P. Berrange
We short circuit the git submodule update when passed an empty module list. This accidentally causes the 'status' command to write to the status file. The test needs to be delayed into the individual commands to avoid this premature writing of the status file. Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-11-06build: don't fail if given a git submodule which does not existDaniel P. Berrange
If going back in time in git history, across a commit that introduces a new submodule, the 'git-submodule.sh' script will fail, causing rebuild to fail. This is because config-host.mak contains a GIT_SUBMODULES variable that lists a submodule that only exists in the later commit. config-host.mak won't get repopulated until config.status is invoked, but make won't get this far due to the submodule error. This change makes 'git-submodule.sh' check whether each module is known to git and drops any which are not present. A warning message will be printed when any submodule is dropped in this manner. Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-11-06build: allow automatic git submodule updates to be disabledDaniel P. Berrange
Some people building QEMU use VPATH builds where the source directory is on a read-only volume. In such a case 'scripts/git-submodules.sh update' will always fail and users are required to run it manually themselves on their original writable source directory. While this is already supported, it is nice to give users a command line flag to configure to permanently disable automatic submodule updates, as it means they won't get hard to diagnose failures from git-submodules.sh at an arbitrary later date. This patch thus introduces a flag '--disable-git-update' which will prevent 'make' from ever running 'scripts/git-submodules.sh update'. It will still run the 'status' command to determine if a submodule update is needed, but when it does this it'll simply stop and print a message instructing the developer what todo. eg $ ./configure --target-list=x86_64-softmmu --disable-git-update ...snip... $ make GEN config-host.h GEN trace/generated-tcg-tracers.h GEN trace/generated-helpers-wrappers.h GEN trace/generated-helpers.h GEN trace/generated-helpers.c GEN module_block.h GIT submodule checkout is out of date. Please run scripts/git-submodule.sh update ui/keycodemapdb from the source directory checkout /home/berrange/src/virt/qemu make: *** [Makefile:31: git-submodule-update] Error 1 Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-11-06build: don't create temporary files in source dirDaniel P. Berrange
There are cases where users do VPATH builds with the source directory being on a read-only volume. In such a case they have to manually run the command 'git-submodule.sh ...modules...' ahead of time. When checking for status we should not then write into the source dir. Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-11-06build: allow setting a custom GIT binary for transparent proxyingDaniel P. Berrange
Some users can't run a bare 'git' command, due to need for a transparent proxying solution such as 'tsocks'. This adds an argument to configure to let users specify such a thing: ./configure --with-git="tsocks git" The submodule script is also updated to give the user a hint about using this flag, if we fail to checkout modules. Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-10-23scripts: don't throw away stderr when checking out git submodulesDaniel P. Berrange
The stderr from git is important if git fails to checkout modules due to network problems, or other unexpected errors. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20171020130748.22983-1-berrange@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2017-10-16build: automatically handle GIT submodule checkout for dtcDaniel P. Berrange
Currently if DTC is required by configure and not available in the host OS install, we exit with an error message telling the user to checkout a git submodule or install the library. This introduces automatic handling of the git submodule checkout process and enables it for dtc. This only runs if building from GIT, so users of release tarballs still need the system library install. The current state of the git checkout is stashed in .git-submodule-status, and a helper program is used to determine if this state matches the desired submodule state. A dependency against 'Makefile' ensures that the submodule state is refreshed at the start of the build process Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 20170929101201.21039-2-berrange@redhat.com [ kraxel: use /bin/sh not bash for scripts/git-submodule.sh ] [ kraxel: fix Makefile dependencies ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> [fixup] Makefile dep