3
# Copyright (C) 2017-2018, 2020 Etersoft
4
# Copyright (C) 2017-2018, 2020 Vitaly Lipatov <lav@etersoft.ru>
6
# This program is free software: you can redistribute it and/or modify
7
# it under the terms of the GNU Affero General Public License as published by
8
# the Free Software Foundation, either version 3 of the License, or
9
# (at your option) any later version.
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU Affero General Public License for more details.
16
# You should have received a copy of the GNU Affero General Public License
17
# along with this program. If not, see <http://www.gnu.org/licenses/>.
28
assure_exists fakeroot
34
TDIR="$(mktemp -d --tmpdir=$BIGTMPDIR)" || fatal
40
abspkg="$(realpath "$pkg")"
41
info "Repacking $abspkg to local deb format (inside $TDIR) ..."
43
alpkg=$(basename $pkg)
44
# don't use abs package path: copy package to temp dir and use there
45
cp $verbose $pkg $TDIR/$alpkg
48
__prepare_source_package "$pkg"
50
showcmd_store_output fakeroot alien -d -k $scripts "$alpkg"
51
local DEBCONVERTED=$(grep "deb generated" $RC_STDOUT | sed -e "s| generated||g")
52
if [ -n "$DEBCONVERTED" ] ; then
53
repacked_pkgs="$repacked_pkgs $(realpath $DEBCONVERTED)"
54
remove_on_exit "$(realpath $DEBCONVERTED)"