NBash

Форк
0
61 строка · 1.8 Кб
1
#!/bin/sh
2
#
3
# Copyright (C) 2017-2018, 2020  Etersoft
4
# Copyright (C) 2017-2018, 2020  Vitaly Lipatov <lav@etersoft.ru>
5
#
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.
10
#
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.
15
#
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/>.
18
#
19

20

21
# fills repacked_pkgs
22
__epm_repack_to_deb()
23
{
24
    local pkg
25
    local pkgs="$*"
26

27
    assure_exists alien
28
    assure_exists fakeroot
29
    assure_exists rpm
30

31
    repacked_pkgs=''
32

33
    local TDIR
34
    TDIR="$(mktemp -d --tmpdir=$BIGTMPDIR)" || fatal
35
    remove_on_exit $TDIR
36

37
    umask 022
38

39
    for pkg in $pkgs ; do
40
        abspkg="$(realpath "$pkg")"
41
        info "Repacking $abspkg to local deb format (inside $TDIR) ..."
42

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
46

47
        cd $TDIR || fatal
48
        __prepare_source_package "$pkg"
49

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)"
55
        fi
56
        clean_store_output
57
        cd - >/dev/null
58
    done
59

60
    return 0
61
}
62

63

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.