diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 12e3b3b8c0b38afabe522591a63c645b66c5be96..32d343650faccbed50c8edec7bfbfbea2e6b0ce0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -53,7 +53,6 @@ build:scout: ./build-relocatable-install.py \ --srcdir . \ --builddir _build \ - --libcapsuledir /usr/lib/libcapsule/relocatable \ --output _build/relocatable-install \ --archive "$(pwd)/_build" \ --set-version "$(cat .tarball-version)" \ diff --git a/README.md b/README.md index a5d4e5891d5a666d5a5d457fdae28102ea6325e3..e996ccdbd9fcb450c350d8a73582d654a94a516c 100644 --- a/README.md +++ b/README.md @@ -157,7 +157,6 @@ Then you can do: ./build-relocatable-install.py \ --srcdir . \ --builddir _build \ - --libcapsuledir /usr/lib/libcapsule/relocatable \ --output _build/relocatable-install \ --archive . ./tests/relocatable-install.py _build/relocatable-install # optional diff --git a/build-relocatable-install.py b/build-relocatable-install.py index 1c3a434f96c0c423fa58eb85e71fd6be3d26b5ef..52a0cd2b76f7afb9bea66d0ea480187025bf6c48 100755 --- a/build-relocatable-install.py +++ b/build-relocatable-install.py @@ -100,7 +100,7 @@ SCRIPTS = [ EXECUTABLES = [ 'pressure-vessel-wrap' ] -TOOLS = [ +LIBCAPSULE_TOOLS = [ 'capsule-capture-libs', 'capsule-symbols', ] @@ -144,7 +144,6 @@ def main(): parser.add_argument('--prefix', default=None) parser.add_argument('--output', '-o', default=None) parser.add_argument('--archive', default=None) - parser.add_argument('--libcapsuledir', default='') parser.add_argument('--set-version', dest='version', default='unknown') args = parser.parse_args() @@ -211,64 +210,34 @@ def main(): 0o644, ) - if args.libcapsuledir: - for arch in ARCHS: - for tool in TOOLS: - install_exe( - os.path.join( - args.libcapsuledir, - '{}-{}'.format(arch.multiarch, tool), - ), - os.path.join(installation, 'bin'), - ) - - install( - '/usr/share/doc/libcapsule-tools-relocatable/copyright', - os.path.join(installation, 'metadata', 'libcapsule.txt'), + for arch in ARCHS: + path = '/usr/lib/libcapsule/relocatable/{}-{}'.format( + arch.multiarch, + LIBCAPSULE_TOOLS[0], ) - else: - for arch in ARCHS: - for tool in TOOLS: - install_exe( - os.path.join( - args.builddir, - 'build-relocatable', - arch.name, - 'libcapsule', - tool, - ), - os.path.join( - tmpdir, - 'build-relocatable', - '{}-{}'.format(arch.multiarch, tool), - ), - ) - v_check_call([ - 'chrpath', '-r', - '${ORIGIN}/../lib/' + arch.multiarch, - os.path.join( - tmpdir, - 'build-relocatable', - '{}-{}'.format(arch.multiarch, tool), - ), - ]) - install_exe( - os.path.join( - tmpdir, - 'build-relocatable', - '{}-{}'.format(arch.multiarch, tool), - ), - os.path.join(installation, 'bin'), - ) - install( + if not os.path.exists(path): + v_check_call([ + 'apt-get', + 'download', + package, + ], cwd=tmpdir) + v_check_call( + 'dpkg-deb -x {}_*.deb build-relocatable'.format( + quote(package), + ), + cwd=tmpdir, + shell=True, + ) + path = '{}/build-relocatable/usr/bin/TOOL'.format(tmpdir) + + for tool in LIBCAPSULE_TOOLS: + install_exe( os.path.join( - args.builddir, - 'libcapsule', - 'debian', - 'copyright', + os.path.dirname(path), + '{}-{}'.format(arch.multiarch, tool), ), - os.path.join(installation, 'metadata', 'libcapsule.txt'), + os.path.join(installation, 'bin'), ) primary_architecture = subprocess.check_output([ @@ -383,9 +352,6 @@ def main(): for package, source in ( list(DEPENDENCIES.items()) + list(PRIMARY_ARCH_DEPENDENCIES.items()) ): - if not args.libcapsuledir and source == 'libcapsule': - continue - if os.path.exists('/usr/share/doc/{}/copyright'.format(package)): installed_binaries.add(package) @@ -445,15 +411,6 @@ def main(): os.path.join(installation, 'sources'), ) - if not args.libcapsuledir: - for dsc in glob.glob( - os.path.join(args.srcdir, 'libcapsule*.dsc') - ): - v_check_call([ - 'dcmd', 'install', '-m644', dsc, - os.path.join(installation, 'sources'), - ]) - v_check_call( [ 'apt-get', diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index acb1da2451f857a76922a1721a6aeeda47a5fb2e..06737163fe0814490b45ece6d6d1fa0be10c58bd 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -117,7 +117,6 @@ pipeline { ./build-relocatable-install.py \ --srcdir . \ --builddir _build \ - --libcapsuledir /usr/lib/libcapsule/relocatable \ --output "${WORKSPACE}/relocatable-install" \ --archive "${WORKSPACE}" \ --set-version "$(cat .tarball-version)" \