mirror of
https://gitlab.archlinux.org/archlinux/devtools.git
synced 2025-09-15 10:56:19 +02:00
Compare commits
6 Commits
feature/de
...
211-pkgctl
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d58a992774 | ||
![]() |
4926d9d8c5 | ||
![]() |
7165e0d73e | ||
![]() |
8776dd39e8 | ||
![]() |
fb4bf96d24 | ||
![]() |
96eff02801 |
2
Makefile
2
Makefile
@@ -1,6 +1,6 @@
|
|||||||
SHELL=/bin/bash -o pipefail
|
SHELL=/bin/bash -o pipefail
|
||||||
|
|
||||||
V=1.3.1
|
V=1.3.2
|
||||||
BUILDTOOLVER ?= $(V)
|
BUILDTOOLVER ?= $(V)
|
||||||
|
|
||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
|
@@ -305,6 +305,7 @@ _pkgctl_repo_cmds=(
|
|||||||
clone
|
clone
|
||||||
configure
|
configure
|
||||||
create
|
create
|
||||||
|
pull
|
||||||
switch
|
switch
|
||||||
web
|
web
|
||||||
)
|
)
|
||||||
@@ -334,6 +335,19 @@ _pkgctl_repo_clean_args=(
|
|||||||
)
|
)
|
||||||
_pkgctl_repo_clean_opts() { _filedir -d; }
|
_pkgctl_repo_clean_opts() { _filedir -d; }
|
||||||
|
|
||||||
|
_pkgctl_repo_pull_args=(
|
||||||
|
--discard-changes
|
||||||
|
--show-diff
|
||||||
|
--quiet
|
||||||
|
--autostash
|
||||||
|
-f --force
|
||||||
|
-j --jobs
|
||||||
|
-h --help
|
||||||
|
)
|
||||||
|
_pkgctl_repo_pull_args__jobs_opts() { :; }
|
||||||
|
_pkgctl_repo_pull_args_j_opts() { _pkgctl_repo_pull_args__jobs_opts; }
|
||||||
|
_pkgctl_repo_pull_opts() { _filedir -d; }
|
||||||
|
|
||||||
_pkgctl_repo_configure_args=(
|
_pkgctl_repo_configure_args=(
|
||||||
--protocol
|
--protocol
|
||||||
-j --jobs
|
-j --jobs
|
||||||
|
@@ -228,6 +228,7 @@ _pkgctl_repo_cmds=(
|
|||||||
"clone[Clone a package repository]"
|
"clone[Clone a package repository]"
|
||||||
"configure[Configure a clone according to distro specs]"
|
"configure[Configure a clone according to distro specs]"
|
||||||
"create[Create a new GitLab package repository]"
|
"create[Create a new GitLab package repository]"
|
||||||
|
"pull[Update package repositories from their git remote]"
|
||||||
"switch[Switch a package repository to a specified version]"
|
"switch[Switch a package repository to a specified version]"
|
||||||
"web[Open the packaging repository's website]"
|
"web[Open the packaging repository's website]"
|
||||||
)
|
)
|
||||||
@@ -256,6 +257,17 @@ _pkgctl_repo_clone_args=(
|
|||||||
'*:packages:_devtools_completions_all_packages'
|
'*:packages:_devtools_completions_all_packages'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
_pkgctl_repo_pull_args=(
|
||||||
|
'--discard-changes[Discard changes if index or working tree is dirty]'
|
||||||
|
'--quiet[Disable printing longer terminal output]'
|
||||||
|
'--show-diff[Always enable showing the diff]'
|
||||||
|
'--autostash[Stash before pulling and unstash afterwards]'
|
||||||
|
'(-f --force)'{-f,--force}'[Alias for --discard-changes]'
|
||||||
|
'(-j --jobs)'{-j,--jobs}'[Run up to N jobs in parallel (default: number of processing units)]:jobs:'
|
||||||
|
'(-h --help)'{-h,--help}'[Display usage]'
|
||||||
|
'*:git_dir:_files -/'
|
||||||
|
)
|
||||||
|
|
||||||
_pkgctl_repo_configure_args=(
|
_pkgctl_repo_configure_args=(
|
||||||
'--protocol[Configure remote url to use https]:proto:(https)'
|
'--protocol[Configure remote url to use https]:proto:(https)'
|
||||||
'(-j --jobs)'{-j,--jobs}'[Run up to N jobs in parallel (default: number of processing units)]:jobs:'
|
'(-j --jobs)'{-j,--jobs}'[Run up to N jobs in parallel (default: number of processing units)]:jobs:'
|
||||||
|
@@ -23,7 +23,8 @@ Options
|
|||||||
Location of a pacman config file
|
Location of a pacman config file
|
||||||
|
|
||||||
*-M* <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>::
|
*-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'
|
||||||
|
@@ -49,7 +49,8 @@ Options
|
|||||||
Set the pacman cache directory.
|
Set the pacman cache directory.
|
||||||
|
|
||||||
*-M* <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'.
|
||||||
|
|
||||||
*-l* <chroot>::
|
*-l* <chroot>::
|
||||||
The directory name to use as the chroot namespace
|
The directory name to use as the chroot namespace
|
||||||
|
50
doc/man/pkgctl-repo-pull.1.asciidoc
Normal file
50
doc/man/pkgctl-repo-pull.1.asciidoc
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
pkgctl-repo-pull(1)
|
||||||
|
===================
|
||||||
|
|
||||||
|
Name
|
||||||
|
----
|
||||||
|
pkgctl-repo-pull - Pull in git changes
|
||||||
|
|
||||||
|
Synopsis
|
||||||
|
--------
|
||||||
|
pkgctl repo pull [OPTIONS] [PATH...]
|
||||||
|
|
||||||
|
Description
|
||||||
|
-----------
|
||||||
|
|
||||||
|
Update package repositories from their git remotes.
|
||||||
|
|
||||||
|
If only a single package is given the command also automatically shows a diff
|
||||||
|
of what has changed since the last time the repository was updated.
|
||||||
|
|
||||||
|
Options
|
||||||
|
-------
|
||||||
|
|
||||||
|
*--discard-changes*::
|
||||||
|
Discard changes if the index or working tree was modified. Otherwise abort
|
||||||
|
if anything was modified.
|
||||||
|
|
||||||
|
*--autostash*::
|
||||||
|
Stash before pulling and unstash afterwards
|
||||||
|
|
||||||
|
*--quiet*::
|
||||||
|
Do not show any longer terminal output like diffs.
|
||||||
|
|
||||||
|
*--show-diff*::
|
||||||
|
Show what has changed since the last time the repository was updated. Is
|
||||||
|
automatically set when only one 'PATH' is given.
|
||||||
|
|
||||||
|
*-j, --jobs* 'N'::
|
||||||
|
Run up to N jobs in parallel. By default the number of jobs is equal to the
|
||||||
|
number of available processing units. For sequential processing this option
|
||||||
|
needs to be passed with 1.
|
||||||
|
|
||||||
|
*-h, --help*::
|
||||||
|
Show a help text
|
||||||
|
|
||||||
|
See Also
|
||||||
|
--------
|
||||||
|
|
||||||
|
git-pull(1)
|
||||||
|
|
||||||
|
include::include/footer.asciidoc[]
|
@@ -44,6 +44,9 @@ pkgctl repo configure::
|
|||||||
pkgctl repo create::
|
pkgctl repo create::
|
||||||
Create a new GitLab package repository
|
Create a new GitLab package repository
|
||||||
|
|
||||||
|
pkgctl repo pull::
|
||||||
|
Update package repositories from their git remotes
|
||||||
|
|
||||||
pkgctl repo switch::
|
pkgctl repo switch::
|
||||||
Switch a package repository to a specified version
|
Switch a package repository to a specified version
|
||||||
|
|
||||||
@@ -57,6 +60,7 @@ pkgctl-repo-clean(1)
|
|||||||
pkgctl-repo-clone(1)
|
pkgctl-repo-clone(1)
|
||||||
pkgctl-repo-configure(1)
|
pkgctl-repo-configure(1)
|
||||||
pkgctl-repo-create(1)
|
pkgctl-repo-create(1)
|
||||||
|
pkgctl-repo-pull(1)
|
||||||
pkgctl-repo-switch(1)
|
pkgctl-repo-switch(1)
|
||||||
pkgctl-repo-web(1)
|
pkgctl-repo-web(1)
|
||||||
|
|
||||||
|
@@ -112,7 +112,13 @@ copy_hostconf () {
|
|||||||
[[ -n $host_cachemirrors ]] && printf 'CacheServer = %s\n' "${host_cachemirrors[@]}" >>"$working_dir/etc/pacman.d/mirrorlist"
|
[[ -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 $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
|
local file
|
||||||
for file in "${files[@]}"; do
|
for file in "${files[@]}"; do
|
||||||
|
@@ -31,6 +31,7 @@ pkgctl_repo_usage() {
|
|||||||
clone Clone a package repository
|
clone Clone a package repository
|
||||||
configure Configure a clone according to distro specs
|
configure Configure a clone according to distro specs
|
||||||
create Create a new GitLab package repository
|
create Create a new GitLab package repository
|
||||||
|
pull Update package repositories from their git remote
|
||||||
switch Switch a package repository to a specified version
|
switch Switch a package repository to a specified version
|
||||||
web Open the packaging repository's website
|
web Open the packaging repository's website
|
||||||
|
|
||||||
@@ -40,6 +41,7 @@ pkgctl_repo_usage() {
|
|||||||
EXAMPLES
|
EXAMPLES
|
||||||
$ ${COMMAND} clean --interactive *
|
$ ${COMMAND} clean --interactive *
|
||||||
$ ${COMMAND} clone libfoo linux libbar
|
$ ${COMMAND} clone libfoo linux libbar
|
||||||
|
$ ${COMMAND} pull libfoo linux libbar
|
||||||
$ ${COMMAND} clone --maintainer mynickname
|
$ ${COMMAND} clone --maintainer mynickname
|
||||||
$ ${COMMAND} configure *
|
$ ${COMMAND} configure *
|
||||||
$ ${COMMAND} create libfoo
|
$ ${COMMAND} create libfoo
|
||||||
@@ -101,6 +103,14 @@ pkgctl_repo() {
|
|||||||
pkgctl_repo_switch "$@"
|
pkgctl_repo_switch "$@"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
pull)
|
||||||
|
_DEVTOOLS_COMMAND+=" $1"
|
||||||
|
shift
|
||||||
|
# shellcheck source=src/lib/repo/pull.sh
|
||||||
|
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/repo/pull.sh
|
||||||
|
pkgctl_repo_pull "$@"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
web)
|
web)
|
||||||
_DEVTOOLS_COMMAND+=" $1"
|
_DEVTOOLS_COMMAND+=" $1"
|
||||||
shift
|
shift
|
||||||
|
195
src/lib/repo/pull.sh
Normal file
195
src/lib/repo/pull.sh
Normal file
@@ -0,0 +1,195 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
[[ -z ${DEVTOOLS_INCLUDE_REPO_PULL_SH:-} ]] || return 0
|
||||||
|
DEVTOOLS_INCLUDE_REPO_PULL_SH=1
|
||||||
|
|
||||||
|
_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@}
|
||||||
|
# shellcheck source=src/lib/common.sh
|
||||||
|
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh
|
||||||
|
# shellcheck source=src/lib/util/git.sh
|
||||||
|
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/util/git.sh
|
||||||
|
|
||||||
|
source /usr/share/makepkg/util/message.sh
|
||||||
|
|
||||||
|
set -eo pipefail
|
||||||
|
|
||||||
|
|
||||||
|
pkgctl_repo_pull_usage() {
|
||||||
|
local -r COMMAND=${_DEVTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
|
||||||
|
cat <<- _EOF_
|
||||||
|
Usage: ${COMMAND} [OPTIONS] [PKGBASE]...
|
||||||
|
|
||||||
|
Update package repositories from their git remotes.
|
||||||
|
|
||||||
|
OPTIONS
|
||||||
|
--discard-changes Discard changes if index or working tree is dirty
|
||||||
|
--show-diff Always enable showing the diff
|
||||||
|
--autostash Stash before pulling and unstash afterwards
|
||||||
|
-j, --jobs N Run up to N jobs in parallel (default: $(nproc))
|
||||||
|
--quiet Disable printing longer terminal output
|
||||||
|
-h, --help Show this help text
|
||||||
|
|
||||||
|
EXAMPLES
|
||||||
|
$ ${COMMAND} gopass gopass-jsonapi
|
||||||
|
_EOF_
|
||||||
|
}
|
||||||
|
|
||||||
|
pkgctl_repo_pull() {
|
||||||
|
# options
|
||||||
|
local paths path pkgbase branch jobs remote
|
||||||
|
jobs=$(nproc)
|
||||||
|
local command=${_DEVTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
|
||||||
|
local git_rebase_options=()
|
||||||
|
local SHOW_DIFF=0
|
||||||
|
local QUIET=0
|
||||||
|
local DISCARD_CHANGES=0
|
||||||
|
local AUTOSTASH=0
|
||||||
|
|
||||||
|
while (( $# )); do
|
||||||
|
case $1 in
|
||||||
|
-h|--help)
|
||||||
|
pkgctl_repo_pull_usage
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
--discard-changes)
|
||||||
|
DISCARD_CHANGES=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--show-diff)
|
||||||
|
SHOW_DIFF=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--quiet)
|
||||||
|
QUIET=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--autostash)
|
||||||
|
AUTOSTASH=1
|
||||||
|
git_rebase_options+=(--autostash)
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-j|--jobs)
|
||||||
|
(( $# <= 1 )) && die "missing argument for %s" "$1"
|
||||||
|
jobs=$2
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
--)
|
||||||
|
shift
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
-*)
|
||||||
|
die "invalid argument: %s" "$1"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
paths=("$@")
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# check if invoked without any path from within a packaging repo
|
||||||
|
if (( ${#paths[@]} == 0 )); then
|
||||||
|
paths=(".")
|
||||||
|
fi
|
||||||
|
|
||||||
|
# check if we are only working on one repo and enable
|
||||||
|
if (( ${#paths[@]} == 1 )) && (( ! QUIET )); then
|
||||||
|
SHOW_DIFF=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# parallelization
|
||||||
|
if [[ ${jobs} != 1 ]] && (( ${#paths[@]} > 1 )); then
|
||||||
|
if [[ -n ${BOLD} ]]; then
|
||||||
|
export DEVTOOLS_COLOR=always
|
||||||
|
fi
|
||||||
|
|
||||||
|
# warm up ssh connection as it may require user input (key unlock, hostkey verification etc)
|
||||||
|
git_warmup_ssh_connection
|
||||||
|
|
||||||
|
# disable diffs if not enabled explicitly
|
||||||
|
if (( ! SHOW_DIFF )); then
|
||||||
|
command+=" --quiet"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( DISCARD_CHANGES )); then
|
||||||
|
command+=" --discard-changes"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( AUTOSTASH )); then
|
||||||
|
command+=" --autostash"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! parallel --bar --jobs "${jobs}" "${command}" ::: "${paths[@]}"; then
|
||||||
|
die 'Failed to pull some packages, please check the previous output'
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
for path in "${paths[@]}"; do
|
||||||
|
# skip paths that are not directories
|
||||||
|
if [[ ! -d "${path}" ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -f "${path}/PKGBUILD" ]]; then
|
||||||
|
msg_error " Not a package repository: ${path}"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -d "${path}/.git" ]]; then
|
||||||
|
msg_error " Not a Git repository: ${path}"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
pkgbase=$(basename "$(realpath "${path}")")
|
||||||
|
pkgbase=${pkgbase%.git}
|
||||||
|
msg "Updating ${pkgbase}"
|
||||||
|
|
||||||
|
branch=$(git -C "${path}" symbolic-ref --quiet --short HEAD)
|
||||||
|
if [[ ${branch} != main ]]; then
|
||||||
|
msg_warn " Current branch is ${branch}, not updating from canonical upstream: ${pkgbase}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! git -C "${path}" diff-files --quiet && (( ! AUTOSTASH )) && (( ! DISCARD_CHANGES )); then
|
||||||
|
msg_error " Index contains unstaged changes, please stash them or pass --autostash before pulling: ${pkgbase}"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! git -C "${path}" diff-index --cached --quiet HEAD && (( ! AUTOSTASH )) && (( ! DISCARD_CHANGES )); then
|
||||||
|
msg_error " Index contains uncommited changes, please commit or stash them before pulling: ${pkgbase}"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
remote=$(git -C "${path}" config "branch.${branch}.remote")
|
||||||
|
if [[ -z "${remote}" ]]; then
|
||||||
|
msg_error " No upstream tracking branch configured: ${pkgbase}"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! git -C "${path}" fetch --quiet "${remote}"; then
|
||||||
|
msg_error " Error while fetching: ${pkgbase}"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $(git -C "${path}" rev-parse HEAD) == $(git -C "${path}" rev-parse FETCH_HEAD) ]]; then
|
||||||
|
msg2 "Repo is up to date, nothing to do"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
# discard any local modifications
|
||||||
|
if (( DISCARD_CHANGES )); then
|
||||||
|
git -C "${path}" restore --staged --worktree -- .
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( SHOW_DIFF )) && (( ! QUIET )); then
|
||||||
|
git -C "${path}" --no-pager diff --color --patch-with-stat HEAD..FETCH_HEAD
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! git -C "${path}" rebase --quiet "${git_rebase_options[@]}" "${remote}/${branch}"; then
|
||||||
|
msg_error " Error while pulling in the changes for ${pkgbase}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
@@ -93,14 +93,36 @@ get_makepkg_conf() {
|
|||||||
local fname=${1}
|
local fname=${1}
|
||||||
local arch="${2}"
|
local arch="${2}"
|
||||||
local makepkg_conf="${3}"
|
local makepkg_conf="${3}"
|
||||||
|
|
||||||
if ! buildtool_file=$(get_pkgfile "${fname}"); then
|
if ! buildtool_file=$(get_pkgfile "${fname}"); then
|
||||||
error "failed to retrieve ${fname}"
|
error "failed to retrieve ${fname}"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
msg2 "using makepkg.conf from ${fname}"
|
buildtool_file="${buildtool_file/file:\/\//}"
|
||||||
if ! bsdtar xOqf "${buildtool_file/file:\/\//}" "usr/share/devtools/makepkg.conf.d/${arch}.conf" > "${makepkg_conf}"; then
|
msg "using makepkg.conf from ${fname}"
|
||||||
bsdtar xOqf "${buildtool_file/file:\/\//}" "usr/share/devtools/makepkg-${arch}.conf" > "${makepkg_conf}"
|
|
||||||
|
# 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
|
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
|
||||||
|
|
||||||
|
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
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,4 +0,0 @@
|
|||||||
install:
|
|
||||||
rm -rf src/devtools-local
|
|
||||||
makepkg -f
|
|
||||||
sudo pacman --noconfirm -U $(makepkg --packagelist | head -1)
|
|
@@ -1,67 +0,0 @@
|
|||||||
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
|
|
||||||
# Contributor: Pierre Schmitz <pierre@archlinux.de>
|
|
||||||
|
|
||||||
pkgname=devtools
|
|
||||||
branch=master
|
|
||||||
pkgver=1.3.1.r4.g79c3162
|
|
||||||
pkgrel=1
|
|
||||||
pkgdesc='Tools for Arch Linux package maintainers'
|
|
||||||
arch=('any')
|
|
||||||
license=('GPL')
|
|
||||||
url='https://gitlab.archlinux.org/archlinux/devtools'
|
|
||||||
depends=(
|
|
||||||
arch-install-scripts
|
|
||||||
awk
|
|
||||||
bash
|
|
||||||
binutils
|
|
||||||
coreutils
|
|
||||||
diffutils
|
|
||||||
fakeroot
|
|
||||||
findutils
|
|
||||||
grep
|
|
||||||
jq
|
|
||||||
openssh
|
|
||||||
parallel
|
|
||||||
rsync
|
|
||||||
sed
|
|
||||||
util-linux
|
|
||||||
|
|
||||||
bzr
|
|
||||||
git
|
|
||||||
mercurial
|
|
||||||
subversion
|
|
||||||
)
|
|
||||||
makedepends=(
|
|
||||||
asciidoc
|
|
||||||
shellcheck
|
|
||||||
)
|
|
||||||
optdepends=('btrfs-progs: btrfs support')
|
|
||||||
source=(devtools-local::"git+file://$PWD/../.git#branch=${branch}")
|
|
||||||
validpgpkeys=(
|
|
||||||
'4AA4767BBC9C4B1D18AE28B77F2D434B9741E8AC' # Pierre Schmitz <pierre@archlinux.org>
|
|
||||||
'86CFFCA918CF3AF47147588051E8B148A9999C34' # Evangelos Foutras <foutrelis@archlinux.org>
|
|
||||||
'8FC15A064950A99DD1BD14DD39E4B877E62EB915' # Sven-Hendrik Haase <svenstaro@archlinux.org>
|
|
||||||
'A2FF3A36AAA56654109064AB19802F8B0D70FC30' # Jan Alexander Steffens (heftig) <heftig@archlinux.org>
|
|
||||||
'B81B051F2D7FC867AAFF35A58DBD63B82072D77A' # Sébastien Luttringer <seblu@archlinux.org>
|
|
||||||
'6645B0A8C7005E78DB1D7864F99FFE0FEAE999BD' # Allan McRae (Developer) <allan@archlinux.org>
|
|
||||||
'E240B57E2C4630BA768E2F26FC1B547C8D8172C8' # Levente Polyak <anthraxx@archlinux.org>
|
|
||||||
)
|
|
||||||
sha256sums=('SKIP')
|
|
||||||
b2sums=('SKIP')
|
|
||||||
|
|
||||||
pkgver() {
|
|
||||||
cd ${pkgname}-local
|
|
||||||
git describe --long --tags | sed -E 's,^[^0-9]*,,;s,([^-]*-g),r\1,;s,-,.,g'
|
|
||||||
}
|
|
||||||
|
|
||||||
build() {
|
|
||||||
cd ${pkgname}-local
|
|
||||||
make BUILDTOOLVER="${epoch}:${pkgver}-${pkgrel}-${arch}" PREFIX=/usr
|
|
||||||
}
|
|
||||||
|
|
||||||
package() {
|
|
||||||
cd ${pkgname}-local
|
|
||||||
make PREFIX=/usr DESTDIR="${pkgdir}" install
|
|
||||||
}
|
|
||||||
|
|
||||||
# vim: ts=2 sw=2 et:
|
|
Reference in New Issue
Block a user