python,python3: simplify `sed` expression for setuptools & pip
authorAlexandru Ardelean <ardeleanalex@gmail.com>
Mon, 3 Jul 2017 06:43:42 +0000 (09:43 +0300)
committerAlexandru Ardelean <ardeleanalex@gmail.com>
Mon, 3 Jul 2017 13:11:52 +0000 (16:11 +0300)
A suggestion from comment (from Philip Prindeville):
https://github.com/openwrt/packages/issues/4529#issuecomment-312518121

Avoids some escaping of slashes.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
lang/python/python/files/python-package-pip.mk
lang/python/python/files/python-package-setuptools.mk
lang/python/python3/files/python3-package-pip.mk
lang/python/python3/files/python3-package-setuptools.mk

index 8dd0d6c79a261956cb9344f434de7c6ebf79d819..a3934cc197e605e0f2c35537fe0d48609efcbd0b 100644 (file)
@@ -15,7 +15,7 @@ endef
 define PyPackage/python-pip/install
        $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/python$(PYTHON_VERSION)/site-packages
        # Adjust shebang to proper python location on target
-       sed "1s/.*/#\!\/usr\/bin\/python$(PYTHON_VERSION)/" -i $(PKG_BUILD_DIR)/install-pip/bin/*
+       sed "1s@.*@#\!/usr/bin/python$(PYTHON_VERSION)@" -i $(PKG_BUILD_DIR)/install-pip/bin/*
        $(CP) $(PKG_BUILD_DIR)/install-pip/bin/* $(1)/usr/bin
        $(CP) \
                $(PKG_BUILD_DIR)/install-pip/lib/python$(PYTHON_VERSION)/site-packages/pip \
index 48823731e3ac271193a0da0678f08abc91ab62f0..c35fad8c5b1132ff00b8d9a2516738d064bd9b54 100644 (file)
@@ -15,7 +15,7 @@ endef
 define PyPackage/python-setuptools/install
        $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/python$(PYTHON_VERSION)/site-packages
        # Adjust shebang to proper python location on target
-       sed "1s/.*/#\!\/usr\/bin\/python$(PYTHON_VERSION)/" -i $(PKG_BUILD_DIR)/install-setuptools/bin/*
+       sed "1s@.*@#\!/usr/bin/python$(PYTHON_VERSION)@" -i $(PKG_BUILD_DIR)/install-setuptools/bin/*
        $(CP) $(PKG_BUILD_DIR)/install-setuptools/bin/* $(1)/usr/bin
        $(CP) \
                $(PKG_BUILD_DIR)/install-setuptools/lib/python$(PYTHON_VERSION)/site-packages/pkg_resources \
index 43e05f1c7576b4ebe2d95b01532eae4fb9b6b6c2..ff9b5ac7499513ef3511f98f2b8c2498a53f7ca0 100644 (file)
@@ -15,7 +15,7 @@ endef
 define Package/python3-pip/install
        $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages
        # Adjust shebang to proper python location on target
-       sed "1s/.*/#\!\/usr\/bin\/python$(PYTHON3_VERSION)/" -i $(PKG_BUILD_DIR)/install-pip/bin/*
+       sed "1s@.*@#\!/usr/bin/python$(PYTHON3_VERSION)@" -i $(PKG_BUILD_DIR)/install-pip/bin/*
        $(CP) $(PKG_BUILD_DIR)/install-pip/bin/pip3* $(1)/usr/bin
        $(CP) \
                $(PKG_BUILD_DIR)/install-pip/lib/python$(PYTHON3_VERSION)/site-packages/pip \
index 9a646334f33773da04061d87c901dbc327d20a66..684d3e64e14facc8c25f9d0da2c6e2b222686f77 100644 (file)
@@ -15,7 +15,7 @@ endef
 define Py3Package/python3-setuptools/install
        $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages
        # Adjust shebang to proper python location on target
-       sed "1s/.*/#\!\/usr\/bin\/python$(PYTHON3_VERSION)/" -i $(PKG_BUILD_DIR)/install-setuptools/bin/*
+       sed "1s@.*@#\!/usr/bin/python$(PYTHON3_VERSION)@" -i $(PKG_BUILD_DIR)/install-setuptools/bin/*
        $(CP) $(PKG_BUILD_DIR)/install-setuptools/bin/easy_install-* $(1)/usr/bin
        $(LN) easy_install-$(PYTHON3_VERSION) $(1)/usr/bin/easy_install-3
        $(CP) \