meson_get_version.py revision 7ec681f3
17ec681f3Smrg#!/usr/bin/env python3 201e04c3fSmrg# encoding=utf-8 301e04c3fSmrg# Copyright © 2017 Intel Corporation 401e04c3fSmrg 501e04c3fSmrg# Permission is hereby granted, free of charge, to any person obtaining a copy 601e04c3fSmrg# of this software and associated documentation files (the "Software"), to deal 701e04c3fSmrg# in the Software without restriction, including without limitation the rights 801e04c3fSmrg# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 901e04c3fSmrg# copies of the Software, and to permit persons to whom the Software is 1001e04c3fSmrg# furnished to do so, subject to the following conditions: 1101e04c3fSmrg 1201e04c3fSmrg# The above copyright notice and this permission notice shall be included in 1301e04c3fSmrg# all copies or substantial portions of the Software. 1401e04c3fSmrg 1501e04c3fSmrg# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1601e04c3fSmrg# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1701e04c3fSmrg# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 1801e04c3fSmrg# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 1901e04c3fSmrg# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 2001e04c3fSmrg# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 2101e04c3fSmrg# SOFTWARE. 2201e04c3fSmrg 2301e04c3fSmrgimport os 2401e04c3fSmrg 2501e04c3fSmrg 2601e04c3fSmrgdef main(): 2701e04c3fSmrg filename = os.path.join(os.environ['MESON_SOURCE_ROOT'], 'VERSION') 2801e04c3fSmrg with open(filename) as f: 2901e04c3fSmrg version = f.read().strip() 3001e04c3fSmrg print(version, end='') 3101e04c3fSmrg 3201e04c3fSmrg 3301e04c3fSmrgif __name__ == '__main__': 3401e04c3fSmrg main() 35