Skip to content

Commit aec34f8

Browse files
committed
Allow import of extra Debian files
Can be used to configure, e.g., postinst, postrm files.
1 parent 6f141c0 commit aec34f8

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

ldnp/deb.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import glob
22
import math
33
import os
4+
import shutil
45

56
from pathlib import Path
67

@@ -72,6 +73,14 @@ def get_size(path: str | os.PathLike):
7273
with open(control_path, "w") as f:
7374
f.write(rendered)
7475

76+
# support pre/post install hooks
77+
extra_debian_files = os.environ.get("LDNP_DEB_EXTRA_DEBIAN_FILES")
78+
if extra_debian_files:
79+
for path in map(Path, extra_debian_files.split(";")):
80+
target_path = debian_dir / path.name
81+
logger.info(f"Deploying extra debian file {path} to {target_path}")
82+
shutil.copy(path, target_path)
83+
7584
def generate_shlibs_file(self):
7685
# FIXME: shlibs
7786
# # TODO: make shlibs configurable

0 commit comments

Comments
 (0)