File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ RUN apt install -y build-essential pbuilder fakeroot fakechroot
2525RUN echo 'MIRRORSITE=http://deb.debian.org/debian' > /etc/pbuilderrc
2626RUN echo 'AUTO_DEBSIGN=${AUTO_DEBSIGN:-no}' > /root/.pbuilderrc
2727RUN echo 'HOOKDIR=/var/cache/pbuilder/hooks' >> /root/.pbuilderrc
28- RUN --security=insecure pbuilder create # --components "main contrib-non-free"
28+ RUN --security=insecure pbuilder create
2929
3030COPY pbuilder_install_script.sh /root/pbuilder_install_script.sh
3131RUN --security=insecure pbuilder execute --save-after-exec /root/pbuilder_install_script.sh
Original file line number Diff line number Diff line change @@ -74,6 +74,19 @@ def run_build
7474 exit ( 1 ) if $?. to_i > 0
7575
7676 cmds = [ ]
77+
78+ # This line prevents clean-up after pbuilder finishes. There's no option
79+ # in pbuilder to do it, so we have to patch it manually. The issue is
80+ # with pbuilder not being able to delete some directories (presumably,
81+ # due to directory names starting with ".") and returning error.
82+ #
83+ # This little patch avoids the error by returning from the python cleanup
84+ # function early -- because the package itself is built successfully and
85+ # we don't actually care that pbuilder is unable to clean something up.
86+ # The container is going to be removed anyway, so it's even less work as
87+ # a result.
88+ cmds << "sed -E -i \" s/(^function clean_subdirectories.*$)/\\ 1\\ n return/g\" /usr/lib/pbuilder/pbuilder-modules"
89+
7790 cmds << "dpkg-buildpackage --build=source -d" # -d flag helps with dependencies error
7891 cmds << "fakeroot pbuilder build ../#{ dsc_fn } "
7992 cmds << "mv /var/cache/pbuilder/result/#{ deb_fn } /root/pgpm/out/"
You can’t perform that action at this time.
0 commit comments