Browse Source

bin/build-packages: extract perl version from `objdump -x`s RPATH, too

Erich Eckner 3 months ago
parent
commit
8d36443a88
1 changed files with 26 additions and 13 deletions
  1. 26
    13
      bin/build-packages

+ 26
- 13
bin/build-packages View File

@@ -725,6 +725,11 @@ while [ "${count}" -ne 0 ] && \
725 725
                   -exec objdump -x '{}' \; 2>/dev/null | \
726 726
                   sed '
727 727
                     /^architecture:.* i386:x86-64, /,/^architecture:.* i386:x86-32, / d
728
+                    \@^\s*RPATH\s\+/usr/lib/perl\([0-9]\+\)/\1\.[0-9.]\+/@ {
729
+                      s@^\s*RPATH\s\+/usr/lib/perl\([0-9]\+\)/\(\1\(\.[0-9.]\+\)\?\)\.\([0-9]\+\)/.*$@\2 \4@
730
+                      w '"${pkgfile}"'.needed-perl-version
731
+                      d
732
+                    }
728 733
                     /\sNEEDED\s/ {
729 734
                       s/^\s*\S\+\s\+\(\S\+\)\(\s.*\)\?$/\1/
730 735
                       /\.c32$/d
@@ -789,19 +794,27 @@ while [ "${count}" -ne 0 ] && \
789 794
                 find "${package_content_dir:?}/${pkgfile##*/}" -xdev -not -type l -exec chmod 777 '{}' \;
790 795
                 rm -rf --one-file-system "${package_content_dir:?}/${pkgfile##*/}"
791 796
               fi
792
-              tar -tJf "${pkgfile}" 2>/dev/null | \
793
-                sed -n '
794
-                  s,^usr/lib/python\(2\?\)\([013-9.][0-9.]*\)/$,python\1 \1\2,
795
-                  t print
796
-                  s,^usr/lib/perl[^/]\+/\([0-9.]\+\)/$,perl \1,
797
-                  t print
798
-                  s,^usr/lib/ruby/\([0-9.]\+\)/$,ruby \1,
799
-                  t print
800
-                  b
801
-                  :print
802
-                  s/\.\([^.]\+\)$/ \1/
803
-                  p
804
-                ' | \
797
+              {
798
+                tar -tJf "${pkgfile}" 2>/dev/null | \
799
+                  sed -n '
800
+                    s,^usr/lib/python\(2\?\)\([013-9.][0-9.]*\)/$,python\1 \1\2,
801
+                    t print
802
+                    s,^usr/lib/perl[^/]\+/\([0-9.]\+\)/$,perl \1,
803
+                    t print
804
+                    s,^usr/lib/ruby/\([0-9.]\+\)/$,ruby \1,
805
+                    t print
806
+                    b
807
+                    :print
808
+                    s/\.\([^.]\+\)$/ \1/
809
+                    p
810
+                  '
811
+                if [ -f "${pkgfile}.needed-perl-versions" ]; then
812
+                  sed '
813
+                    s/^/perl /
814
+                  ' "${pkgfile}.needed-perl-versions"
815
+                  rm "${pkgfile}.needed-perl-versions"
816
+                fi
817
+              } | \
805 818
                 while read -r name major_version minor_version; do
806 819
                   printf '%s>=%s.%s\n%s<%s.%s\n' \
807 820
                     "${name}" \