Commit 9e660ee8 authored by Armin Luntzer's avatar Armin Luntzer Committed by Jason Chu
Browse files

mkarchroot: add -M switch for a custom makepkg.conf



Signed-off-by: default avatarJason Chu <jchu@xentac.net>
parent 06a0d18b
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -24,16 +24,18 @@ usage ()
    echo "    -u            Update the chroot via pacman"
    echo "    -f            Force overwrite of files in the working-dir"
    echo "    -C <file>     location of a pacman config file"
    echo "    -M <file>     location of a makepkg config file"
    echo "    -h            This message"
    exit $1
}

while getopts 'r:ufhC:' arg; do
while getopts 'r:ufhC:M:' arg; do
    case "${arg}" in
        r) RUN="$OPTARG" ;;
        u) RUN="pacman -Syu" ;;
        f) FORCE="y" ;;
        C) pac_conf="$OPTARG" ;;
        M) makepkg_conf="$OPTARG" ;;
        h|?) usage 0 ;;
        *) echo "invalid argument '${arg}'"; usage 1 ;;
    esac
@@ -156,6 +158,12 @@ else
        cp ${pac_conf} ${working_dir}/etc/pacman.conf
    fi

    if [ "$makepkg_conf" != "" ]; then
        echo "installing custom makepkg.conf"
        cp ${makepkg_conf} ${working_dir}/etc/makepkg.conf
    fi


    echo "generating default locales"
    sed -i "s|^#\(.*$LANG\)|\1|g" "${working_dir}/etc/locale.gen"
    chroot "${working_dir}" locale-gen