Skip to content
Snippets Groups Projects
Commit 5dc71175 authored by Simon McVittie's avatar Simon McVittie
Browse files

build-relocatable-install: Get libcapsule from apt or installed packages

parent 4fc4e695
No related branches found
No related tags found
No related merge requests found
...@@ -53,7 +53,6 @@ build:scout: ...@@ -53,7 +53,6 @@ build:scout:
./build-relocatable-install.py \ ./build-relocatable-install.py \
--srcdir . \ --srcdir . \
--builddir _build \ --builddir _build \
--libcapsuledir /usr/lib/libcapsule/relocatable \
--output _build/relocatable-install \ --output _build/relocatable-install \
--archive "$(pwd)/_build" \ --archive "$(pwd)/_build" \
--set-version "$(cat .tarball-version)" \ --set-version "$(cat .tarball-version)" \
......
...@@ -157,7 +157,6 @@ Then you can do: ...@@ -157,7 +157,6 @@ Then you can do:
./build-relocatable-install.py \ ./build-relocatable-install.py \
--srcdir . \ --srcdir . \
--builddir _build \ --builddir _build \
--libcapsuledir /usr/lib/libcapsule/relocatable \
--output _build/relocatable-install \ --output _build/relocatable-install \
--archive . --archive .
./tests/relocatable-install.py _build/relocatable-install # optional ./tests/relocatable-install.py _build/relocatable-install # optional
......
...@@ -100,7 +100,7 @@ SCRIPTS = [ ...@@ -100,7 +100,7 @@ SCRIPTS = [
EXECUTABLES = [ EXECUTABLES = [
'pressure-vessel-wrap' 'pressure-vessel-wrap'
] ]
TOOLS = [ LIBCAPSULE_TOOLS = [
'capsule-capture-libs', 'capsule-capture-libs',
'capsule-symbols', 'capsule-symbols',
] ]
...@@ -144,7 +144,6 @@ def main(): ...@@ -144,7 +144,6 @@ def main():
parser.add_argument('--prefix', default=None) parser.add_argument('--prefix', default=None)
parser.add_argument('--output', '-o', default=None) parser.add_argument('--output', '-o', default=None)
parser.add_argument('--archive', default=None) parser.add_argument('--archive', default=None)
parser.add_argument('--libcapsuledir', default='')
parser.add_argument('--set-version', dest='version', default='unknown') parser.add_argument('--set-version', dest='version', default='unknown')
args = parser.parse_args() args = parser.parse_args()
...@@ -211,64 +210,34 @@ def main(): ...@@ -211,64 +210,34 @@ def main():
0o644, 0o644,
) )
if args.libcapsuledir: for arch in ARCHS:
for arch in ARCHS: path = '/usr/lib/libcapsule/relocatable/{}-{}'.format(
for tool in TOOLS: arch.multiarch,
install_exe( LIBCAPSULE_TOOLS[0],
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'),
) )
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( os.path.join(
args.builddir, os.path.dirname(path),
'libcapsule', '{}-{}'.format(arch.multiarch, tool),
'debian',
'copyright',
), ),
os.path.join(installation, 'metadata', 'libcapsule.txt'), os.path.join(installation, 'bin'),
) )
primary_architecture = subprocess.check_output([ primary_architecture = subprocess.check_output([
...@@ -383,9 +352,6 @@ def main(): ...@@ -383,9 +352,6 @@ def main():
for package, source in ( for package, source in (
list(DEPENDENCIES.items()) + list(PRIMARY_ARCH_DEPENDENCIES.items()) 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)): if os.path.exists('/usr/share/doc/{}/copyright'.format(package)):
installed_binaries.add(package) installed_binaries.add(package)
...@@ -445,15 +411,6 @@ def main(): ...@@ -445,15 +411,6 @@ def main():
os.path.join(installation, 'sources'), 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( v_check_call(
[ [
'apt-get', 'apt-get',
......
...@@ -117,7 +117,6 @@ pipeline { ...@@ -117,7 +117,6 @@ pipeline {
./build-relocatable-install.py \ ./build-relocatable-install.py \
--srcdir . \ --srcdir . \
--builddir _build \ --builddir _build \
--libcapsuledir /usr/lib/libcapsule/relocatable \
--output "${WORKSPACE}/relocatable-install" \ --output "${WORKSPACE}/relocatable-install" \
--archive "${WORKSPACE}" \ --archive "${WORKSPACE}" \
--set-version "$(cat .tarball-version)" \ --set-version "$(cat .tarball-version)" \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment