From a6d55e3252a3d437d25c0caa3ab45199c19bfcf5 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Tue, 21 Jan 2020 22:35:24 +0000 Subject: [PATCH] ensure correct snap version dirtyness --- snap/snapcraft.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index a89a1abb8..d1671d5a1 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -28,11 +28,12 @@ parts: override-pull: | snapcraftctl pull snapcraftctl set-version `cd $SNAPCRAFT_PART_SRC && git describe --tags` + git diff --quiet || error_dirty_build echo 'PKG = "snap"' > $SNAPCRAFT_PART_SRC/dvc/utils/build.py # install all optional extras sed -ri 's/(=install_requires)/\1+all_remotes+hdfs/' $SNAPCRAFT_PART_SRC/setup.py - sed -rn 's/^(_BASE_VERSION = .*)$/__version__ = \1/p' $SNAPCRAFT_PART_SRC/dvc/version.py > $SNAPCRAFT_PART_SRC/dvc/version.py.new - mv $SNAPCRAFT_PART_SRC/dvc/version.py.new $SNAPCRAFT_PART_SRC/dvc/version.py + # ensure dvc knows the state isn't really dirty + sed -rin 's/.*git.*diff.*--quiet.*//' $SNAPCRAFT_PART_SRC/dvc/version.py override-build: | snapcraftctl build cp $SNAPCRAFT_PART_BUILD/scripts/completion/dvc.bash $SNAPCRAFT_PART_INSTALL/completion.sh