Compare commits

...

10 Commits

Author SHA1 Message Date
Felix Yan
02b1e7e3c6 Merge branch 'commitpkg' into 'master'
commitpkg: error out when there is no package to upload

See merge request archlinux/devtools!112
2025-05-19 22:00:10 +00:00
Bert Peters
40f31f98a3 fix(autocomplete): don't add extra = for message 2025-05-12 22:49:22 +02:00
Jan Alexander Steffens (heftig)
c6f5d72708 fix(common): Fix diffoscope looking at remote debug info
readelf will pull in remote debug info if allowed to. This is not really
what we expect for diffoscope diffs, especially when our server only has
debug info for one side of the diff.
2025-04-23 01:13:46 +02:00
Jakub Klinkovský
b4a5e5dbd9 fix(build): sync command description with the man page
The original wording sounded like `pkgctl build` by default updates the
checksums whenever `pkgver` is changed in PKGBUILD.
2025-04-18 15:56:51 +02:00
Levente Polyak
4926d9d8c5 chore(release): version v1.3.2 2025-02-25 22:05:15 +01:00
Levente Polyak
7165e0d73e chore(conf): add whitespace to RUSTFLAGS option for unified style 2025-02-25 21:51:37 +01:00
Levente Polyak
8776dd39e8 chore(makerepropkg): unify indention style of the file 2025-02-25 21:32:14 +01:00
Levente Polyak
fb4bf96d24 feat(makerepropkg): support conf.d makepkg config files from buildtool
Previously we have only copied the passed makepkg.conf file into the
chroot, which misses build flags for additional language specific files
that makepkg supports. Fix this by extracting all conf.d makepkg config
files from the detected devtools archive.

Component: makerepropkg
Co-authored-by: Christian Heusel <christian@heusel.eu>
2025-02-25 21:32:06 +01:00
Levente Polyak
96eff02801 feat(arch-nspawn): support conf.d makepkg config files
Previously we have only copied the passed makepkg.conf file into the
chroot, which misses build flags for additional language specific files
that makepkg supports. Fix this by also copying all config files that
match the `<file>.d/*.conf` glob.

Fixes #244

Component: arch-nspawn
Suggested-by: Rein Fernhout (Levitating) <me@levitati.ng>
Co-authored-by: Christian Heusel <christian@heusel.eu>
2025-02-25 21:20:31 +01:00
Felix Yan
e179df93a8 commitpkg: error out when there is no package to upload
When calling commitpkg without providing a package to upload, it often
indicates an error in scripts (like failed to build the package
correctly, or transfer error, etc).
2022-08-26 16:48:57 +03:00
10 changed files with 51 additions and 16 deletions

View File

@@ -1,6 +1,6 @@
SHELL=/bin/bash -o pipefail
V=1.3.1
V=1.3.2
BUILDTOOLVER ?= $(V)
PREFIX = /usr/local

View File

@@ -11,7 +11,7 @@
# Flags used for the Rust compiler, similar in spirit to CFLAGS. Read
# linkman:rustc[1] for more details on the available flags.
RUSTFLAGS="-Cforce-frame-pointers=yes"
RUSTFLAGS="-C force-frame-pointers=yes"
# Additional compiler flags appended to `RUSTFLAGS` for use in debugging.
# Usually this would include: ``-C debuginfo=2''. Read linkman:rustc[1] for

View File

