Skip to content

Commit

Permalink
ensure correct snap version dirtyness
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Jan 21, 2020
1 parent 8a560ec commit a6d55e3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a6d55e3

Please sign in to comment.