-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrun_dpkg.sh
executable file
·52 lines (44 loc) · 1.45 KB
/
run_dpkg.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
set -ex
if [ ${BUILD_SOURCES_PATH} != "/dbuilder/build" ]; then
cp -r ${BUILD_SOURCES_PATH}/. -t /dbuilder/build/
fi
cd /dbuilder/build/${DBUILDER_SUBDIR}
# if some deb files exist in additional_packages directory, we create a trivial
# local repository
preinstall_debs=`find /dbuilder/additional_packages/ -name \*.deb`
if [ -n "${preinstall_debs}" ]; then
repo_path=/dbuilder/local_repository
mkdir ${repo_path}
cp ${preinstall_debs} ${repo_path}
pushd ${repo_path}
dpkg-scanpackages . > Packages
popd
echo "deb file:${repo_path} ./" > /etc/apt/sources.list.d/local_repo.list
# if pin-priority is defined, propagate it
if [ -n "${LOCAL_REPO_PRIORITY}" ]; then
echo -e "Package: *\nPin: origin \"\"\nPin-Priority: ${LOCAL_REPO_PRIORITY}" \
> /etc/apt/preferences.d/local_repo
fi
unset repo_path
fi
unset preinstall_debs
apt-get update
# preinstall hooks
if [ -d /dbuilder/preinstall.d ]; then
for file in `find /dbuilder/preinstall.d -executable -type f | sort -n`; do
${file}
done
unset file
fi
mk-build-deps -i -r -t 'apt-get -f -y --force-yes'
${DBUILDER_BUILD_CMD}
# postinstall hooks
if [ -d /dbuilder/postinstall.d ]; then
for file in `find /dbuilder/postinstall.d -executable -type f | sort -n`; do
${file}
done
unset file
fi
chmod 644 ${BUILD_PACKAGES_FILE_PATH}*.deb
cp ${BUILD_PACKAGES_FILE_PATH}*.deb ${BUILD_SOURCES_PATH}/${DBUILDER_SUBDIR}