aboutsummaryrefslogtreecommitdiff
path: root/xbps-mini-builder
blob: f761fcc38407f595a99f625b7827a2ac17447582 (plain) (blame)
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
#!/bin/sh

# Do we have keys to sign with?
if [ ! -f id_rsa ] || [ ! -f id_rsa.pub ] ; then
    rm -rf id_rsa id_rsa.pub
    ssh-keygen -t rsa -N "" -C -f id_rsa
fi

mkdir -p void-packages
cd void-packages

# Do we actually have the repo yet?
if [ ! -d srcpkgs ] ; then
    # No, clone a fresh copy
    git clone https://github.com/voidlinux/void-packages .
else
    # Yes, pull in the changes for this run
    git pull
fi

# Does this system use another set of repos
if [ -d /etc/xbps.d ] ; then
    cat /etc/xbps.d/* > etc/repos-remote.conf
    # If this platform is 64 bit, override those as well
    if [ "$(xbps-uhelper arch)"="x86_64" ] ; then
	cat /etc/xbps.d/* > etc/repos-remote-x86_64.conf
    fi

    # The bootstrap config is loaded seperately
    if [ -f /etc/xbps.d/00-repository-main.conf ] ; then
	repo="$(cat /etc/xbps.d/00-repository-main.conf | sed 's/^.*=//')"
	printf 'XBPS_INSTALL_ARGS="--repository=%s --repository=%s/musl"\n' ${repo} ${repo} > etc/conf
    fi
fi

# Do we have a live build environment
if [ ! -d masterdir ] ; then
    # No masterdir, go ahead and bootstrap it
    ./xbps-src binary-bootstrap
fi

# Apply provided config file if it exists
if [ -f ../xbps-mini-builder.conf ] ; then
    cat ../xbps-mini-builder.conf >> etc/conf
fi

# Main builder section
packages="$(cat ../packages.list)"
xbulk ${packages}