mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
Handle failures correctly so that CI for example will terminate. Add -i option to update index only and not heads. Take two of this which allows silent failures when updating the feeds. This is not good but it is necessary as a workaround for the issue with private feeds. This should be solved in a different way. Reproducibility of builds in case of network outages for example cannot be guaranteed as long as silent failure is allowed.
72 lines
1.7 KiB
Bash
Executable file
72 lines
1.7 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
function feeds_update {
|
|
heads=1
|
|
developer=0
|
|
override=1
|
|
while getopts "inh" opt; do
|
|
case $opt in
|
|
i)
|
|
heads=0
|
|
;;
|
|
n)
|
|
override=0
|
|
;;
|
|
h|\?)
|
|
echo "Usage: ./iop feeds_update [-i] [-n] [-h]"
|
|
echo
|
|
echo "OPTIONS:"
|
|
echo " -i - Only update index. Do not change HEAD in feeds."
|
|
echo " -n - Do not replace core packages with iopsys versions."
|
|
echo " -h - Display this help message and exit."
|
|
exit 1
|
|
;;
|
|
esac
|
|
done
|
|
|
|
git remote -v | grep -qE '(git@|ssh://)' && developer=1
|
|
|
|
cp .config .genconfig_config_bak
|
|
|
|
if [ $heads == 1 ]; then
|
|
if [ $developer == 1 ]; then
|
|
./scripts/feeds update -g
|
|
else
|
|
./scripts/feeds update
|
|
fi
|
|
fi
|
|
./scripts/feeds update -ai || exit 1
|
|
|
|
# replace core packages with iopsys versions
|
|
if [ $override == 1 ]; then
|
|
./scripts/feeds install -f -p openwrt_core -a || exit 1
|
|
fi
|
|
|
|
(
|
|
echo '# DO NOT EDIT. Autogenerated file by ./iop feeds_update'
|
|
echo 'FEED_DEVICES_DIRS:='
|
|
find feeds -type f -name .is-feed-devices-dir -printf 'FEED_DEVICES_DIRS+=$(TOPDIR)/%h'
|
|
) > target/linux/feed-devices/feed-devices-list.mk || exit 1
|
|
|
|
# targets need to be installed explicitly
|
|
for target in $(ls ./feeds/targets); do
|
|
./scripts/feeds install -f -p targets $target || exit 1
|
|
done
|
|
|
|
# install all packages
|
|
./scripts/feeds install -a || exit 1
|
|
|
|
# remove broken symlinks ( for packages that are no longer in the feed )
|
|
find -L package/feeds -maxdepth 2 -type l -delete || exit 1
|
|
|
|
cp .genconfig_config_bak .config
|
|
make defconfig || exit 1
|
|
|
|
# record when we last run this script
|
|
touch tmp/.iop_bootstrap || exit 1
|
|
|
|
# always return true
|
|
exit 0
|
|
}
|
|
|
|
register_command "feeds_update" "Update feeds to point to commit hashes from feeds.conf"
|