move copying files into shared directory from coverage.sh to coverage.py

This commit is contained in:
Johannes Schauer Marin Rodrigues 2022-05-29 09:28:34 +02:00
parent e4ef326b59
commit c1c6297db7
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1
2 changed files with 28 additions and 75 deletions

View file

@ -76,6 +76,34 @@ def main():
)
args = parser.parse_args()
# copy over files from git or as distributed
for (git, dist, target) in [
("./mmdebstrap", "/usr/bin/mmdebstrap", "mmdebstrap"),
("./taridshift", "/usr/bin/mmtaridshift", "taridshift"),
("./tarfilter", "/usr/bin/mmtarfilter", "tarfilter"),
(
"./proxysolver",
"/usr/lib/apt/solvers/mmdebstrap-dump-solution",
"proxysolver",
),
(
"./ldconfig.fakechroot",
"/usr/libexec/mmdebstrap/ldconfig.fakechroot",
"ldconfig.fakechroot",
),
]:
if os.path.exists(git):
shutil.copy(git, f"shared/{target}")
else:
shutil.copy(dist, f"shared/{target}")
# copy over hooks from git or as distributed
if os.path.exists("hooks"):
shutil.copytree("hooks", "shared/hooks", dirs_exist_ok=True)
else:
shutil.copytree(
"/usr/share/mmdebstrap/hooks", "shared/hooks", dirs_exist_ok=True
)
onlyrun = None
if len(sys.argv) > 1:
onlyrun = sys.argv[1]

View file

@ -63,81 +63,6 @@ if [ "$notfound" -ne 0 ]; then
exit 1
fi
# only copy if necessary
if [ ! -e shared/mmdebstrap ] || [ mmdebstrap -nt shared/mmdebstrap ]; then
if [ -e ./mmdebstrap ]; then
cp -a mmdebstrap shared
else
cp -a /usr/bin/mmdebstrap shared
fi
fi
if [ ! -e shared/taridshift ] || [ taridshift -nt shared/taridshift ]; then
if [ -e ./taridshift ]; then
cp -a ./taridshift shared
else
cp -a /usr/bin/mmtaridshift shared/taridshift
fi
fi
if [ ! -e shared/tarfilter ] || [ tarfilter -nt shared/tarfilter ]; then
if [ -e ./tarfilter ]; then
cp -a tarfilter shared
else
cp -a /usr/bin/mmtarfilter shared/tarfilter
fi
fi
if [ ! -e shared/proxysolver ] || [ proxysolver -nt shared/proxysolver ]; then
if [ -e ./proxysolver ]; then
cp -a proxysolver shared
else
cp -a /usr/lib/apt/solvers/mmdebstrap-dump-solution shared/proxysolver
fi
fi
if [ ! -e shared/ldconfig.fakechroot ] || [ ldconfig.fakechroot -nt shared/ldconfig.fakechroot ]; then
if [ -e ./ldconfig.fakechroot ]; then
cp -a ldconfig.fakechroot shared
else
cp -a /usr/libexec/mmdebstrap/ldconfig.fakechroot shared/ldconfig.fakechroot
fi
fi
mkdir -p shared/hooks/merged-usr
if [ ! -e shared/hooks/merged-usr/setup00.sh ] || [ hooks/merged-usr/setup00.sh -nt shared/hooks/merged-usr/setup00.sh ]; then
if [ -e hooks/merged-usr/setup00.sh ]; then
cp -a hooks/merged-usr/setup00.sh shared/hooks/merged-usr/
else
cp -a /usr/share/mmdebstrap/hooks/merged-usr/setup00.sh shared/hooks/merged-usr/
fi
fi
mkdir -p shared/hooks/eatmydata
if [ ! -e shared/hooks/eatmydata/extract.sh ] || [ hooks/eatmydata/extract.sh -nt shared/hooks/eatmydata/extract.sh ]; then
if [ -e hooks/eatmydata/extract.sh ]; then
cp -a hooks/eatmydata/extract.sh shared/hooks/eatmydata/
else
cp -a /usr/share/mmdebstrap/hooks/eatmydata/extract.sh shared/hooks/eatmydata/
fi
fi
if [ ! -e shared/hooks/eatmydata/customize.sh ] || [ hooks/eatmydata/customize.sh -nt shared/hooks/eatmydata/customize.sh ]; then
if [ -e hooks/eatmydata/customize.sh ]; then
cp -a hooks/eatmydata/customize.sh shared/hooks/eatmydata/
else
cp -a /usr/share/mmdebstrap/hooks/eatmydata/customize.sh shared/hooks/eatmydata/
fi
fi
mkdir -p shared/hooks/file-mirror-automount
if [ ! -e shared/hooks/file-mirror-automount/setup00.sh ] || [ hooks/file-mirror-automount/setup00.sh -nt shared/hooks/file-mirror-automount/setup00.sh ]; then
if [ -e hooks/file-mirror-automount/setup00.sh ]; then
cp -a hooks/file-mirror-automount/setup00.sh shared/hooks/file-mirror-automount/
else
cp -a /usr/share/mmdebstrap/hooks/file-mirror-automount/setup00.sh shared/hooks/file-mirror-automount/
fi
fi
if [ ! -e shared/hooks/file-mirror-automount/customize00.sh ] || [ hooks/file-mirror-automount/customize00.sh -nt shared/hooks/file-mirror-automount/customize00.sh ]; then
if [ -e hooks/file-mirror-automount/customize00.sh ]; then
cp -a hooks/file-mirror-automount/customize00.sh shared/hooks/file-mirror-automount/
else
cp -a /usr/share/mmdebstrap/hooks/file-mirror-automount/customize00.sh shared/hooks/file-mirror-automount/
fi
fi
# choose the timestamp of the unstable Release file, so that we get
# reproducible results for the same mirror timestamp
SOURCE_DATE_EPOCH=$(date --date="$(grep-dctrl -s Date -n '' "$mirrordir/dists/$DEFAULT_DIST/Release")" +%s)