openwrt/scripts
John Crispin 590b855c26 scripts/feeds: handle missing/broken feeds better
pts/feeds update -a" can fail rather silently for feeds using git, as
the script does not pause when updating a feed fails. Instead it prints the
error message and calmly continues to the next feed. It is very easy to
overlook update errors with the feeds updated first, as their text scrolls
rapidly away from the screen.

This behaviour has not been a big problem with svn feeds, as svn update stops
with a conflict message and interactively forces the user to resolve or
postpone the conflict. In any case the svn error is noticed by the user.

Majority of the feeds use now git, so this silent failure can affect users
doing private builds in an increasing amount.

Below is an example of update failing and script continuing:

perus@v1404:/Openwrt/barrier$ ./scripts/feeds update -a
Updating feed 'packages' from
'https://github.com/openwrt/packages.git;for-14.07' ...
remote: Counting objects: 17, done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 17 (delta 10), reused 8 (delta 1)
Unpacking objects: 100% (17/17), done.
 From https://github.com/openwrt/packages
62031da..dc26009  for-14.07  -> origin/for-14.07
Updating 62031da..dc26009
error: Your local changes to the following files would be overwritten by merge:
utils/collectd/Makefile
Please, commit your changes or stash them before you can merge.
Aborting
failed.
Updating feed 'luci' from 'http://git.openwrt.org/project/luci.git;luci-0.12' ...
Already up-to-date.
Create index file './feeds/luci.index'
Updating feed 'routing' from
'https://github.com/openwrt-routing/packages.git;for-14.07' ...
...

The script prints "failed.", but does not break the updating process. The
"update_feed" function returns an error code 1, but that value is not checked
in the "update" function, which continues to the next feed.
Return 1 as error:
​https://dev.openwrt.org/browser/trunk/scripts/feeds#L547
Call to update_feed without any error monitoring:
​https://dev.openwrt.org/browser/trunk/scripts/feeds#L585

The included patch makes the feeds script to stop updating after failing to
update a feed.

The script continues to the refresh_config step despite a possible failure in
updating, so the stopping action just prevents the other feeds from updating
and makes the error more clearly visible.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>

SVN-Revision: 42891
2014-10-13 19:41:27 +00:00
..
config scripts/config: make wildcard include with no results non-fatal 2014-03-10 18:58:40 +00:00
flashing
arm-magic.sh
brcmImage.pl
bundle-libraries.sh scripts/bundle-libraries: fall back to only copying binaries if ldd is unavailable (e.g. non-linux system) 2014-06-02 13:27:23 +00:00
checkpatch.pl
clang-gcc-wrapper
clean-package.sh
cleanfile
cleanpatch
combined-ext-image.sh
combined-image.sh
config.guess
config.rpath
config.sub
deptest.sh
diffconfig.sh
dl_cleanup.py
download.pl include/download.mk: Add download mirrors for tools from GNU Savannah (bug #15184) 2014-10-08 08:01:39 +00:00
env scripts: unset GREP_OPTIONS in env and feeds (fixes #16924) 2014-06-30 06:50:22 +00:00
ext-toolchain.sh
feeds scripts/feeds: handle missing/broken feeds better 2014-10-13 19:41:27 +00:00
freebsd.sh
gen-dependencies.sh
getver.sh
ipkg
ipkg-make-index.sh
kconfig.pl scripts/kconfig.pl: Indicate which file we couldn't open 2014-01-19 17:27:04 +00:00
make-ipkg-dir.sh
md5sum
metadata.pl build: add support for declaring package CONFLICTS which only affect selecting built-in packages 2014-10-05 16:41:33 +00:00
metadata.pm build: add support for declaring package CONFLICTS which only affect selecting built-in packages 2014-10-05 16:41:33 +00:00
mkits.sh
om-fwupgradecfg-gen.sh scripts/om-fwupgradecfg-gen.sh: add support for the OM5P 2014-07-20 17:30:48 +00:00
openbsd.sh
pad_image
patch-kernel.sh
patch-specs.sh
relink-lib.sh
remote-gdb script/remote-gdb: enable and keep command history 2014-09-18 09:29:44 +00:00
rstrip.sh
slugimage.pl
strip-kmod.sh
symlink-tree.sh
timestamp.pl
ubinize-image.sh scripts/ubinize-image.sh: fix ubinize-image.sh when used with --kernel 2014-06-29 06:59:29 +00:00
update-package-md5sum