Add unbuilt py3_lxml to updater-py3_lxml-6.0.1 — py3_libxml2 → 2.14.5,py3_lxml → 6.0.1,ruby_rubocop → 1.80.1 (#12644)

* Add unbuilt py3_lxml to updater-py3_lxml-6.0.1

* updater-py3_lxml-6.0.1: Build Run on linux/amd64.

* updater-py3_lxml-6.0.1: Build Run on linux/arm/v7.

* updater-py3_lxml-6.0.1: Build Run on linux/386.

* fixup

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* updater-py3_lxml-6.0.1: Package File Update Run on linux/386 container.

* add builds

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Adjust getrealdeps.rb to add special deps to gem, pip, python packages.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Update rubocop, check py3_lxml build

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Update rubocop filelists.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

---------

Signed-off-by: Satadru Pramanik <satadru@gmail.com>
Co-authored-by: chromebrew-actions[bot] <chromebrew-actions[bot]@users.noreply.github.com>
Co-authored-by: Satadru Pramanik <satadru@gmail.com>
This commit is contained in:
chromebrew-actions[bot]
2025-08-27 14:01:11 -05:00
committed by GitHub
parent 72a13f8d09
commit da2a020562
13 changed files with 2786 additions and 2842 deletions

View File

@@ -1,4 +1,4 @@
# Total size: 1296391
# Total size: 1296383
/usr/local/lib/python3.13/site-packages/__pycache__/drv_libxml2.cpython-313.pyc
/usr/local/lib/python3.13/site-packages/__pycache__/libxml2.cpython-313.pyc
/usr/local/lib/python3.13/site-packages/drv_libxml2.py

View File

@@ -1,12 +1,12 @@
# Total size: 5840931
/usr/local/lib/python3.13/site-packages/lxml-6.0.0.dist-info/INSTALLER
/usr/local/lib/python3.13/site-packages/lxml-6.0.0.dist-info/METADATA
/usr/local/lib/python3.13/site-packages/lxml-6.0.0.dist-info/RECORD
/usr/local/lib/python3.13/site-packages/lxml-6.0.0.dist-info/REQUESTED
/usr/local/lib/python3.13/site-packages/lxml-6.0.0.dist-info/WHEEL
/usr/local/lib/python3.13/site-packages/lxml-6.0.0.dist-info/licenses/LICENSE.txt
/usr/local/lib/python3.13/site-packages/lxml-6.0.0.dist-info/licenses/LICENSES.txt
/usr/local/lib/python3.13/site-packages/lxml-6.0.0.dist-info/top_level.txt
# Total size: 5828865
/usr/local/lib/python3.13/site-packages/lxml-6.0.1.dist-info/INSTALLER
/usr/local/lib/python3.13/site-packages/lxml-6.0.1.dist-info/METADATA
/usr/local/lib/python3.13/site-packages/lxml-6.0.1.dist-info/RECORD
/usr/local/lib/python3.13/site-packages/lxml-6.0.1.dist-info/REQUESTED
/usr/local/lib/python3.13/site-packages/lxml-6.0.1.dist-info/WHEEL
/usr/local/lib/python3.13/site-packages/lxml-6.0.1.dist-info/licenses/LICENSE.txt
/usr/local/lib/python3.13/site-packages/lxml-6.0.1.dist-info/licenses/LICENSES.txt
/usr/local/lib/python3.13/site-packages/lxml-6.0.1.dist-info/top_level.txt
/usr/local/lib/python3.13/site-packages/lxml/ElementInclude.py
/usr/local/lib/python3.13/site-packages/lxml/__init__.py
/usr/local/lib/python3.13/site-packages/lxml/__pycache__/ElementInclude.cpython-313.pyc

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
# Total size: 1240891
# Total size: 1240947
/usr/local/lib/python3.13/site-packages/__pycache__/drv_libxml2.cpython-313.pyc
/usr/local/lib/python3.13/site-packages/__pycache__/libxml2.cpython-313.pyc
/usr/local/lib/python3.13/site-packages/drv_libxml2.py

View File

@@ -1,12 +1,12 @@
# Total size: 12580165
/usr/local/lib/python3.13/site-packages/lxml-6.0.0.dist-info/INSTALLER
/usr/local/lib/python3.13/site-packages/lxml-6.0.0.dist-info/METADATA
/usr/local/lib/python3.13/site-packages/lxml-6.0.0.dist-info/RECORD
/usr/local/lib/python3.13/site-packages/lxml-6.0.0.dist-info/REQUESTED
/usr/local/lib/python3.13/site-packages/lxml-6.0.0.dist-info/WHEEL
/usr/local/lib/python3.13/site-packages/lxml-6.0.0.dist-info/licenses/LICENSE.txt
/usr/local/lib/python3.13/site-packages/lxml-6.0.0.dist-info/licenses/LICENSES.txt
/usr/local/lib/python3.13/site-packages/lxml-6.0.0.dist-info/top_level.txt
# Total size: 6343788
/usr/local/lib/python3.13/site-packages/lxml-6.0.1.dist-info/INSTALLER
/usr/local/lib/python3.13/site-packages/lxml-6.0.1.dist-info/METADATA
/usr/local/lib/python3.13/site-packages/lxml-6.0.1.dist-info/RECORD
/usr/local/lib/python3.13/site-packages/lxml-6.0.1.dist-info/REQUESTED
/usr/local/lib/python3.13/site-packages/lxml-6.0.1.dist-info/WHEEL
/usr/local/lib/python3.13/site-packages/lxml-6.0.1.dist-info/licenses/LICENSE.txt
/usr/local/lib/python3.13/site-packages/lxml-6.0.1.dist-info/licenses/LICENSES.txt
/usr/local/lib/python3.13/site-packages/lxml-6.0.1.dist-info/top_level.txt
/usr/local/lib/python3.13/site-packages/lxml/ElementInclude.py
/usr/local/lib/python3.13/site-packages/lxml/__init__.py
/usr/local/lib/python3.13/site-packages/lxml/__pycache__/ElementInclude.cpython-313.pyc
@@ -73,88 +73,7 @@
/usr/local/lib/python3.13/site-packages/lxml/includes/dtdvalid.pxd
/usr/local/lib/python3.13/site-packages/lxml/includes/etree_defs.h
/usr/local/lib/python3.13/site-packages/lxml/includes/etreepublic.pxd
/usr/local/lib/python3.13/site-packages/lxml/includes/extlibs/__init__.py
/usr/local/lib/python3.13/site-packages/lxml/includes/extlibs/__pycache__/__init__.cpython-313.pyc
/usr/local/lib/python3.13/site-packages/lxml/includes/extlibs/libcharset.h
/usr/local/lib/python3.13/site-packages/lxml/includes/extlibs/localcharset.h
/usr/local/lib/python3.13/site-packages/lxml/includes/extlibs/zconf.h
/usr/local/lib/python3.13/site-packages/lxml/includes/extlibs/zlib.h
/usr/local/lib/python3.13/site-packages/lxml/includes/htmlparser.pxd
/usr/local/lib/python3.13/site-packages/lxml/includes/libexslt/__init__.py
/usr/local/lib/python3.13/site-packages/lxml/includes/libexslt/__pycache__/__init__.cpython-313.pyc
/usr/local/lib/python3.13/site-packages/lxml/includes/libexslt/exslt.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libexslt/exsltconfig.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libexslt/exsltexports.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/HTMLparser.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/HTMLtree.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/SAX.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/SAX2.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/__init__.py
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/__pycache__/__init__.cpython-313.pyc
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/c14n.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/catalog.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/chvalid.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/debugXML.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/dict.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/encoding.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/entities.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/globals.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/hash.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/list.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/nanoftp.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/nanohttp.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/parser.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/parserInternals.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/relaxng.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/schemasInternals.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/schematron.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/threads.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/tree.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/uri.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/valid.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/xinclude.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/xlink.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/xmlIO.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/xmlautomata.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/xmlerror.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/xmlexports.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/xmlmemory.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/xmlmodule.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/xmlreader.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/xmlregexp.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/xmlsave.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/xmlschemas.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/xmlschemastypes.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/xmlstring.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/xmlunicode.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/xmlversion.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/xmlwriter.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/xpath.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/xpathInternals.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxml/xpointer.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxslt/__init__.py
/usr/local/lib/python3.13/site-packages/lxml/includes/libxslt/__pycache__/__init__.cpython-313.pyc
/usr/local/lib/python3.13/site-packages/lxml/includes/libxslt/attributes.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxslt/documents.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxslt/extensions.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxslt/extra.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxslt/functions.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxslt/imports.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxslt/keys.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxslt/namespaces.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxslt/numbersInternals.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxslt/pattern.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxslt/preproc.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxslt/security.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxslt/templates.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxslt/transform.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxslt/variables.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxslt/xslt.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxslt/xsltInternals.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxslt/xsltconfig.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxslt/xsltexports.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxslt/xsltlocale.h
/usr/local/lib/python3.13/site-packages/lxml/includes/libxslt/xsltutils.h
/usr/local/lib/python3.13/site-packages/lxml/includes/lxml-version.h
/usr/local/lib/python3.13/site-packages/lxml/includes/relaxng.pxd
/usr/local/lib/python3.13/site-packages/lxml/includes/schematron.pxd

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
# Total size: 1290951
# Total size: 1290975
/usr/local/lib64/python3.13/site-packages/__pycache__/drv_libxml2.cpython-313.pyc
/usr/local/lib64/python3.13/site-packages/__pycache__/libxml2.cpython-313.pyc
/usr/local/lib64/python3.13/site-packages/drv_libxml2.py

View File

@@ -1,12 +1,12 @@
# Total size: 12228401
/usr/local/lib64/python3.13/site-packages/lxml-6.0.0.dist-info/INSTALLER
/usr/local/lib64/python3.13/site-packages/lxml-6.0.0.dist-info/METADATA
/usr/local/lib64/python3.13/site-packages/lxml-6.0.0.dist-info/RECORD
/usr/local/lib64/python3.13/site-packages/lxml-6.0.0.dist-info/REQUESTED
/usr/local/lib64/python3.13/site-packages/lxml-6.0.0.dist-info/WHEEL
/usr/local/lib64/python3.13/site-packages/lxml-6.0.0.dist-info/licenses/LICENSE.txt
/usr/local/lib64/python3.13/site-packages/lxml-6.0.0.dist-info/licenses/LICENSES.txt
/usr/local/lib64/python3.13/site-packages/lxml-6.0.0.dist-info/top_level.txt
# Total size: 12209739
/usr/local/lib64/python3.13/site-packages/lxml-6.0.1.dist-info/INSTALLER
/usr/local/lib64/python3.13/site-packages/lxml-6.0.1.dist-info/METADATA
/usr/local/lib64/python3.13/site-packages/lxml-6.0.1.dist-info/RECORD
/usr/local/lib64/python3.13/site-packages/lxml-6.0.1.dist-info/REQUESTED
/usr/local/lib64/python3.13/site-packages/lxml-6.0.1.dist-info/WHEEL
/usr/local/lib64/python3.13/site-packages/lxml-6.0.1.dist-info/licenses/LICENSE.txt
/usr/local/lib64/python3.13/site-packages/lxml-6.0.1.dist-info/licenses/LICENSES.txt
/usr/local/lib64/python3.13/site-packages/lxml-6.0.1.dist-info/top_level.txt
/usr/local/lib64/python3.13/site-packages/lxml/ElementInclude.py
/usr/local/lib64/python3.13/site-packages/lxml/__init__.py
/usr/local/lib64/python3.13/site-packages/lxml/__pycache__/ElementInclude.cpython-313.pyc

File diff suppressed because it is too large Load Diff

View File

@@ -12,16 +12,16 @@ class Py3_libxml2 < Python
binary_compression 'tar.zst'
binary_sha256({
aarch64: 'a7836b787c81589f64d05846064e2d4ab273f16c4d8f84170c2261764c9e8888',
armv7l: 'a7836b787c81589f64d05846064e2d4ab273f16c4d8f84170c2261764c9e8888',
i686: '6c77c43611eaf3aa000c7fb0121ca144ed9116c4bc3ca9d9eda9017a26196aa5',
x86_64: '87d409eb9a7408413dab36cd25d507216b844d08f0f1c440584dc447d1dacaeb'
aarch64: '0c6ca440e6401673f4a952069de2a3d401d0463a0ee3d90d257dab923e50439e',
armv7l: '0c6ca440e6401673f4a952069de2a3d401d0463a0ee3d90d257dab923e50439e',
i686: 'a38b835b9d4479330231a4515b1846ea897ae82145548fa2ed720b44ad6a2d7c',
x86_64: '701ae77cbb8cf0806bad05ca1f935cefe3a5f7a532433b68460b97440610666f'
})
depends_on 'glibc' # R
depends_on 'libxml2' # R
depends_on 'python3'
depends_on 'py3_setuptools' => :build
depends_on 'python3' # R
depends_on 'zlib' # R
no_fhs

View File

@@ -3,17 +3,17 @@ require 'buildsystems/pip'
class Py3_lxml < Pip
description 'LXML is a Python library for processing XML and HTML.'
homepage 'https://lxml.de/'
version "6.0.0-#{CREW_PY_VER}"
version "6.0.1-#{CREW_PY_VER}"
license 'BSD-3'
compatibility 'all'
source_url 'SKIP'
binary_compression 'tar.zst'
binary_sha256({
aarch64: 'd8517affd273d8c4b3e0a54c49fa86b469aa114caebda7f5e08d8b80997c011b',
armv7l: 'd8517affd273d8c4b3e0a54c49fa86b469aa114caebda7f5e08d8b80997c011b',
i686: '70c6ef4b7573b37becaa2a20c32e56880572bf445da8a62bae24817c581e2ea1',
x86_64: 'b8ec84b9bb6aa5368286711564282aba92f73a80e7bea2304319a47f769c0448'
aarch64: 'ad4ade67e25ddf38061a3e3e5e0f7a255db7f23fdf05d9833eb7344c9849053e',
armv7l: 'ad4ade67e25ddf38061a3e3e5e0f7a255db7f23fdf05d9833eb7344c9849053e',
i686: '2f4c47c9af54f30a27e198df67f816da2a9e7d734d2289341d5e51e40851e07d',
x86_64: 'e00e5d760a866a2aae0ab895643994489364d6b9e55e63a5531e77c6dbcd7f67'
})
depends_on 'glibc' # R
@@ -22,5 +22,6 @@ class Py3_lxml < Pip
depends_on 'py3_cython' => :build
depends_on 'python3' # R
depends_on 'zlib' # R
no_source_build
end

View File

@@ -6,7 +6,7 @@ require 'buildsystems/ruby'
class Ruby_rubocop < RUBY
description 'A Ruby static code analyzer and formatter'
homepage 'https://rubocop.org'
version "1.80.0-#{CREW_RUBY_VER}"
version "1.80.1-#{CREW_RUBY_VER}"
license 'MIT'
compatibility 'all'
source_url 'SKIP'
@@ -18,6 +18,7 @@ class Ruby_rubocop < RUBY
depends_on 'ruby_parallel' # R
depends_on 'ruby_parser' # R
depends_on 'ruby_prism' # R
depends_on 'ruby_racc' # R
depends_on 'ruby_rainbow' # R
depends_on 'ruby_regexp_parser' # R
depends_on 'ruby_rubocop' # R

View File

@@ -1,5 +1,5 @@
#!/usr/local/bin/ruby
# getrealdeps version 2.1 (for Chromebrew)
# getrealdeps version 2.2 (for Chromebrew)
# Author: Satadru Pramanik (satmandu) satadru at gmail dot com
require 'fileutils'
@@ -9,11 +9,17 @@ crew_local_repo_root = `git rev-parse --show-toplevel 2> /dev/null`.chomp
if crew_local_repo_root.to_s.empty?
require_relative '../lib/color'
require_relative '../lib/const'
require_relative '../lib/package'
$LOAD_PATH.unshift File.expand_path('../lib', __dir__)
else
require File.join(crew_local_repo_root, 'lib/color')
require File.join(crew_local_repo_root, 'lib/const')
require File.join(crew_local_repo_root, 'lib/package')
$LOAD_PATH.unshift File.expand_path(File.join(crew_local_repo_root, 'lib'), __dir__)
end
@rubocop_config = CREW_LOCAL_REPO_ROOT.to_s.empty? ? "#{CREW_LIB_PATH}/.rubocop.yml" : File.join(CREW_LOCAL_REPO_ROOT, '.rubocop.yml')
if ARGV.include?('--use-crew-dest-dir')
ARGV.delete('--use-crew-dest-dir')
@opt_use_crew_dest_dir = true
@@ -40,6 +46,8 @@ end
def main(pkg)
puts "Checking for the runtime dependencies of #{pkg}...".lightblue
pkg_file = File.join(CREW_PACKAGES_PATH, "#{pkg}.rb")
FileUtils.cp File.join(CREW_LOCAL_REPO_ROOT, "packages/#{pkg}.rb"), pkg_file if !CREW_LOCAL_REPO_ROOT.to_s.empty? && File.file?(File.join(CREW_LOCAL_REPO_ROOT, "packages/#{pkg}.rb"))
if @opt_use_crew_dest_dir
define_singleton_method('pkgfilelist') { File.join(CREW_DEST_DIR, 'filelist') }
@@ -119,7 +127,21 @@ def main(pkg)
return if pkgdeps.empty?
# Look for missing runtime dependencies, ignoring build and optional deps.
missingpkgdeps = pkgdeps.reject { |i| File.read("#{CREW_PREFIX}/lib/crew/packages/#{pkg}.rb").include?("depends_on '#{i}'") unless File.read("#{CREW_PREFIX}/lib/crew/packages/#{pkg}.rb").include?("depends_on '#{i}' => :build") || File.read("#{CREW_PREFIX}/lib/crew/packages/#{pkg}.rb").include?("# depends_on '#{i}' # R (optional)") }
missingpkgdeps = pkgdeps.reject { |i| File.read(pkg_file).include?("depends_on '#{i}'") unless File.read(pkg_file).include?("depends_on '#{i}' => :build") || File.read(pkg_file).include?("# depends_on '#{i}' # R (optional)") }
# Add special deps for perl, pip, python, and ruby gem packages.
case @pkg.superclass.to_s
when 'PERL'
missingpkgdeps << 'perl'
when 'Pip', 'Python'
missingpkgdeps << 'python3'
when 'RUBY'
missingpkgdeps << 'ruby'
end
# These deps are sometimes architecture dependent or should not be
# removed for other reasons.
privileged_deps = %w[glibc glibc_lib gcc_lib perl python3 ruby]
# Special cases where dependencies should not be automatically added:
@@ -146,8 +168,8 @@ def main(pkg)
pkgdeps.delete_if { |d| /#{exclusion_regex}/.match(d) }
end
missingpkgdeps.delete_if { |d| File.read("#{CREW_PREFIX}/lib/crew/packages/#{pkg}.rb").include?("# depends_on '#{d}' # R (optional)") }
pkgdeps.delete_if { |d| File.read("#{CREW_PREFIX}/lib/crew/packages/#{pkg}.rb").include?("# depends_on '#{d}' # R (optional)") }
missingpkgdeps.delete_if { |d| File.read(pkg_file).include?("# depends_on '#{d}' # R (optional)") }
pkgdeps.delete_if { |d| File.read(pkg_file).include?("# depends_on '#{d}' # R (optional)") }
puts "\nPackage #{pkg} has runtime library dependencies on these packages:".lightblue
pkgdeps.each do |i|
@@ -157,7 +179,7 @@ def main(pkg)
# Get existing package deps entries so we can add to and sort as
# necessary.
pkgdepsblock = []
pkgdepsblock += File.foreach("#{CREW_PREFIX}/lib/crew/packages/#{pkg}.rb").grep(/ depends_on '| # depends_on '/)
pkgdepsblock += File.foreach(pkg_file).grep(/ depends_on '| # depends_on '/)
unless missingpkgdeps.empty?
puts "\nPackage file #{pkg}.rb is missing these runtime library dependencies:".orange
@@ -170,44 +192,45 @@ def main(pkg)
puts "\n Adding to or replacing deps block in package..."
# First remove all dependencies.
system "sed -i '/ depends_on /d' #{CREW_PREFIX}/lib/crew/packages/#{pkg}.rb"
system "sed -i '/^ # depends_on /d' #{CREW_PREFIX}/lib/crew/packages/#{pkg}.rb"
system "sed -i '/ depends_on /d' #{pkg_file}"
system "sed -i '/^ # depends_on /d' #{pkg_file}"
# Now add back our sorted dependencies.
gawk_cmd = "gawk -i inplace -v dep=\"#{pkgdepsblock.join('QQQQQ')}\" 'FNR==NR{ if (/})/) p=NR; next} 1; FNR==p{ print \"\\n\" dep }' #{CREW_PREFIX}/lib/crew/packages/#{pkg}.rb #{CREW_PREFIX}/lib/crew/packages/#{pkg}.rb"
gawk_cmd = "gawk -i inplace -v dep=\"#{pkgdepsblock.join('QQQQQ')}\" 'FNR==NR{ if (/})/) p=NR; next} 1; FNR==p{ print \"\\n\" dep }' #{pkg_file} #{pkg_file}"
system(gawk_cmd)
# The first added line has two dependencies without a newline
# separating them.
system "sed -i 's/RQQQQQ/R\\n/' #{CREW_PREFIX}/lib/crew/packages/#{pkg}.rb"
system "sed -i 's/QQQQQ//g' #{CREW_PREFIX}/lib/crew/packages/#{pkg}.rb"
system "sed -i 's/RQQQQQ/R\\n/' #{pkg_file}"
system "sed -i 's/QQQQQ//g' #{pkg_file}"
# Check for and delete old runtime dependencies.
# Its unsafe to do this with other dependencies, because the packager might know something we don't.
lines_to_delete = {}
File.readlines("#{CREW_PREFIX}/lib/crew/packages/#{pkg}.rb").each_with_index do |line, line_number|
File.readlines(pkg_file).each_with_index do |line, line_number|
# Find all the explicitly marked runtime dependencies.
dep = line.match(/ depends_on '(.*)' # R/)
# Basically just a nil check, but this way we avoid matching twice.
next unless dep
# Skip unless the runtime dependency in the package does not match the runtime dependencies we've found.
next unless pkgdeps.none?(dep[1])
# Skip if we're dealing with a glibc, glibc_lib or gcc_lib dependency-- these are architecture dependent sometimes?
next if %w[glibc glibc_lib gcc_lib].include?(dep[1])
# Skip if we're dealing with privileged deps.
next if privileged_deps.include?(dep[1])
# Record the line content as the key and the line number (incremented by one because the index starts at 0) as the value.
lines_to_delete[line] = line_number + 1
end
# Clean up any blank lines with rubocop.
system "rubocop --only Layout/EmptyLines -A #{CREW_PREFIX}/lib/crew/packages/#{pkg}.rb"
(FileUtils.cp "#{CREW_PREFIX}/lib/crew/packages/#{pkg}.rb", "#{CREW_LOCAL_REPO_ROOT}/packages/#{pkg}.rb" if lines_to_delete.empty?) unless CREW_LOCAL_REPO_ROOT.to_s.empty?
# Clean with rubocop.
system "rubocop -c #{@rubocop_config} -A #{pkg_file}"
(FileUtils.cp pkg_file, "#{CREW_LOCAL_REPO_ROOT}/packages/#{pkg}.rb" if lines_to_delete.empty?) unless CREW_LOCAL_REPO_ROOT.to_s.empty?
# Leave if there aren't any old runtime dependencies.
return if lines_to_delete.empty?
puts "\nPackage file #{pkg}.rb has these outdated runtime library dependencies:".lightpurple
puts lines_to_delete.keys
system("gawk -i inplace 'NR != #{lines_to_delete.values.join(' && NR != ')}' #{CREW_PREFIX}/lib/crew/packages/#{pkg}.rb")
# Clean up any blank lines with rubocop.
system "rubocop --only Layout/EmptyLines -A #{CREW_PREFIX}/lib/crew/packages/#{pkg}.rb"
FileUtils.cp "#{CREW_PREFIX}/lib/crew/packages/#{pkg}.rb", "#{CREW_LOCAL_REPO_ROOT}/packages/#{pkg}.rb" unless CREW_LOCAL_REPO_ROOT.to_s.empty?
system("gawk -i inplace 'NR != #{lines_to_delete.values.join(' && NR != ')}' #{pkg_file}")
# Clean with rubocop.
system "rubocop -c #{@rubocop_config} -A #{pkg_file}"
FileUtils.cp pkg_file, "#{CREW_LOCAL_REPO_ROOT}/packages/#{pkg}.rb" unless CREW_LOCAL_REPO_ROOT.to_s.empty?
end
ARGV.each do |package|
@pkg = Package.load_package("packages/#{package}")
main(package.chomp('rb'))
end