Commit f2d646b3 authored by udeved's avatar udeved

Merge branch 'master' of github.com:manjaro/manjaro-tools into stable-0.13.x

parents b4389f1c e3ce3e27
......@@ -64,18 +64,15 @@ LIST_ISO = \
BIN_ISO = \
bin/buildiso \
bin/testiso \
bin/deployiso \
bin/check-yaml
bin/deployiso
LIBS_ISO = \
lib/util-iso.sh \
lib/util-iso-aufs.sh \
lib/util-iso-overlayfs.sh \
lib/util-iso-image.sh \
lib/util-iso-calamares.sh \
lib/util-iso-boot.sh \
lib/util-publish.sh \
lib/util-iso-yaml.sh
lib/util-publish.sh
SHARED_ISO = \
data/pacman-mhwd.conf \
......@@ -106,7 +103,43 @@ MAN_XML = \
manjaro-tools.conf.xml \
profile.conf.xml
all: $(BIN_BASE) $(BIN_PKG) $(BIN_ISO) doc
BIN_YAML = \
bin/check-yaml
LIBS_YAML = \
lib/util-yaml.sh
SHARED_YAML = \
data/schemas/bootloader.schema.yaml \
data/schemas/chrootcfg.schema.yaml \
data/schemas/displaymanager.schema.yaml \
data/schemas/finished.schema.yaml \
data/schemas/fstab.schema.yaml \
data/schemas/grubcfg.schema.yaml \
data/schemas/initcpio.schema.yaml \
data/schemas/keyboard.schema.yaml \
data/schemas/license.schema.yaml \
data/schemas/locale.schema.yaml \
data/schemas/luksopenswaphookcfg.schema.yaml \
data/schemas/machineid.schema.yaml \
data/schemas/mhwdcfg.schema.yaml \
data/schemas/mount.schema.yaml \
data/schemas/netgroups.schema.yaml \
data/schemas/netinstall.schema.yaml \
data/schemas/packages.schema.yaml \
data/schemas/partition.schema.yaml \
data/schemas/plymouthcfg.schema.yaml \
data/schemas/postcfg.schema.yaml \
data/schemas/removeuser.schema.yaml \
data/schemas/services.schema.yaml \
data/schemas/servicescfg.schema.yaml \
data/schemas/settings.schema.yaml \
data/schemas/umount.schema.yaml \
data/schemas/unpackfs.schema.yaml \
data/schemas/users.schema.yaml \
data/schemas/welcome.schema.yaml
all: $(BIN_BASE) $(BIN_PKG) $(BIN_ISO) $(BIN_YAML) doc
edit = sed -e "s|@datadir[@]|$(DESTDIR)$(PREFIX)/share/manjaro-tools|g" \
-e "s|@sysconfdir[@]|$(DESTDIR)$(SYSCONFDIR)/manjaro-tools|g" \
......@@ -190,6 +223,16 @@ install_iso:
gzip -c man/manjaro-tools.conf.5 > $(DESTDIR)$(PREFIX)/share/man/man5/manjaro-tools.conf.5.gz
gzip -c man/profile.conf.5 > $(DESTDIR)$(PREFIX)/share/man/man5/profile.conf.5.gz
install_yaml:
install -dm0755 $(DESTDIR)$(PREFIX)/bin
install -m0755 ${BIN_YAML} $(DESTDIR)$(PREFIX)/bin
install -dm0755 $(DESTDIR)$(PREFIX)/lib/manjaro-tools
install -m0644 ${LIBS_YAML} $(DESTDIR)$(PREFIX)/lib/manjaro-tools
install -dm0755 $(DESTDIR)$(PREFIX)/share/manjaro-tools/schemas
install -m0644 ${SHARED_YAML} $(DESTDIR)$(PREFIX)/share/manjaro-tools/schemas
uninstall_base:
for f in ${SYSCONF}; do rm -f $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/$$f; done
for f in ${BIN_BASE}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
......@@ -210,6 +253,7 @@ uninstall_iso:
for f in ${LIST_ISO}; do rm -f $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/iso.list.d/$$f; done
for f in ${BIN_ISO}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
for f in ${SHARED_ISO}; do rm -f $(DESTDIR)$(PREFIX)/share/manjaro-tools/$$f; done
for f in ${LIBS_ISO}; do rm -f $(DESTDIR)$(PREFIX)/lib/manjaro-tools/$$f; done
for f in ${CPIOHOOKS}; do rm -f $(DESTDIR)$(PREFIX)/lib/initcpio/hooks/$$f; done
for f in ${CPIOINST}; do rm -f $(DESTDIR)$(PREFIX)/lib/initcpio/install/$$f; done
......@@ -218,9 +262,14 @@ uninstall_iso:
rm -f $(DESTDIR)$(PREFIX)/share/man/man5/manjaro-tools.conf.5.gz
rm -f $(DESTDIR)$(PREFIX)/share/man/man5/profile.conf.5.gz
install: install_base install_pkg install_iso
uninstall_yaml:
for f in ${BIN_YAML}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
for f in ${LIBS_YAML}; do rm -f $(DESTDIR)$(PREFIX)/lib/manjaro-tools/$$f; done
for f in ${SHARED_YAML}; do rm -f $(DESTDIR)$(PREFIX)/share/manjaro-tools/schemas/$$f; done
install: install_base install_pkg install_iso install_yaml
uninstall: uninstall_base uninstall_pkg uninstall_iso
uninstall: uninstall_base uninstall_pkg uninstall_iso uninstall_yaml
dist:
git archive --format=tar --prefix=manjaro-tools-$(Version)/ $(Version) | gzip -9 > manjaro-tools-$(Version).tar.gz
......
......@@ -28,19 +28,19 @@ copymirrorlist=true
usage() {
echo "usage: ${0##*/} [options] root [packages...]"
echo " -C config Use an alternate config file for pacman"
echo " -c Use the package cache on the host, rather than the target"
echo " -d Allow installation to a non-mountpoint directory"
echo " -G Avoid copying the host's pacman keyring to the target"
echo " -i Avoid auto-confirmation of package selections"
echo " -M Avoid copying the host's mirrorlist to the target"
echo " -h Print this help message"
echo ''
echo ' basestrap installs packages to the specified new root directory.'
echo ' If no packages are given, basestrap defaults to the "base" group.'
echo ''
echo ''
exit $1
echo " -C config Use an alternate config file for pacman"
echo " -c Use the package cache on the host, rather than the target"
echo " -d Allow installation to a non-mountpoint directory"
echo " -G Avoid copying the host's pacman keyring to the target"
echo " -i Avoid auto-confirmation of package selections"
echo " -M Avoid copying the host's mirrorlist to the target"
echo " -h Print this help message"
echo ''
echo ' basestrap installs packages to the specified new root directory.'
echo ' If no packages are given, basestrap defaults to the "base" group.'
echo ''
echo ''
exit $1
}
# if [[ -z $1 || $1 = @(-h|--help) ]]; then
......@@ -54,16 +54,16 @@ orig_argv=("$@")
opts=':C:cdGiM'
while getopts ${opts} arg; do
case "${arg}" in
C) pacman_config=$OPTARG ;;
d) directory=true ;;
c) hostcache=true ;;
i) interactive=true ;;
G) copykeyring=false ;;
M) copymirrorlist=false ;;
:) echo "invalid argument ${arg}:$OPTARG"; usage 1;;
?) usage 0 ;;
esac
case "${arg}" in
C) pacman_config=$OPTARG ;;
d) directory=true ;;
c) hostcache=true ;;
i) interactive=true ;;
G) copykeyring=false ;;
M) copymirrorlist=false ;;
:) echo "invalid argument ${arg}:$OPTARG"; usage 1;;
?) usage 0 ;;
esac
done
shift $(( OPTIND - 1 ))
......@@ -82,7 +82,7 @@ ${interactive} && pacman_args+=(--noconfirm)
[[ -d $newroot ]] || die "%s is not a directory" "$newroot"
if ! mountpoint -q "$newroot" && ! ${directory}; then
die '%s is not a mountpoint!' "$newroot"
die '%s is not a mountpoint!' "$newroot"
fi
# create obligatory directories
......@@ -93,17 +93,17 @@ chroot_api_mount "$newroot" || die "failed to setup API filesystems in new root"
msg2 'Installing packages to %s' "$newroot"
if ! pacman -r "$newroot" -Sy "${pacman_args[@]}"; then
die 'Failed to install packages to new root'
die 'Failed to install packages to new root'
fi
# kill chroot process if needed (TODO: check if needed at all)
kill_chroot_process "$newroot"
if ${copykeyring};then
copy_keyring "$newroot"
copy_keyring "$newroot"
fi
if ${copymirrorlist};then
copy_mirrorlist "$newroot"
copy_mirrorlist "$newroot"
fi
This diff is collapsed.
......@@ -23,52 +23,52 @@ import ${LIBDIR}/util.sh
import ${LIBDIR}/util-pkg.sh
show_pkg(){
check_build "$1"
cd $1
source PKGBUILD
for n in ${pkgname[@]}; do
msg2 "%s" "$n"
done
cd ..
check_build "$1"
cd $1
source PKGBUILD
for n in ${pkgname[@]}; do
msg2 "%s" "$n"
done
cd ..
}
display_settings(){
show_version
show_config
msg "PROFILE:"
msg2 "list_dir_pkg: %s" "${list_dir_pkg}"
msg2 "build_lists: %s" "$(show_build_lists ${list_dir_pkg})"
msg2 "build_list_pkg: %s" "${build_list_pkg}"
msg2 "is_build_list: %s" "${is_build_list}"
msg2 "build_mirror: %s" "${build_mirror}/${target_branch}"
show_version
show_config
msg "PROFILE:"
msg2 "list_dir_pkg: %s" "${list_dir_pkg}"
msg2 "build_lists: %s" "$(show_build_lists ${list_dir_pkg})"
msg2 "build_list_pkg: %s" "${build_list_pkg}"
msg2 "is_build_list: %s" "${is_build_list}"
msg2 "build_mirror: %s" "${build_mirror}/${target_branch}"
# msg2 "make_conf_dir: %s" "${make_conf_dir}"
# msg2 "build_profiles: %s" "$(show_build_profiles ${make_conf_dir})"
msg "OPTIONS:"
msg2 "arch: %s" "${target_arch}"
msg2 "branch: %s" "${target_branch}"
msg2 "chroots_pkg: %s" "${chroots_pkg}"
msg "OPTIONS:"
msg2 "arch: %s" "${target_arch}"
msg2 "branch: %s" "${target_branch}"
msg2 "chroots_pkg: %s" "${chroots_pkg}"
msg "ARGS:"
msg2 "clean_first: %s" "${clean_first}"
msg2 "wipe_clean: %s" "${wipe_clean}"
msg2 "namcap: %s" "${namcap}"
msg2 "sign: %s" "${sign}"
msg2 "udev_root: %s" "${udev_root}"
msg "ARGS:"
msg2 "clean_first: %s" "${clean_first}"
msg2 "wipe_clean: %s" "${wipe_clean}"
msg2 "namcap: %s" "${namcap}"
msg2 "sign: %s" "${sign}"
msg2 "udev_root: %s" "${udev_root}"
msg "PATHS:"
msg2 "work_dir: %s" "${work_dir}"
msg2 "pkg_dir: %s" "${pkg_dir}"
msg "PATHS:"
msg2 "work_dir: %s" "${work_dir}"
msg2 "pkg_dir: %s" "${pkg_dir}"
if ${clean_first};then
msg "PKG:"
msg2 "base_packages: %s" "${base_packages[*]}"
fi
if ${clean_first};then
msg "PKG:"
msg2 "base_packages: %s" "${base_packages[*]}"
fi
msg "BUILD QUEUE:"
run show_pkg "${build_list_pkg}"
msg "BUILD QUEUE:"
run show_pkg "${build_list_pkg}"
}
load_user_info
......@@ -88,23 +88,23 @@ udev_root=false
is_multilib=false
usage() {
echo "Usage: ${0##*/} [options]"
echo " -p <pkg> Build list or pkg [default: ${build_list_pkg}]"
echo " -a <arch> Arch [default: ${target_arch}]"
echo " -b <branch> Branch [default: ${target_branch}]"
echo ' -r <dir> Chroots directory'
echo " [default: ${chroots_pkg}]"
echo ' -i <pkg> Install a package into the working copy of the chroot'
echo ' -c Recreate chroot'
echo ' -w Clean up cache and sources'
echo ' -n Install and run namcap check'
echo ' -s Sign packages'
echo ' -u Udev base-devel group (no systemd)'
echo ' -q Query settings and pretend build'
echo ' -h This help'
echo ''
echo ''
exit $1
echo "Usage: ${0##*/} [options]"
echo " -p <pkg> Build list or pkg [default: ${build_list_pkg}]"
echo " -a <arch> Arch [default: ${target_arch}]"
echo " -b <branch> Branch [default: ${target_branch}]"
echo ' -r <dir> Chroots directory'
echo " [default: ${chroots_pkg}]"
echo ' -i <pkg> Install a package into the working copy of the chroot'
echo ' -c Recreate chroot'
echo ' -w Clean up cache and sources'
echo ' -n Install and run namcap check'
echo ' -s Sign packages'
echo ' -u Udev base-devel group (no systemd)'
echo ' -q Query settings and pretend build'
echo ' -h This help'
echo ''
echo ''
exit $1
}
orig_argv=("$@")
......@@ -112,21 +112,21 @@ orig_argv=("$@")
opts='p:a:b:r:i:cwnsuqh'
while getopts "${opts}" arg; do
case "${arg}" in
p) build_list_pkg="$OPTARG" ;;
a) target_arch="$OPTARG" ;;
b) target_branch="$OPTARG" ;;
r) chroots_pkg="$OPTARG" ;;
i) install_pkgs+="$OPTARG"; mkchrootpkg_args+=(-I ${install_pkgs[*]}) ;;
c) clean_first=true ;;
w) wipe_clean=true ;;
n) namcap=true; mkchrootpkg_args+=(-n) ;;
s) sign=true ;;
u) udev_root=true ;;
q) pretend=true ;;
h|?) usage 0 ;;
*) echo "invalid argument '${arg}'"; usage 1 ;;
esac
case "${arg}" in
p) build_list_pkg="$OPTARG" ;;
a) target_arch="$OPTARG" ;;
b) target_branch="$OPTARG" ;;
r) chroots_pkg="$OPTARG" ;;
i) install_pkgs+="$OPTARG"; mkchrootpkg_args+=(-I ${install_pkgs[*]}) ;;
c) clean_first=true ;;
w) wipe_clean=true ;;
n) namcap=true; mkchrootpkg_args+=(-n) ;;
s) sign=true ;;
u) udev_root=true ;;
q) pretend=true ;;
h|?) usage 0 ;;
*) echo "invalid argument '${arg}'"; usage 1 ;;
esac
done
shift $(($OPTIND - 1))
......@@ -151,7 +151,7 @@ eval_build_list "${list_dir_pkg}" "${build_list_pkg}"
prepare_dir "${pkg_dir}"
chown ${OWNER}:$(id --group ${OWNER}) "${pkg_dir}"
user_own "${pkg_dir}"
init_base_devel
......
......@@ -19,19 +19,19 @@ import ${LIBDIR}/util.sh
import ${LIBDIR}/util-pkgtree.sh
display_settings(){
show_version
show_config
msg "ARGS:"
msg2 "sync: %s" "${sync}"
msg2 "abs: %s" "${abs}"
msg2 "clean: %s" "${clean}"
msg "PATHS:"
msg2 "tree_dir: %s" "${tree_dir}"
msg2 "repo_tree: %s" "${repo_tree[*]}"
msg2 "host_tree: %s" "${host_tree}"
msg2 "host_tree_abs: %s" "${host_tree_abs}"
show_version
show_config
msg "ARGS:"
msg2 "sync: %s" "${sync}"
msg2 "abs: %s" "${abs}"
msg2 "clean: %s" "${clean}"
msg "PATHS:"
msg2 "tree_dir: %s" "${tree_dir}"
msg2 "repo_tree: %s" "${repo_tree[*]}"
msg2 "host_tree: %s" "${host_tree}"
msg2 "host_tree_abs: %s" "${host_tree_abs}"
}
load_user_info
......@@ -44,15 +44,15 @@ abs=false
clean=false
usage() {
echo "Usage: ${0##*/} [options]"
echo " -s Sync manjaro tree"
echo " -a Sync arch abs"
echo ' -c Clean package tree'
echo ' -q Query settings'
echo ' -h This help'
echo ''
echo ''
exit $1
echo "Usage: ${0##*/} [options]"
echo " -s Sync manjaro tree"
echo " -a Sync arch abs"
echo ' -c Clean package tree'
echo ' -q Query settings'
echo ' -h This help'
echo ''
echo ''
exit $1
}
orig_argv=("$@")
......@@ -60,14 +60,14 @@ orig_argv=("$@")
opts='sacqh'
while getopts "${opts}" arg; do
case "${arg}" in
s) sync=true ;;
a) abs=true ;;
c) clean=true ;;
q) pretend=true ;;
h|?) usage 0 ;;
*) echo "invalid argument '${arg}'"; usage 1 ;;
esac
case "${arg}" in
s) sync=true ;;
a) abs=true ;;
c) clean=true ;;
q) pretend=true ;;
h|?) usage 0 ;;
*) echo "invalid argument '${arg}'"; usage 1 ;;
esac
done
shift $(($OPTIND - 1))
......
......@@ -18,68 +18,68 @@ SYSCONFDIR='@sysconfdir@'
[[ -r ${LIBDIR}/util-msg.sh ]] && source ${LIBDIR}/util-msg.sh
import ${LIBDIR}/util.sh
import ${LIBDIR}/util-iso-yaml.sh
import ${LIBDIR}/util-yaml.sh
show_profile(){
prepare_check "$1"
msg2 "yaml_dir: %s" "${yaml_dir}"
msg2 "nonfree_mhwd: %s" "${nonfree_mhwd}"
msg2 "autologin: %s" "${autologin}"
msg2 "nonfree_mhwd: %s" "${nonfree_mhwd}"
msg2 "pxe_boot: %s" "${pxe_boot}"
msg2 "plymouth_boot: %s" "${plymouth_boot}"
${plymouth_boot} && msg2 "plymouth_theme: %s" "${plymouth_theme}"
[[ ${target_arch} == 'x86_64' ]] && msg2 "multilib: %s" "${multilib}"
msg2 "netinstall: %s" "${netinstall}"
${netinstall} && msg2 "netgroups: %s" "$(get_yaml)"
msg2 "unpackfs: %s" "${unpackfs}"
msg2 "efi_boot_loader: %s" "${efi_boot_loader}"
msg2 "hostname: %s" "${hostname}"
msg2 "username: %s" "${username}"
msg2 "password: %s" "${password}"
msg2 "login_shell: %s" "${login_shell}"
msg2 "addgroups: %s" "${addgroups}"
if [[ ${initsys} == 'systemd' ]];then
msg2 "enable_systemd: %s" "${enable_systemd[*]}"
msg2 "enable_systemd_live: %s" "${enable_systemd_live[*]}"
[[ -n ${disable_systemd[*]} ]] && msg2 "disable_systemd: %s" "${disable_systemd[*]}"
else
msg2 "enable_openrc: %s" "${enable_openrc[*]}"
msg2 "enable_openrc_live: %s" "${enable_openrc_live[*]}"
[[ -n ${disable_openrc[*]} ]] && msg2 "disable_openrc: %s" "${disable_openrc[*]}"
fi
reset_profile
unset yaml_dir
prepare_check "$1"
msg2 "yaml_dir: %s" "${yaml_dir}"
msg2 "nonfree_mhwd: %s" "${nonfree_mhwd}"
msg2 "autologin: %s" "${autologin}"
msg2 "nonfree_mhwd: %s" "${nonfree_mhwd}"
msg2 "pxe_boot: %s" "${pxe_boot}"
msg2 "plymouth_boot: %s" "${plymouth_boot}"
${plymouth_boot} && msg2 "plymouth_theme: %s" "${plymouth_theme}"
[[ ${target_arch} == 'x86_64' ]] && msg2 "multilib: %s" "${multilib}"
msg2 "netinstall: %s" "${netinstall}"
${netinstall} && msg2 "netgroups: %s" "$(get_yaml)"
msg2 "unpackfs: %s" "${unpackfs}"
msg2 "efi_boot_loader: %s" "${efi_boot_loader}"
msg2 "hostname: %s" "${hostname}"
msg2 "username: %s" "${username}"
msg2 "password: %s" "${password}"
msg2 "login_shell: %s" "${login_shell}"
msg2 "addgroups: %s" "${addgroups}"
if [[ ${initsys} == 'systemd' ]];then
msg2 "enable_systemd: %s" "${enable_systemd[*]}"
msg2 "enable_systemd_live: %s" "${enable_systemd_live[*]}"
[[ -n ${disable_systemd[*]} ]] && msg2 "disable_systemd: %s" "${disable_systemd[*]}"
else
msg2 "enable_openrc: %s" "${enable_openrc[*]}"
msg2 "enable_openrc_live: %s" "${enable_openrc_live[*]}"
[[ -n ${disable_openrc[*]} ]] && msg2 "disable_openrc: %s" "${disable_openrc[*]}"
fi
reset_profile
unset yaml_dir
}
display_settings(){
show_version
show_config
msg "PROFILE:"
msg2 "list_dir_iso: %s" "${list_dir_iso}"
msg2 "build_lists: %s" "$(show_build_lists ${list_dir_iso})"
msg2 "build_list_iso: %s" "${build_list_iso}"
msg2 "is_build_list: %s" "${is_build_list}"
msg2 "build_mirror: %s" "${build_mirror}/${target_branch}"
${verbose} && msg2 "run_dir: %s" "${run_dir}"
msg "OPTIONS:"
msg2 "arch: %s" "${target_arch}"
msg2 "initsys: %s" "${initsys}"
msg2 "kernel: %s" "${kernel}"
msg "ARGS:"
msg2 "calamares: %s" "${calamares}"
msg "CHECK QUEUE:"
run show_profile "${build_list_iso}"
show_version
show_config
msg "PROFILE:"
msg2 "list_dir_iso: %s" "${list_dir_iso}"
msg2 "build_lists: %s" "$(show_build_lists ${list_dir_iso})"
msg2 "build_list_iso: %s" "${build_list_iso}"
msg2 "is_build_list: %s" "${is_build_list}"
msg "OPTIONS:"
msg2 "arch: %s" "${target_arch}"
msg2 "initsys: %s" "${initsys}"
msg2 "kernel: %s" "${kernel}"
msg "ARGS:"
msg2 "validate: %s" "${validate}"
msg2 "calamares: %s" "${calamares}"
msg2 "group: %s" "${group}"
msg "CHECK QUEUE:"
run show_profile "${build_list_iso}"
}
load_user_info
......@@ -93,37 +93,43 @@ load_run_dir "${profile_repo}"
calamares=false
pretend=false
group=false
validate=false
cache_dir_netinstall="${cache_dir}/netinstall"
usage() {
echo "Usage: ${0##*/} [options]"
echo " -p <profile> Buildset or profile [default: ${build_list_iso}]"
echo " -a <arch> Arch [default: ${target_arch}]"
echo " -k <name> Kernel to use[default: ${kernel}]"
echo " -i <name> Init system to use [default: ${initsys}]"
echo ' -c Check also calamares yaml files generated for the profile'
echo ' -q Query settings'
echo ' -h This help'
echo ''
echo ''
exit $1
echo "Usage: ${0##*/} [options]"
echo " -p <profile> Buildset or profile [default: ${build_list_iso}]"
echo " -a <arch> Arch [default: ${target_arch}]"
echo " -k <name> Kernel to use[default: ${kernel}]"
echo " -i <name> Init system to use [default: ${initsys}]"
echo ' -c Check also calamares yaml files generated for the profile'
echo ' -g Enable pacman group accepted for -p'
echo ' -v Validate by schema'
echo ' -q Query settings'
echo ' -h This help'
echo ''
echo ''
exit $1
}
orig_argv=("$@")
opts='p:a:i:k:cqh'
opts='p:a:i:k:gcvqh'
while getopts "${opts}" arg; do
case "${arg}" in
p) build_list_iso="$OPTARG" ;;
a) target_arch="$OPTARG" ;;
i) initsys="$OPTARG" ;;
k) kernel="$OPTARG" ;;
c) calamares=true ;;
q) pretend=true ;;
h|?) usage 0 ;;
*) echo "invalid argument '${arg}'"; usage 1 ;;
esac
case "${arg}" in
p) build_list_iso="$OPTARG" ;;
a) target_arch="$OPTARG" ;;
i) initsys="$OPTARG" ;;
k) kernel="$OPTARG" ;;
c) calamares=true ;;
g) group=true ;;
v) validate=true ;;
q) pretend=true ;;
h|?) usage 0 ;;
*) echo "invalid argument '${arg}'"; usage 1 ;;
esac
done
shift $(($OPTIND - 1))
......@@ -136,4 +142,6 @@ eval_build_list "${list_dir_iso}" "${build_list_iso}"
${pretend} && display_settings && exit 1
${group} && write_pacman_group_yaml "${build_list_iso}" && exit 0
run make_profile_yaml "${build_list_iso}"
......@@ -23,58 +23,58 @@ load_vars "$HOME/.makepkg.conf"
load_vars /etc/makepkg.conf
if [[ ! -f PKGBUILD ]]; then
die 'This must be run in the directory of a built package.'
die 'This must be run in the directory of a built package.'
fi
. ./PKGBUILD
if [[ $arch == 'any' ]]; then
CARCH='any'
CARCH='any'
fi
STARTDIR=$(pwd)
TEMPDIR=$(mktemp -d --tmpdir checkpkg-script.XXXX)
for _pkgname in "${pkgname[@]}"; do
target_pkgver=$(get_full_version "$_pkgname")
if ! pkgfile=$(find_cached_package "$_pkgname" "$target_pkgver" "$CARCH"); then
die 'tarball not found for package: %s' "${_pkgname}-$target_pkgver"
fi
ln -s "$pkgfile" "$TEMPDIR"
pkgurl=$(pacman -Spdd --print-format '%l' --noconfirm "$_pkgname")
if [[ $? -ne 0 ]]; then
die "Couldn't download previous package for %s." "$_pkgname"
fi
oldpkg=${pkgurl##*://*/}
if [[ ${oldpkg##*/} = ${pkgfile##*/} ]]; then
die "The built package (%s) is the one in the repo right now!" "$_pkgname"
fi
if [[ $pkgurl = file://* ]]; then
ln -s "${pkgurl#file://}" "$TEMPDIR/$oldpkg"
elif [[ -f "$PKGDEST/$oldpkg" ]]; then
ln -s "$PKGDEST/$oldpkg" "$TEMPDIR/$oldpkg"
elif [[ -f "$STARTDIR/$oldpkg" ]]; then
ln -s "$STARTDIR/$oldpkg" "$TEMPDIR/$oldpkg"
else
curl -fsLC - --retry 3 --retry-delay 3 -o "$TEMPDIR/$oldpkg" "$pkgurl"
fi
bsdtar tf "$TEMPDIR/$oldpkg" | sort > "$TEMPDIR/filelist-$_pkgname-old"
bsdtar tf "$pkgfile" | sort > "$TEMPDIR/filelist-$_pkgname"
sdiff -s "$TEMPDIR/filelist-$_pkgname-old" "$TEMPDIR/filelist-$_pkgname"
find-libprovides "$TEMPDIR/$oldpkg" 2>/dev/null | sort > "$TEMPDIR/libraries-$_pkgname-old"
find-libprovides "$pkgfile" 2>/dev/null | sort > "$TEMPDIR/libraries-$_pkgname"
if ! diff_output="$(sdiff -s "$TEMPDIR/libraries-$_pkgname-old" "$TEMPDIR/libraries-$_pkgname")"; then
msg "Sonames differ in %s!" "$_pkgname"
echo "$diff_output"
else
msg "No soname differences for %s" "$_pkgname."
fi
target_pkgver=$(get_full_version "$_pkgname")
if ! pkgfile=$(find_cached_package "$_pkgname" "$target_pkgver" "$CARCH"); then
die 'tarball not found for package: %s' "${_pkgname}-$target_pkgver"