-
Notifications
You must be signed in to change notification settings - Fork 186
/
build-pkg-arch
78 lines (69 loc) · 3.12 KB
/
build-pkg-arch
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#
# Arch specific functions.
#
################################################################
#
# Copyright (c) 1995-2014 SUSE Linux Products GmbH
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program (see the file COPYING); if not, write to the
# Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
################################################################
pkg_initdb_arch() {
mkdir -p $BUILD_ROOT/var/lib/pacman/sync
touch $BUILD_ROOT/var/lib/pacman/sync/core.db
touch $BUILD_ROOT/var/lib/pacman/sync/extra.db
touch $BUILD_ROOT/var/lib/pacman/sync/community.db
}
pkg_prepare_arch() {
:
}
pkg_erase_arch() {
( cd $BUILD_ROOT && chroot $BUILD_ROOT pacman -R -n -d -d --noconfirm $PKG 2>&1 || touch $BUILD_ROOT/exit ) | \
perl -ne '$|=1;/^(Total Removed Size: |Packages \(\d+\):|:: Do you want to remove these packages|deleting |removing | )/||/^$/||print'
}
pkg_verify_installed_arch() {
return 1
}
pkg_cumulate_arch() {
return 1
}
pkg_install_arch() {
# Pacman can't handle chroot
# https://bbs.archlinux.org/viewtopic.php?id=129661
(cd $BUILD_ROOT/etc && sed -i -e "s/^CheckSpace/#CheckSpace/g" -e "s/^DownloadUser/#DownloadUser/" pacman.conf)
# -d -d disables deps checking
( cd $BUILD_ROOT && chroot $BUILD_ROOT pacman -U --overwrite '*' -d -d --noconfirm .init_b_cache/$PKG.$PSUF 2>&1 || touch $BUILD_ROOT/exit ) | \
perl -ne '$|=1;/^(warning: could not get filesystem information for |loading packages|looking for inter-conflicts|looking for conflicting packages|Targets |Total Installed Size: |Net Upgrade Size: |Proceed with installation|checking package integrity|loading package files|checking for file conflicts|checking keyring|Packages \(\d+\)|:: Proceed with installation|:: Processing package changes|checking available disk space|installing |upgrading |warning:.*is up to date -- reinstalling|Optional dependencies for| )/||/^$/||print'
}
pkg_finalize_arch() {
:
}
pkg_preinstall_arch() {
mkdir -p "$BUILD_INIT_CACHE/scripts"
$TAR < "$BUILD_INIT_CACHE/rpms/$PKG.arch"
rm -rf "$BUILD_INIT_CACHE/scripts/$PKG.post"
if test -e "$BUILD_INIT_CACHE/scripts/$PKG.run" -a -f .INSTALL -a ! -L .INSTALL ; then
cat .INSTALL > "$BUILD_INIT_CACHE/scripts/$PKG.post"
echo 'type post_install >/dev/null 2>&1 && post_install' >> "$BUILD_INIT_CACHE/scripts/$PKG.post"
fi
rm -rf .PKGINFO .INSTALL
}
pkg_runscripts_arch() {
if test -e "$BUILD_INIT_CACHE/scripts/$PKG.post" ; then
echo "running $PKG postinstall script"
( cd $BUILD_ROOT && chroot $BUILD_ROOT ".init_b_cache/scripts/$PKG.post" < /dev/null )
rm -f "$BUILD_INIT_CACHE/scripts/$PKG.post"
fi
}