mirror of
https://gitlab.archlinux.org/archlinux/devtools.git
synced 2025-09-15 10:56:19 +02:00
Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3f02a1a24c | ||
![]() |
1df0979da6 | ||
![]() |
c1a3ed224b | ||
![]() |
144f9a871e | ||
![]() |
44328cd9a3 | ||
![]() |
0e2b16b0ac | ||
![]() |
6f0a8c345d | ||
![]() |
5f19853414 | ||
![]() |
2b62ac660d | ||
![]() |
7cb72699f6 | ||
![]() |
d1790c295a |
15
.editorconfig
Normal file
15
.editorconfig
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# EditorConfig configuration for devtools
|
||||||
|
# https://editorconfig.org
|
||||||
|
|
||||||
|
# Top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
# Unix-style newlines without trailing whitespaces, but with a newline
|
||||||
|
# ending every file, utf-8 charset, set indent to tabs
|
||||||
|
[*]
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
charset = utf-8
|
||||||
|
indent_style = tab
|
||||||
|
tab_width = 4
|
2
Makefile
2
Makefile
@@ -1,6 +1,6 @@
|
|||||||
SHELL=/bin/bash -o pipefail
|
SHELL=/bin/bash -o pipefail
|
||||||
|
|
||||||
V=1.2.0
|
V=1.2.1
|
||||||
BUILDTOOLVER ?= $(V)
|
BUILDTOOLVER ?= $(V)
|
||||||
|
|
||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
|
@@ -27,6 +27,7 @@ _makechrootpkg_args=(
|
|||||||
-I
|
-I
|
||||||
-l
|
-l
|
||||||
-n
|
-n
|
||||||
|
-t
|
||||||
-T
|
-T
|
||||||
-U
|
-U
|
||||||
-x
|
-x
|
||||||
@@ -36,6 +37,7 @@ _makechrootpkg_args_D_opts() { _filedir -d; }
|
|||||||
_makechrootpkg_args_r_opts() { _filedir -d; }
|
_makechrootpkg_args_r_opts() { _filedir -d; }
|
||||||
_makechrootpkg_args_I_opts() { _filedir '*.pkg.tar.*'; }
|
_makechrootpkg_args_I_opts() { _filedir '*.pkg.tar.*'; }
|
||||||
_makechrootpkg_args_l_opts() { _filedir -d; }
|
_makechrootpkg_args_l_opts() { _filedir -d; }
|
||||||
|
_makechrootpkg_args_t_opts() { _filedir -d; }
|
||||||
_makechrootpkg_args_U_opts() { :; }
|
_makechrootpkg_args_U_opts() { :; }
|
||||||
_makechrootpkg_args_x_opts() { _devtools_completions_inspect; }
|
_makechrootpkg_args_x_opts() { _devtools_completions_inspect; }
|
||||||
_makechrootpkg() { __devtools_complete _makechrootpkg; }
|
_makechrootpkg() { __devtools_complete _makechrootpkg; }
|
||||||
@@ -61,12 +63,14 @@ _mkarchroot_args=(
|
|||||||
-C
|
-C
|
||||||
-M
|
-M
|
||||||
-c
|
-c
|
||||||
|
-f
|
||||||
-h
|
-h
|
||||||
)
|
)
|
||||||
_mkarchroot_args_U_opts() { _filedir '*.pkg.tar.*'; }
|
_mkarchroot_args_U_opts() { _filedir '*.pkg.tar.*'; }
|
||||||
_mkarchroot_args_C_opts() { _filedir '*.conf'; }
|
_mkarchroot_args_C_opts() { _filedir '*.conf'; }
|
||||||
_mkarchroot_args_M_opts() { _filedir '*.conf'; }
|
_mkarchroot_args_M_opts() { _filedir '*.conf'; }
|
||||||
_mkarchroot_args_c_opts() { _filedir -d; }
|
_mkarchroot_args_c_opts() { _filedir -d; }
|
||||||
|
_mkarchroot_args_f_opts() { _filedir -d; }
|
||||||
_mkarchroot_opts() {
|
_mkarchroot_opts() {
|
||||||
local args
|
local args
|
||||||
args=$(__pkgctl_word_count_after_subcommand)
|
args=$(__pkgctl_word_count_after_subcommand)
|
||||||
|
@@ -222,6 +222,7 @@ _makechrootpkg_args=(
|
|||||||
'-c[Clean the chroot before building]'
|
'-c[Clean the chroot before building]'
|
||||||
'*-d[Bind directory into build chroot as read-write]:bind_dir_rw:_files -/'
|
'*-d[Bind directory into build chroot as read-write]:bind_dir_rw:_files -/'
|
||||||
'*-D[Bind directory into build chroot as read-only]:bind_dir_ro:_files -/'
|
'*-D[Bind directory into build chroot as read-only]:bind_dir_ro:_files -/'
|
||||||
|
'*-t[Mount a tmpfs at directory]:tmpfs_dir:_files -/'
|
||||||
'-u[Update the working copy of the chroot before building]'
|
'-u[Update the working copy of the chroot before building]'
|
||||||
'-r[The chroot dir to use]:chroot_dir:_files -/'
|
'-r[The chroot dir to use]:chroot_dir:_files -/'
|
||||||
'*-I[Install a package into the working copy]:target:_files -g "*.pkg.tar.*(.)"'
|
'*-I[Install a package into the working copy]:target:_files -g "*.pkg.tar.*(.)"'
|
||||||
@@ -237,6 +238,7 @@ _mkarchroot_args=(
|
|||||||
'-C[Location of a pacman config file]:pacman_config:_files -g "*.conf(.)"'
|
'-C[Location of a pacman config file]:pacman_config:_files -g "*.conf(.)"'
|
||||||
'-M[Location of a makepkg config file]:makepkg_config:_files -g "*.conf(.)"'
|
'-M[Location of a makepkg config file]:makepkg_config:_files -g "*.conf(.)"'
|
||||||
'-c[Set pacman cache]:pacman_cache:_files -/'
|
'-c[Set pacman cache]:pacman_cache:_files -/'
|
||||||
|
'-f[Copy src file from the host to the chroot]:target:_files -/'
|
||||||
'-h[Display usage]'
|
'-h[Display usage]'
|
||||||
'1:working_dir:_files -/'
|
'1:working_dir:_files -/'
|
||||||
'*:packages:_devtools_completions_all_packages'
|
'*:packages:_devtools_completions_all_packages'
|
||||||
|
@@ -28,8 +28,9 @@ Options
|
|||||||
*-c* <dir>::
|
*-c* <dir>::
|
||||||
Set pacman cache, if no directory is specified the passed pacman.conf's cachedir is used with a fallback to '/etc/pacman.conf'
|
Set pacman cache, if no directory is specified the passed pacman.conf's cachedir is used with a fallback to '/etc/pacman.conf'
|
||||||
|
|
||||||
*-f* <file>::
|
*-f* <src>[:<dst>]::
|
||||||
Copy file from the host to the chroot
|
Copy file from the host to the chroot.
|
||||||
|
If 'dst' is not provided, it defaults to 'src' inside of the chroot.
|
||||||
|
|
||||||
*-s*::
|
*-s*::
|
||||||
Do not run setarch
|
Do not run setarch
|
||||||
|
@@ -45,6 +45,9 @@ Options
|
|||||||
*-D* <dir>::
|
*-D* <dir>::
|
||||||
Bind directory into build chroot as read-only
|
Bind directory into build chroot as read-only
|
||||||
|
|
||||||
|
*-t* <dir>[:opts]::
|
||||||
|
Mount a tmpfs at 'dir'. See the '--tmpfs' argument in systemd-nspawn(1) for more details.
|
||||||
|
|
||||||
*-u*::
|
*-u*::
|
||||||
Update the working copy of the chroot before building
|
Update the working copy of the chroot before building
|
||||||
This is useful for rebuilds without dirtying the pristine
|
This is useful for rebuilds without dirtying the pristine
|
||||||
@@ -76,5 +79,9 @@ Options
|
|||||||
*-x* <when>::
|
*-x* <when>::
|
||||||
Inspect chroot after build, possible modes are 'never' (default), 'always' or 'failure'
|
Inspect chroot after build, possible modes are 'never' (default), 'always' or 'failure'
|
||||||
|
|
||||||
|
See Also
|
||||||
|
--------
|
||||||
|
|
||||||
|
systemd-nspawn(1)
|
||||||
|
|
||||||
include::include/footer.asciidoc[]
|
include::include/footer.asciidoc[]
|
||||||
|
@@ -32,8 +32,9 @@ Options
|
|||||||
*-c* <dir>::
|
*-c* <dir>::
|
||||||
Set pacman cache.
|
Set pacman cache.
|
||||||
|
|
||||||
*-f* <file>::
|
*-f* <src>[:<dst>]::
|
||||||
Copy file from the host to the chroot.
|
Copy file from the host to the chroot.
|
||||||
|
If 'dst' is not provided, it defaults to 'src' inside of the chroot.
|
||||||
|
|
||||||
*-s*::
|
*-s*::
|
||||||
Do not run setarch.
|
Do not run setarch.
|
||||||
|
@@ -12,7 +12,8 @@ pkgctl build [OPTIONS] [PATH...]
|
|||||||
Description
|
Description
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
TODO
|
Build packages in clean chroot environment, offering various options
|
||||||
|
and functionalities to customize the package building process.
|
||||||
|
|
||||||
Build Options
|
Build Options
|
||||||
-------------
|
-------------
|
||||||
|
43
doc/man/pkgctl-db.1.asciidoc
Normal file
43
doc/man/pkgctl-db.1.asciidoc
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
pkgctl-db(1)
|
||||||
|
============
|
||||||
|
|
||||||
|
NAME
|
||||||
|
----
|
||||||
|
pkgctl-db - Pacman database modification utility for package updates, moves, and more.
|
||||||
|
|
||||||
|
SYNOPSIS
|
||||||
|
--------
|
||||||
|
pkgctl db [OPTIONS] [SUBCOMMAND]
|
||||||
|
|
||||||
|
DESCRIPTION
|
||||||
|
-----------
|
||||||
|
|
||||||
|
Managing the Pacman database and facilitate the modification of packages and their metadata
|
||||||
|
within the database
|
||||||
|
|
||||||
|
OPTIONS
|
||||||
|
-------
|
||||||
|
|
||||||
|
*-h, --help*::
|
||||||
|
Display usage information and available options.
|
||||||
|
|
||||||
|
Subcommands
|
||||||
|
-----------
|
||||||
|
|
||||||
|
pkgctl db update::
|
||||||
|
Update the binary repository as final release step
|
||||||
|
|
||||||
|
pkgctl db move::
|
||||||
|
Move packages between binary repositories
|
||||||
|
|
||||||
|
pkgctl db remove::
|
||||||
|
Remove packages from binary repositories
|
||||||
|
|
||||||
|
SEE ALSO
|
||||||
|
--------
|
||||||
|
|
||||||
|
pkgctl-db-update(1)
|
||||||
|
pkgctl-db-move(1)
|
||||||
|
pkgctl-db-remove(1)
|
||||||
|
|
||||||
|
include::include/footer.asciidoc[]
|
@@ -12,7 +12,12 @@ pkgctl [SUBCOMMAND] [OPTIONS]
|
|||||||
Description
|
Description
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
TODO
|
Command-line utility serving as a unified interface for multiple development tools.
|
||||||
|
This tool aims to simplify and optimize interactions with devtools by offering
|
||||||
|
various subcommands for executing tasks related to package management, repository management,
|
||||||
|
version control, among others.
|
||||||
|
|
||||||
|
Utilizing pkgctl enables users to efficiently administer their development workflows.
|
||||||
|
|
||||||
Options
|
Options
|
||||||
-------
|
-------
|
||||||
|
@@ -22,12 +22,13 @@ usage() {
|
|||||||
echo "A wrapper around systemd-nspawn. Provides support for pacman."
|
echo "A wrapper around systemd-nspawn. Provides support for pacman."
|
||||||
echo
|
echo
|
||||||
echo ' options:'
|
echo ' options:'
|
||||||
echo ' -C <file> Location of a pacman config file'
|
echo ' -C <file> Location of a pacman config file'
|
||||||
echo ' -M <file> Location of a makepkg config file'
|
echo ' -M <file> Location of a makepkg config file'
|
||||||
echo ' -c <dir> Set pacman cache'
|
echo ' -c <dir> Set pacman cache'
|
||||||
echo ' -f <file> Copy file from the host to the chroot'
|
echo ' -f <src>[:<dst>] Copy src file from the host to the chroot.'
|
||||||
echo ' -s Do not run setarch'
|
echo ' If dst file is not provided, it defaults to src'
|
||||||
echo ' -h This message'
|
echo ' -s Do not run setarch'
|
||||||
|
echo ' -h This message'
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,8 +115,10 @@ copy_hostconf () {
|
|||||||
|
|
||||||
local file
|
local file
|
||||||
for file in "${files[@]}"; do
|
for file in "${files[@]}"; do
|
||||||
mkdir -p "$(dirname "$working_dir$file")"
|
src="${file%%:*}"
|
||||||
cp -T "$file" "$working_dir$file"
|
dst="${file#*:}"
|
||||||
|
mkdir -p "$(dirname "$working_dir$dst")"
|
||||||
|
cp -T "$src" "$working_dir$dst"
|
||||||
done
|
done
|
||||||
|
|
||||||
sed -r "s|^#?\\s*CacheDir.+|CacheDir = ${cache_dirs[*]}|g" -i "$working_dir/etc/pacman.conf"
|
sed -r "s|^#?\\s*CacheDir.+|CacheDir = ${cache_dirs[*]}|g" -i "$working_dir/etc/pacman.conf"
|
||||||
|
@@ -15,6 +15,9 @@ $DEVTOOLS_INCLUDE_COMMON_SH
|
|||||||
# Avoid any encoding problems
|
# Avoid any encoding problems
|
||||||
export LANG=C.UTF-8
|
export LANG=C.UTF-8
|
||||||
|
|
||||||
|
# Avoid systemd trying to color the terminal on systemd-nspawn
|
||||||
|
export SYSTEMD_TINT_BACKGROUND=no
|
||||||
|
|
||||||
# Set buildtool properties
|
# Set buildtool properties
|
||||||
export BUILDTOOL=devtools
|
export BUILDTOOL=devtools
|
||||||
export BUILDTOOLVER=@buildtoolver@
|
export BUILDTOOLVER=@buildtoolver@
|
||||||
@@ -117,6 +120,8 @@ print_workdir_error() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_setup_workdir=false
|
_setup_workdir=false
|
||||||
|
# Ensure that there is no outside value for WORKDIR leaking in
|
||||||
|
unset WORKDIR
|
||||||
setup_workdir() {
|
setup_workdir() {
|
||||||
[[ -z ${WORKDIR:-} ]] && WORKDIR=$(mktemp -d --tmpdir "${0##*/}.XXXXXXXXXX")
|
[[ -z ${WORKDIR:-} ]] && WORKDIR=$(mktemp -d --tmpdir "${0##*/}.XXXXXXXXXX")
|
||||||
_setup_workdir=true
|
_setup_workdir=true
|
||||||
|
@@ -227,7 +227,7 @@ get_upstream_version() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if ! output=$(GIT_TERMINAL_PROMPT=0 nvchecker --file "${config}" --logger json "${opts[@]}" 2>&1 | \
|
if ! output=$(GIT_TERMINAL_PROMPT=0 nvchecker --file "${config}" --logger json "${opts[@]}" 2>&1 | \
|
||||||
jq --raw-output 'select(.level != "debug")'); then
|
jq --raw-output 'select((.level != "debug") and (.event != "ignoring invalid version"))'); then
|
||||||
printf "failed to run nvchecker: %s" "${output}"
|
printf "failed to run nvchecker: %s" "${output}"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@@ -267,13 +267,13 @@ nvchecker_check_config() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
# check if the config contains a pkgbase section
|
# check if the config contains a pkgbase section
|
||||||
if [[ -n ${pkgbase} ]] && ! grep --max-count=1 --extended-regexp --quiet "^\\[\"?${pkgbase}\"?\\]" < "${config}"; then
|
if [[ -n ${pkgbase} ]] && ! grep --max-count=1 --extended-regexp --quiet "^\\[\"?${pkgbase//+/\\+}\"?\\]" < "${config}"; then
|
||||||
printf "missing pkgbase section in %s: %s" "${config}" "${pkgbase}"
|
printf "missing pkgbase section in %s: %s" "${config}" "${pkgbase}"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# check if the config contains any section other than pkgbase
|
# check if the config contains any section other than pkgbase
|
||||||
if [[ -n ${pkgbase} ]] && property=$(grep --max-count=1 --perl-regexp "^\\[(?!\"?${pkgbase}\"?\\]).+\\]" < "${config}"); then
|
if [[ -n ${pkgbase} ]] && property=$(grep --max-count=1 --perl-regexp "^\\[(?!\"?${pkgbase//+/\\+}\"?\\]).+\\]" < "${config}"); then
|
||||||
printf "non-pkgbase section not supported in %s: %s" "${config}" "${property}"
|
printf "non-pkgbase section not supported in %s: %s" "${config}" "${property}"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
@@ -252,7 +252,7 @@ nvchecker_setup() {
|
|||||||
|
|
||||||
# escape the section if it contains toml subsection chars
|
# escape the section if it contains toml subsection chars
|
||||||
section="${pkgbase}"
|
section="${pkgbase}"
|
||||||
if [[ ${section} == *.* ]]; then
|
if [[ ${section} == *.* ]] || [[ ${section} == *+* ]]; then
|
||||||
section="\"${section}\""
|
section="\"${section}\""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@@ -38,6 +38,7 @@ inspect=never
|
|||||||
|
|
||||||
bindmounts_ro=()
|
bindmounts_ro=()
|
||||||
bindmounts_rw=()
|
bindmounts_rw=()
|
||||||
|
bindmounts_tmpfs=()
|
||||||
|
|
||||||
copy=$USER
|
copy=$USER
|
||||||
[[ -n ${SUDO_USER:-} ]] && copy=$SUDO_USER
|
[[ -n ${SUDO_USER:-} ]] && copy=$SUDO_USER
|
||||||
@@ -65,23 +66,24 @@ usage() {
|
|||||||
echo "Default makepkg args: ${default_makepkg_args[*]}"
|
echo "Default makepkg args: ${default_makepkg_args[*]}"
|
||||||
echo ''
|
echo ''
|
||||||
echo 'Flags:'
|
echo 'Flags:'
|
||||||
echo '-h This help'
|
echo '-h This help'
|
||||||
echo '-c Clean the chroot before building'
|
echo '-c Clean the chroot before building'
|
||||||
echo '-d <dir> Bind directory into build chroot as read-write'
|
echo '-d <dir> Bind directory into build chroot as read-write'
|
||||||
echo '-D <dir> Bind directory into build chroot as read-only'
|
echo '-D <dir> Bind directory into build chroot as read-only'
|
||||||
echo '-u Update the working copy of the chroot before building'
|
echo '-t <dir[:opts]> Mount a tmpfs at directory'
|
||||||
echo ' This is useful for rebuilds without dirtying the pristine'
|
echo '-u Update the working copy of the chroot before building'
|
||||||
echo ' chroot'
|
echo ' This is useful for rebuilds without dirtying the pristine'
|
||||||
echo '-r <dir> The chroot dir to use'
|
echo ' chroot'
|
||||||
echo '-I <pkg> Install a package into the working copy of the chroot'
|
echo '-r <dir> The chroot dir to use'
|
||||||
echo '-l <copy> The directory to use as the working copy of the chroot'
|
echo '-I <pkg> Install a package into the working copy of the chroot'
|
||||||
echo ' Useful for maintaining multiple copies'
|
echo '-l <copy> The directory to use as the working copy of the chroot'
|
||||||
echo " Default: $copy"
|
echo ' Useful for maintaining multiple copies'
|
||||||
echo '-n Run namcap on the package'
|
echo " Default: $copy"
|
||||||
echo '-C Run checkpkg on the package'
|
echo '-n Run namcap on the package'
|
||||||
echo '-T Build in a temporary directory'
|
echo '-C Run checkpkg on the package'
|
||||||
echo '-U Run makepkg as a specified user'
|
echo '-T Build in a temporary directory'
|
||||||
echo '-x <when> Inspect chroot after build (never, always, failure)'
|
echo '-U Run makepkg as a specified user'
|
||||||
|
echo '-x <when> Inspect chroot after build (never, always, failure)'
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,7 +150,7 @@ install_packages() {
|
|||||||
pkgnames=("${install_pkgs[@]##*/}")
|
pkgnames=("${install_pkgs[@]##*/}")
|
||||||
|
|
||||||
cp -- "${install_pkgs[@]}" "$copydir/root/"
|
cp -- "${install_pkgs[@]}" "$copydir/root/"
|
||||||
arch-nspawn "$copydir" "${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
|
arch-nspawn "$copydir" "${bindmounts_ro[@]}" "${bindmounts_rw[@]}" "${bindmounts_tmpfs[@]}" \
|
||||||
pacman -U --noconfirm --ask=4 -- "${pkgnames[@]/#//root/}"
|
pacman -U --noconfirm --ask=4 -- "${pkgnames[@]/#//root/}"
|
||||||
ret=$?
|
ret=$?
|
||||||
rm -- "${pkgnames[@]/#/$copydir/root/}"
|
rm -- "${pkgnames[@]/#/$copydir/root/}"
|
||||||
@@ -188,6 +190,11 @@ builduser ALL = NOPASSWD: /usr/bin/pacman
|
|||||||
EOF
|
EOF
|
||||||
chmod 440 "$copydir/etc/sudoers.d/builduser-pacman"
|
chmod 440 "$copydir/etc/sudoers.d/builduser-pacman"
|
||||||
|
|
||||||
|
cat > "$copydir/etc/gitconfig" <<EOF
|
||||||
|
[safe]
|
||||||
|
directory = *
|
||||||
|
EOF
|
||||||
|
|
||||||
# This is a little gross, but this way the script is recreated every time in the
|
# This is a little gross, but this way the script is recreated every time in the
|
||||||
# working copy
|
# working copy
|
||||||
{
|
{
|
||||||
@@ -286,11 +293,12 @@ move_products() {
|
|||||||
}
|
}
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
while getopts 'hcur:I:l:nCTD:d:U:x:' arg; do
|
while getopts 'hcur:I:l:nCTD:d:U:x:t:' arg; do
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
c) clean_first=1 ;;
|
c) clean_first=1 ;;
|
||||||
D) bindmounts_ro+=("--bind-ro=$OPTARG") ;;
|
D) bindmounts_ro+=("--bind-ro=$OPTARG") ;;
|
||||||
d) bindmounts_rw+=("--bind=$OPTARG") ;;
|
d) bindmounts_rw+=("--bind=$OPTARG") ;;
|
||||||
|
t) bindmounts_tmpfs+=("--tmpfs=$OPTARG") ;;
|
||||||
u) update_first=1 ;;
|
u) update_first=1 ;;
|
||||||
r) passeddir="$OPTARG" ;;
|
r) passeddir="$OPTARG" ;;
|
||||||
I) install_pkgs+=("$OPTARG") ;;
|
I) install_pkgs+=("$OPTARG") ;;
|
||||||
@@ -360,7 +368,7 @@ if [[ ! -d $copydir ]] || (( clean_first )); then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
(( update_first )) && arch-nspawn "$copydir" \
|
(( update_first )) && arch-nspawn "$copydir" \
|
||||||
"${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
|
"${bindmounts_ro[@]}" "${bindmounts_rw[@]}" "${bindmounts_tmpfs[@]}" \
|
||||||
pacman -Syuu --noconfirm
|
pacman -Syuu --noconfirm
|
||||||
|
|
||||||
if [[ -n ${install_pkgs[*]:-} ]]; then
|
if [[ -n ${install_pkgs[*]:-} ]]; then
|
||||||
@@ -385,6 +393,7 @@ nspawn_build_args=(
|
|||||||
--tmpfs="/tmp:${tmp_opts}"
|
--tmpfs="/tmp:${tmp_opts}"
|
||||||
"${bindmounts_ro[@]}"
|
"${bindmounts_ro[@]}"
|
||||||
"${bindmounts_rw[@]}"
|
"${bindmounts_rw[@]}"
|
||||||
|
"${bindmounts_tmpfs[@]}"
|
||||||
)
|
)
|
||||||
|
|
||||||
if arch-nspawn "$copydir" \
|
if arch-nspawn "$copydir" \
|
||||||
|
@@ -22,13 +22,14 @@ nspawn_args=()
|
|||||||
usage() {
|
usage() {
|
||||||
echo "Usage: ${0##*/} [options] working-dir package-list..."
|
echo "Usage: ${0##*/} [options] working-dir package-list..."
|
||||||
echo ' options:'
|
echo ' options:'
|
||||||
echo ' -U Use pacman -U to install packages'
|
echo ' -U Use pacman -U to install packages'
|
||||||
echo ' -C <file> Location of a pacman config file'
|
echo ' -C <file> Location of a pacman config file'
|
||||||
echo ' -M <file> Location of a makepkg config file'
|
echo ' -M <file> Location of a makepkg config file'
|
||||||
echo ' -c <dir> Set pacman cache'
|
echo ' -c <dir> Set pacman cache'
|
||||||
echo ' -f <file> Copy file from the host to the chroot'
|
echo ' -f <src>[:<dst>] Copy src file from the host to the chroot.'
|
||||||
echo ' -s Do not run setarch'
|
echo ' If dst file is not provided, it defaults to src'
|
||||||
echo ' -h This message'
|
echo ' -s Do not run setarch'
|
||||||
|
echo ' -h This message'
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,8 +85,10 @@ if is_btrfs "$working_dir"; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
for file in "${files[@]}"; do
|
for file in "${files[@]}"; do
|
||||||
mkdir -p "$(dirname "$working_dir$file")"
|
src="${file%%:*}"
|
||||||
cp "$file" "$working_dir$file"
|
dst="${file#*:}"
|
||||||
|
mkdir -p "$(dirname "$working_dir$dst")"
|
||||||
|
cp "$src" "$working_dir$dst"
|
||||||
done
|
done
|
||||||
|
|
||||||
unshare --mount pacstrap -${umode}Mc ${pac_conf:+-C "$pac_conf"} "$working_dir" \
|
unshare --mount pacstrap -${umode}Mc ${pac_conf:+-C "$pac_conf"} "$working_dir" \
|
||||||
|
@@ -2,3 +2,4 @@
|
|||||||
source = "github"
|
source = "github"
|
||||||
github = "anthraxx/git-smash"
|
github = "anthraxx/git-smash"
|
||||||
use_max_tag = true
|
use_max_tag = true
|
||||||
|
prefix = "v"
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
[git-smash]
|
[git-smash]
|
||||||
source = "git"
|
source = "git"
|
||||||
git = "https://github.com/anthraxx/git-smash.git"
|
git = "https://github.com/anthraxx/git-smash.git"
|
||||||
|
prefix = "v"
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
["git.smash"]
|
["git.smash"]
|
||||||
source = "git"
|
source = "git"
|
||||||
git = "https://github.com/anthraxx/git-smash.git"
|
git = "https://github.com/anthraxx/git-smash.git"
|
||||||
|
prefix = "v"
|
||||||
|
Reference in New Issue
Block a user