summaryrefslogtreecommitdiff
path: root/bin/db-update
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-10-30 11:13:08 +0100
committerErich Eckner <git@eckner.net>2017-10-30 11:13:08 +0100
commit4ebe9383773cb4712c44632b389cf0debf1a6088 (patch)
tree167343c5c2ef0c7c47dd654f9c4c95fbaf651f87 /bin/db-update
parentdc8b4dc460e699b65ef2d5aca9d3fe4a88431bd6 (diff)
downloadbuilder-4ebe9383773cb4712c44632b389cf0debf1a6088.tar.xz
bin/db-update: packages whose state is ignored may also be _newer_ than what should be moved (e.g. they do not need to be moved themself)
Diffstat (limited to 'bin/db-update')
-rwxr-xr-xbin/db-update22
1 files changed, 14 insertions, 8 deletions
diff --git a/bin/db-update b/bin/db-update
index ded97fe..9bd6024 100755
--- a/bin/db-update
+++ b/bin/db-update
@@ -32,11 +32,9 @@ usage() {
>&2 echo ' -h|--help: Show this help and exit.'
>&2 echo ' -n|--no-action: Only print what would be moved.'
>&2 echo ' -s|--stabilize $package:'
- >&2 echo ' Stabilize package $package, even if it'
- >&2 echo ' would not be stabilized otherwise.'
+ >&2 echo ' Assume, package $package can be stabilized.'
>&2 echo ' -u|--unstage $package:'
- >&2 echo ' Unstage package $package, even if it'
- >&2 echo ' would not be unstaged otherwise.'
+ >&2 echo ' Assume, package $package can be unstaged.'
[ -z "$1" ] && exit 1 || exit "$1"
}
@@ -388,16 +386,24 @@ trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT
for package in ${packages_to_force_stabilize}; do
# some sanity checks
- if [ ! -f "${work_dir}/package-states/${package}.testing" ]; then
- >&2 echo "Package '${package}' is not in testing!"
+ if [ ! -f "${work_dir}/package-states/${package}.tested" ] && \
+ [ ! -f "${work_dir}/package-states/${package}.testing" ] && \
+ [ ! -f "${work_dir}/package-states/${package}.done" ] && \
+ ! tr ' ' '.' < \
+ "${work_dir}/build-list" | \
+ grep -qxF "${package}"; then
+ >&2 printf 'Package "%s" is not in testing, staging or on the build list!\n' "${package}"
exit 2
fi
done
for package in ${packages_to_force_unstage}; do
# some sanity checks
- if [ ! -f "${work_dir}/package-states/${package}.done" ]; then
- >&2 echo "Package '${package}' is not in staging!"
+ if [ ! -f "${work_dir}/package-states/${package}.done" ] && \
+ ! tr ' ' '.' < \
+ "${work_dir}/build-list" | \
+ grep -qxF "${package}"; then
+ >&2 printf 'Package "%s" is not in staging or on the build list!\n' "${package}"
exit 2
fi
done