@@ -61,7 +61,7 @@ _pkgctl_build_args=(
'--update-checksums[Force computation and update of the checksums (disables auto-detection)]'
'(-e --edit)'{-e,--edit}'[Edit the PKGBUILD before building]'
'(-r --release)'{-r,--release}'[Automatically commit, tag and release after building]'
'(-m --message=)'{-m,--message=}"[Use the given <msg> as the commit message]:message:"
'(-m --message)'{-m,--message}"[Use the given <msg> as the commit message]:message:"
'(-u --db-update)'{-u,--db-update}'[Automatically update the pacman database as last action]'
'(-h --help)'{-h,--help}'[Display usage]'
'*:git_dir:_files -/'
@@ -201,7 +201,7 @@ _pkgctl_issue_view_args=(
)
_pkgctl_release_args=(
'(-m --message=)'{-m,--message=}"[Use the given <msg> as the commit message]:message:"
'(-m --message)'{-m,--message}"[Use the given <msg> as the commit message]:message:"
'(-r --repo)'{-r,--repo}"[Specify a target repository for new packages]:repo:($DEVTOOLS_VALID_REPOS[*])"
'(-s --staging)'{-s,--staging}'[Release to the staging counterpart of the auto-detected repo]'
'(-t --testing)'{-t,--testing}'[Release to the testing counterpart of the auto-detected repo]'

View File

@@ -23,7 +23,8 @@ Options
Location of a pacman config file
*-M* <file>::
Location of a makepkg config file
Location of a makepkg config file. Specific additions (e.g. build flags for
additional languages) can be placed in '<file>.d/*.conf'.
*-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'

View File

@@ -49,7 +49,8 @@ Options
Set the pacman cache directory.
*-M* <file>::
Location of a makepkg config file.
Location of a makepkg config file. Specific additions (e.g. build flags for
additional languages) can be placed in '<file>.d/*.conf'.
*-l* <chroot>::
The directory name to use as the chroot namespace

View File

@@ -112,7 +112,13 @@ copy_hostconf () {
[[ -n $host_cachemirrors ]] && printf 'CacheServer = %s\n' "${host_cachemirrors[@]}" >>"$working_dir/etc/pacman.d/mirrorlist"
[[ -n $pac_conf ]] && cp "$pac_conf" "$working_dir/etc/pacman.conf"
[[ -n $makepkg_conf ]] && cp "$makepkg_conf" "$working_dir/etc/makepkg.conf"
if [[ -n $makepkg_conf ]]; then
cp "$makepkg_conf" "$working_dir/etc/makepkg.conf"
if [[ -d "${makepkg_conf}.d" ]] && is_globfile "${makepkg_conf}.d"/*.conf; then
mkdir --parents "$working_dir/etc/makepkg.conf.d/"
cp "${makepkg_conf}.d/"*.conf "$working_dir/etc/makepkg.conf.d/"
fi
fi
local file
for file in "${files[@]}"; do

View File

@@ -297,4 +297,6 @@ if [[ ${#uploads[*]} -gt 0 ]]; then
unset new_uploads
msg 'Uploading all package and signature files'
rsync "${rsyncopts[@]}" "${uploads[@]}" "$server:staging/$repo/" || die
else
die 'No package to upload'
fi

View File

@@ -42,10 +42,10 @@ pkgctl_build_usage() {
Build packages inside a clean chroot
When a new pkgver is set using the appropriate PKGBUILD options the
checksums are automatically updated.
Build packages in clean chroot environment, offering various options
and functionalities to customize the package building process.
TODO
By default, chroot environments are located in /var/lib/archbuild/.
BUILD OPTIONS
--arch ARCH Specify architectures to build for (disables auto-detection)

View File

@@ -18,6 +18,9 @@ export LANG=C.UTF-8
# Avoid systemd trying to color the terminal on systemd-nspawn
export SYSTEMD_TINT_BACKGROUND=no
# Avoid diffoscope looking at remote debug info through readelf
unset DEBUGINFOD_URLS
# Set buildtool properties
export BUILDTOOL=devtools
export BUILDTOOLVER=@buildtoolver@

View File

@@ -93,14 +93,36 @@ get_makepkg_conf() {
local fname=${1}
local arch="${2}"
local makepkg_conf="${3}"
if ! buildtool_file=$(get_pkgfile "${fname}"); then
error "failed to retrieve ${fname}"
error "failed to retrieve ${fname}"
return 1
fi
buildtool_file="${buildtool_file/file:\/\//}"
msg "using makepkg.conf from ${fname}"
# try to handle config of legacy devtools
if bsdtar --list --file "${buildtool_file}" "usr/share/devtools/makepkg-${arch}.conf" &>/dev/null; then
bsdtar --extract --to-stdout --fast-read --file "${buildtool_file}" "usr/share/devtools/makepkg-${arch}.conf" > "${makepkg_conf}"
return $?
fi
msg2 "extracting ${arch}.conf from devtools archive"
if ! bsdtar --extract --to-stdout --fast-read --file "${buildtool_file}" "usr/share/devtools/makepkg.conf.d/${arch}.conf" > "${makepkg_conf}"; then
error "failed to extract 'usr/share/devtools/makepkg.conf.d/${arch}.conf' from devtools archive"
return 1
fi
msg2 "using makepkg.conf from ${fname}"
if ! bsdtar xOqf "${buildtool_file/file:\/\//}" "usr/share/devtools/makepkg.conf.d/${arch}.conf" > "${makepkg_conf}"; then
bsdtar xOqf "${buildtool_file/file:\/\//}" "usr/share/devtools/makepkg-${arch}.conf" > "${makepkg_conf}"
fi
mkdir --parents "${makepkg_conf}.d"
if bsdtar --list --file "${buildtool_file}" "usr/share/devtools/makepkg.conf.d/conf.d" &>/dev/null; then
msg2 "extracting conf.d from devtools archive"
bsdtar --extract --file "${buildtool_file}" --cd "${makepkg_conf}.d" --strip-components 4 "usr/share/devtools/makepkg.conf.d/conf.d"
fi
if bsdtar --list --file "${buildtool_file}" "usr/share/devtools/makepkg.conf.d/${arch}.conf.d" &>/dev/null; then
msg2 "extracting ${arch}.conf.d from devtools archive"
bsdtar --extract --file "${buildtool_file}" --cd "${makepkg_conf}.d" --strip-components 4 "usr/share/devtools/makepkg.conf.d/${arch}.conf.d"
fi
return 0
}
@@ -186,7 +208,7 @@ for f in "${splitpkgs[@]}"; do
done
if (( ${#cache_dirs[@]} == 0 )); then
mapfile -t cache_dirs < <(pacman-conf CacheDir)
mapfile -t cache_dirs < <(pacman-conf CacheDir)
fi
ORIG_HOME=${HOME}