mirror of
				https://github.com/Telecominfraproject/ols-nos.git
				synced 2025-10-31 10:07:49 +00:00 
			
		
		
		
	Build python-click Debian package from version 6.7-4 source to fix CLI autocomplete/suggest (#1824)
This commit is contained in:
		
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -28,6 +28,8 @@ src/lldpd/* | |||||||
| !src/lldpd/patch/ | !src/lldpd/patch/ | ||||||
| src/mpdecimal/* | src/mpdecimal/* | ||||||
| !src/mpdecimal/Makefile | !src/mpdecimal/Makefile | ||||||
|  | src/python-click/* | ||||||
|  | !src/python-click/Makefile | ||||||
| src/python3/* | src/python3/* | ||||||
| !src/python3/Makefile | !src/python3/Makefile | ||||||
| src/redis/* | src/redis/* | ||||||
|   | |||||||
| @@ -89,6 +89,12 @@ sudo cp {{platform_common_py2_wheel_path}} $FILESYSTEM_ROOT/$PLATFORM_COMMON_PY2 | |||||||
| sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install $PLATFORM_COMMON_PY2_WHEEL_NAME | sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install $PLATFORM_COMMON_PY2_WHEEL_NAME | ||||||
| sudo rm -rf $FILESYSTEM_ROOT/$PLATFORM_COMMON_PY2_WHEEL_NAME | sudo rm -rf $FILESYSTEM_ROOT/$PLATFORM_COMMON_PY2_WHEEL_NAME | ||||||
|  |  | ||||||
|  | # Install built Python Click package (and its dependencies via 'apt-get -y install -f') | ||||||
|  | # Do this before installing sonic-utilities so that it doesn't attempt to install | ||||||
|  | # an older version as part of its dependencies | ||||||
|  | sudo dpkg --root=$FILESYSTEM_ROOT -i target/debs/python-click*_all.deb || \ | ||||||
|  |     sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f | ||||||
|  |  | ||||||
| # Install SONiC Utilities (and its dependencies via 'apt-get -y install -f') | # Install SONiC Utilities (and its dependencies via 'apt-get -y install -f') | ||||||
| sudo dpkg --root=$FILESYSTEM_ROOT -i target/debs/python-sonic-utilities_*.deb || \ | sudo dpkg --root=$FILESYSTEM_ROOT -i target/debs/python-sonic-utilities_*.deb || \ | ||||||
|     sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f |     sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f | ||||||
|   | |||||||
							
								
								
									
										16
									
								
								rules/python-click.mk
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								rules/python-click.mk
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | |||||||
|  | # python-click package | ||||||
|  | # | ||||||
|  | # Python Click versions < 6.7 have a bug which causes bash completion | ||||||
|  | # functionality to stop working after two sublevels. sonic-utilities depends | ||||||
|  | # on this package, and the most recent version provided by Debian Jessie and | ||||||
|  | # Stretch is v6.6. We build version 6.7 from source in order to fix this bug. | ||||||
|  | # TODO: If we upgrade to a distro which provides a version >= 6.7 we will no | ||||||
|  | # longer need to build this. | ||||||
|  |  | ||||||
|  | PYTHON_CLICK_VERSION = 6.7-4 | ||||||
|  |  | ||||||
|  | export PYTHON_CLICK_VERSION | ||||||
|  |  | ||||||
|  | PYTHON_CLICK = python-click_$(PYTHON_CLICK_VERSION)_all.deb | ||||||
|  | $(PYTHON_CLICK)_SRC_PATH = $(SRC_PATH)/python-click | ||||||
|  | SONIC_MAKE_DEBS += $(PYTHON_CLICK) | ||||||
							
								
								
									
										1
									
								
								slave.mk
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								slave.mk
									
									
									
									
									
								
							| @@ -447,6 +447,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ | |||||||
|                 $(IGB_DRIVER) \ |                 $(IGB_DRIVER) \ | ||||||
|                 $(IXGBE_DRIVER) \ |                 $(IXGBE_DRIVER) \ | ||||||
|                 $(SONIC_DEVICE_DATA) \ |                 $(SONIC_DEVICE_DATA) \ | ||||||
|  |                 $(PYTHON_CLICK) \ | ||||||
|                 $(SONIC_UTILS) \ |                 $(SONIC_UTILS) \ | ||||||
|                 $(LIBWRAP) \ |                 $(LIBWRAP) \ | ||||||
|                 $(LIBPAM_TACPLUS) \ |                 $(LIBPAM_TACPLUS) \ | ||||||
|   | |||||||
| @@ -193,8 +193,6 @@ RUN apt-get update && apt-get install -y \ | |||||||
|         python-netaddr \ |         python-netaddr \ | ||||||
|         python-ipaddr \ |         python-ipaddr \ | ||||||
|         python-yaml \ |         python-yaml \ | ||||||
| # For sonic utilities |  | ||||||
|         python3-netaddr \ |  | ||||||
| # For lockfile | # For lockfile | ||||||
|         procmail \ |         procmail \ | ||||||
| # For gtest | # For gtest | ||||||
| @@ -213,7 +211,17 @@ RUN apt-get update && apt-get install -y \ | |||||||
|         linuxdoc-tools \ |         linuxdoc-tools \ | ||||||
|         lynx \ |         lynx \ | ||||||
|         texlive-latex-extra \ |         texlive-latex-extra \ | ||||||
|         texlive-latex-recommended |         texlive-latex-recommended \ | ||||||
|  | # For python-click build | ||||||
|  |         python-sphinx \ | ||||||
|  |         python-docutils \ | ||||||
|  |         python3-all \ | ||||||
|  |         python3-setuptools \ | ||||||
|  |         python3-sphinx \ | ||||||
|  |         python3-docutils \ | ||||||
|  |         python3-requests \ | ||||||
|  |         python3-pytest \ | ||||||
|  |         python3-colorama | ||||||
|  |  | ||||||
| # For linux build | # For linux build | ||||||
| RUN apt-get -y build-dep linux | RUN apt-get -y build-dep linux | ||||||
|   | |||||||
							
								
								
									
										26
									
								
								src/python-click/Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								src/python-click/Makefile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,26 @@ | |||||||
|  | .ONESHELL: | ||||||
|  | SHELL = /bin/bash | ||||||
|  | .SHELLFLAGS += -e | ||||||
|  |  | ||||||
|  | MAIN_TARGET = python-click_$(PYTHON_CLICK_VERSION)_all.deb | ||||||
|  |  | ||||||
|  | $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : | ||||||
|  | 	# Remove any stale files | ||||||
|  | 	rm -rf ./python-click | ||||||
|  |  | ||||||
|  | 	# Clone python-click Debian repo | ||||||
|  | 	git clone https://salsa.debian.org/debian/python-click | ||||||
|  |  | ||||||
|  | 	pushd ./python-click | ||||||
|  |  | ||||||
|  | 	# Reset HEAD to the commit of the proper tag | ||||||
|  | 	# NOTE: Using "git checkout <tag_name>" here detaches our HEAD, | ||||||
|  | 	# which stg doesn't like, so we use this method instead | ||||||
|  | 	git reset --hard debian/$(PYTHON_CLICK_VERSION) | ||||||
|  |  | ||||||
|  | 	# Build source and Debian packages | ||||||
|  | 	dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) | ||||||
|  | 	popd | ||||||
|  |  | ||||||
|  | 	# Move the newly-built .deb package to the destination directory | ||||||
|  | 	mv $* $(DEST)/ | ||||||
		Reference in New Issue
	
	Block a user
	 Joe LeVeque
					Joe LeVeque