fixes and error messages

This commit is contained in:
Ryan Mulligan 2018-03-17 22:04:34 -07:00
parent 5426a2bc22
commit fb9fc54a76
2 changed files with 7 additions and 3 deletions

6
up.sh
View File

@ -50,7 +50,7 @@ git checkout master
git reset --hard upstream/master
# This is extremely slow but will give us better results
ATTR_PATH=$(nix-env -qa "$PACKAGE_NAME-$OLD_VERSION" -f . --attr-path | head -n1 | cut -d' ' -f1)
ATTR_PATH=$(nix-env -qa "$PACKAGE_NAME-$OLD_VERSION" -f . --attr-path | head -n1 | cut -d' ' -f1) || error_exit "nix-env -q failed to find package name with old version"
DERIVATION_FILE=$(EDITOR="echo" nix edit "$ATTR_PATH" -f .) || error_exit "Couldn't find derivation file."
@ -121,7 +121,7 @@ CHECK_RESULT="$("$SCRIPT_DIR"/check-result.sh "$RESULT" "$NEW_VERSION")"
MAINTAINERS=
if nix eval "(let pkgs = import ./. {}; in pkgs.$ATTR_PATH.meta.maintainers)" > /dev/null 2>&1
then
maintainers=$(nix eval --raw '(let pkgs = import ./. {}; gh = m : m.github or ""; nonempty = s: s != ""; addat = s: "@"+s; in builtins.concatStringsSep " " (map addat (builtins.filter nonempty (map gh pkgs.'"${PACKAGE_NAME}"'.meta.maintainers))))')
maintainers=$(nix eval --raw '(let pkgs = import ./. {}; gh = m : m.github or ""; nonempty = s: s != ""; addat = s: "@"+s; in builtins.concatStringsSep " " (map addat (builtins.filter nonempty (map gh pkgs.'"${ATTR_PATH}"'.meta.maintainers))))')
if [ -n "$maintainers" ]
then
MAINTAINERS="
@ -158,7 +158,7 @@ if [[ -v DRY_RUN ]]
then
true
else
GITHUB_TOKEN="$(cat "$SCRIPT_DIR"/github_token.txt)" hub pull-request -m "$PR_MESSAGE"
hub pull-request -m "$PR_MESSAGE"
fi
git reset --hard

4
ups.sh
View File

@ -7,6 +7,9 @@ touch $LOG_FILE
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
GITHUB_TOKEN="$(cat "$SCRIPT_DIR"/github_token.txt)"
export GITHUB_TOKEN
ARGUMENTS=""
NIXPKGS=$HOME/.cache/nixpkgs
@ -23,6 +26,7 @@ fi
cd "$NIXPKGS"
export DRY_RUN=true
echo "
$(date -Iseconds) New run of ups.sh" >> $LOG_FILE