]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
Hardlink equal python bytecode files.
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 23 Dec 2008 09:22:13 +0000 (10:22 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 23 Dec 2008 09:22:13 +0000 (10:22 +0100)
lfs/strip

index 51ba0554017fa0d394b02043d013c2db3af5430b..64f9b441d7435fcd840c9024857cc19510eff453 100644 (file)
--- a/lfs/strip
+++ b/lfs/strip
@@ -55,6 +55,14 @@ ifeq "$(STAGE)" "toolchain"
 endif
 
 ifeq "$(STAGE)" "packages"
+       ## If the pyc and pyo files are the same, we can hardlink them
+       for pyc in $$(find /usr/lib/python* -type f -name "*.pyc"); do \
+               pyo=$$(echo "$$pyc" | sed "s/.pyc$$/.pyo/"); \
+               if cmp -s "$$pyc" "$$pyo"; then \
+                       ln -f "$$pyc" "$$pyo"; \
+               fi; \
+       done
+
        -$(TOOLS_DIR)/bin/find $(LFS)/{,usr/}{bin,lib,sbin} -type f -exec \
                $(TOOLS_DIR)/bin/strip --strip-debug '{}' ';' &>/dev/null
        -$(TOOLS_DIR)/bin/find $(LFS)/{,usr/}{bin,sbin} -type f -exec \