mirror of
https://gitlab.archlinux.org/archlinux/devtools.git
synced 2025-09-13 01:46:19 +02:00
Compare commits
27 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a49f55cbed | ||
![]() |
5c016c38f2 | ||
![]() |
1d4a60874b | ||
![]() |
b66ce081e7 | ||
![]() |
1ab9b34c4c | ||
![]() |
ebba5a5885 | ||
![]() |
c9b6f58f8e | ||
![]() |
155798b8b1 | ||
![]() |
d9b7350448 | ||
![]() |
6645701cb1 | ||
![]() |
657497c91a | ||
![]() |
90bb423304 | ||
![]() |
23f248ccfb | ||
![]() |
eeb1c0e59e | ||
![]() |
936ff8da2f | ||
![]() |
d123fee8ec | ||
![]() |
4a532e38e7 | ||
![]() |
f61421a3f5 | ||
![]() |
26b2ffc665 | ||
![]() |
62306018f2 | ||
![]() |
65b50dac40 | ||
![]() |
799376904d | ||
![]() |
8310abb348 | ||
![]() |
7b09525003 | ||
![]() |
e9102b2ad8 | ||
![]() |
99969c67a9 | ||
![]() |
05c81038e5 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -3,7 +3,6 @@ devtools-*.tar.gz*
|
||||
archbuild
|
||||
archco
|
||||
archrelease
|
||||
archrm
|
||||
bash_completion
|
||||
checkpkg
|
||||
commitpkg
|
||||
@@ -16,3 +15,4 @@ zsh_completion
|
||||
find-libdeps
|
||||
crossrepomove
|
||||
arch-nspawn
|
||||
doc/*.1
|
||||
|
28
.travis.yml
Normal file
28
.travis.yml
Normal file
@@ -0,0 +1,28 @@
|
||||
language: shell
|
||||
sudo: required
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
||||
arch:
|
||||
packages:
|
||||
- openssh
|
||||
- subversion
|
||||
- rsync
|
||||
- arch-install-scripts
|
||||
- git
|
||||
- bzr
|
||||
- mercurial
|
||||
- diffutils
|
||||
- asciidoc
|
||||
- shellcheck
|
||||
script:
|
||||
- sudo pacman -Syu --noconfirm --needed "${CONFIG_PACKAGES[@]}"
|
||||
- make PREFIX=/usr
|
||||
- make PREFIX=/usr DESTDIR="$(mktemp -d)" install
|
||||
- make check || true
|
||||
- SHELLCHECK_OPTS="-S error" make check
|
||||
|
||||
script: 'curl -s https://raw.githubusercontent.com/mikkeloscar/arch-travis/master/arch-travis.sh | bash'
|
||||
|
||||
# vim: ft=yaml ts=2 sw=2 et:
|
36
Makefile
36
Makefile
@@ -1,13 +1,13 @@
|
||||
V=20180531
|
||||
V=20190329
|
||||
|
||||
PREFIX = /usr/local
|
||||
MANDIR = $(PREFIX)/share/man
|
||||
|
||||
BINPROGS = \
|
||||
IN_PROGS = \
|
||||
checkpkg \
|
||||
commitpkg \
|
||||
archco \
|
||||
archrelease \
|
||||
archrm \
|
||||
archbuild \
|
||||
lddd \
|
||||
finddeps \
|
||||
@@ -18,6 +18,10 @@ BINPROGS = \
|
||||
mkarchroot \
|
||||
makechrootpkg
|
||||
|
||||
BINPROGS = \
|
||||
$(IN_PROGS) \
|
||||
sogrep
|
||||
|
||||
CONFIGFILES = \
|
||||
makepkg-x86_64.conf \
|
||||
pacman-extra.conf \
|
||||
@@ -60,7 +64,18 @@ BASHCOMPLETION_LINKS = \
|
||||
archco \
|
||||
communityco
|
||||
|
||||
all: $(BINPROGS) bash_completion zsh_completion
|
||||
|
||||
MANS = \
|
||||
doc/lddd.1 \
|
||||
doc/checkpkg.1 \
|
||||
doc/sogrep.1 \
|
||||
doc/mkarchroot.1 \
|
||||
doc/find-libdeps.1 \
|
||||
doc/find-libprovides.1
|
||||
|
||||
|
||||
all: $(BINPROGS) bash_completion zsh_completion man
|
||||
man: $(MANS)
|
||||
|
||||
edit = sed -e "s|@pkgdatadir[@]|$(DESTDIR)$(PREFIX)/share/devtools|g"
|
||||
|
||||
@@ -72,8 +87,13 @@ edit = sed -e "s|@pkgdatadir[@]|$(DESTDIR)$(PREFIX)/share/devtools|g"
|
||||
@chmod +x "$@"
|
||||
@bash -O extglob -n "$@"
|
||||
|
||||
$(MANS): doc/asciidoc.conf doc/footer.asciidoc
|
||||
|
||||
doc/%: doc/%.asciidoc
|
||||
a2x --no-xmllint --asciidoc-opts="-f doc/asciidoc.conf" -d manpage -f manpage -D doc $<
|
||||
|
||||
clean:
|
||||
rm -f $(BINPROGS) bash_completion zsh_completion
|
||||
rm -f $(IN_PROGS) bash_completion zsh_completion $(MANS)
|
||||
|
||||
install:
|
||||
install -dm0755 $(DESTDIR)$(PREFIX)/bin
|
||||
@@ -88,6 +108,9 @@ install:
|
||||
for l in ${BASHCOMPLETION_LINKS}; do ln -sf devtools $(DESTDIR)/usr/share/bash-completion/completions/$$l; done
|
||||
install -Dm0644 zsh_completion $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_devtools
|
||||
ln -sf archco $(DESTDIR)$(PREFIX)/bin/communityco
|
||||
for manfile in $(MANS); do \
|
||||
install -Dm644 $$manfile -t $(DESTDIR)$(MANDIR)/man$${manfile##*.}; \
|
||||
done;
|
||||
|
||||
uninstall:
|
||||
for f in ${BINPROGS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
|
||||
@@ -99,6 +122,9 @@ uninstall:
|
||||
rm $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_devtools
|
||||
rm -f $(DESTDIR)$(PREFIX)/bin/communityco
|
||||
rm -f $(DESTDIR)$(PREFIX)/bin/find-libprovides
|
||||
for manfile in $(MANS); do \
|
||||
rm -f $(DESTDIR)$(MANDIR)/man$${manfile##*.}/$${manfile#doc/}; \
|
||||
done;
|
||||
|
||||
dist:
|
||||
git archive --format=tar --prefix=devtools-$(V)/ $(V) | gzip -9 > devtools-$(V).tar.gz
|
||||
|
24
README.md
Normal file
24
README.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# Devtools - development tools for Arch Linux
|
||||
|
||||
This repository contains tools for the Arch Linux distribution for building
|
||||
and maintaining official repository packages.
|
||||
|
||||
## Patches
|
||||
|
||||
Patches can be send to arch-projects@archlinux.org or via a pull request on
|
||||
Github. When sending patches to the mailing list make sure to set a valid
|
||||
subjectprefix otherwise the email is denied by mailman. Git can be configured
|
||||
as following.
|
||||
|
||||
```
|
||||
git config format.subjectprefix 'devtools] [PATCH'
|
||||
```
|
||||
|
||||
## Releasing
|
||||
|
||||
1. bump the version in the Makefile
|
||||
2. Commit everything as ```Version $(date +"%Y%m%d")```
|
||||
3. Create a new tag ```git tag -s $(date +"%Y%m%d")```
|
||||
4. Push changes
|
||||
5. Upload the source tarball with ```make dist upload```
|
||||
6. Update the package
|
@@ -60,17 +60,19 @@ fi
|
||||
|
||||
pacconf_cmd=$(command -v pacman-conf || command -v pacconf)
|
||||
# shellcheck disable=2016
|
||||
host_mirror=$($pacconf_cmd --repo extra Server 2> /dev/null | head -1 | sed -r 's#(.*/)extra/os/.*#\1$repo/os/$arch#')
|
||||
host_mirrors=($($pacconf_cmd --repo extra Server 2> /dev/null | sed -r 's#(.*/)extra/os/.*#\1$repo/os/$arch#'))
|
||||
# shellcheck disable=2016
|
||||
[[ $host_mirror == *file://* ]] && host_mirror_path=$(echo "$host_mirror" | sed -r 's#file://(/.*)/\$repo/os/\$arch#\1#g')
|
||||
|
||||
# {{{ functions
|
||||
build_mount_args() {
|
||||
declare -g mount_args=()
|
||||
|
||||
if [[ -n $host_mirror_path ]]; then
|
||||
mount_args+=("--bind-ro=$host_mirror_path")
|
||||
fi
|
||||
for host_mirror in "${host_mirrors[@]}"; do
|
||||
if [[ $host_mirror == *file://* ]]; then
|
||||
host_mirror_path=$(echo "$host_mirror" | sed -r 's#file://(/.*)/\$repo/os/\$arch#\1#g')
|
||||
mount_args+=("--bind-ro=$host_mirror_path")
|
||||
fi
|
||||
done
|
||||
|
||||
mount_args+=("--bind=${cache_dirs[0]}")
|
||||
|
||||
@@ -81,7 +83,7 @@ build_mount_args() {
|
||||
|
||||
copy_hostconf () {
|
||||
cp -a /etc/pacman.d/gnupg "$working_dir/etc/pacman.d"
|
||||
echo "Server = $host_mirror" >"$working_dir/etc/pacman.d/mirrorlist"
|
||||
printf 'Server = %s\n' "${host_mirrors[@]}" >"$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"
|
||||
|
@@ -39,7 +39,7 @@ while getopts 'hcr:' arg; do
|
||||
esac
|
||||
done
|
||||
|
||||
check_root SOURCE_DATE_EPOCH
|
||||
check_root SOURCE_DATE_EPOCH,SRCDEST,SRCPKGDEST,PKGDEST,LOGDEST,MAKEFLAGS,PACKAGER,GNUPGHOME
|
||||
|
||||
# Pass all arguments after -- right to makepkg
|
||||
makechrootpkg_args+=("${@:$OPTIND}")
|
||||
|
16
archrm.in
16
archrm.in
@@ -1,16 +0,0 @@
|
||||
#!/bin/bash
|
||||
# License: Unspecified
|
||||
|
||||
m4_include(lib/common.sh)
|
||||
|
||||
if [[ -z $1 ]]; then
|
||||
echo 'Usage: archrm <path to checkout>'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# FIXME: Check if there are uncommited changes
|
||||
#pushd $1
|
||||
#
|
||||
#popd
|
||||
|
||||
rm -rf "$1"
|
@@ -64,7 +64,6 @@ done
|
||||
|
||||
msg "Adding %s to %s" "${pkgbase}" "${target_repo}"
|
||||
svn -q add "target_checkout/${pkgbase}"
|
||||
svn -q propset svn:keywords 'Id' "target_checkout/${pkgbase}/trunk/PKGBUILD"
|
||||
svn -q commit -m"${scriptname}: Moving ${pkgbase} from ${source_repo} to ${target_repo}" target_checkout
|
||||
pushd "target_checkout/${pkgbase}/trunk" >/dev/null
|
||||
archrelease "${arch[@]/#/$target_repo-}" || die
|
||||
|
37
doc/asciidoc.conf
Normal file
37
doc/asciidoc.conf
Normal file
@@ -0,0 +1,37 @@
|
||||
## linkman: macro
|
||||
# Inspired by/borrowed from the GIT source tree at Documentation/asciidoc.conf
|
||||
#
|
||||
# Usage: linkman:command[manpage-section]
|
||||
#
|
||||
# Note, {0} is the manpage section, while {target} is the command.
|
||||
#
|
||||
# Show man link as: <command>(<section>); if section is defined, else just show
|
||||
# the command.
|
||||
|
||||
[macros]
|
||||
(?su)[\\]?(?P<name>linkman):(?P<target>\S*?)\[(?P<attrlist>.*?)\]=
|
||||
|
||||
[attributes]
|
||||
asterisk=*
|
||||
plus=+
|
||||
caret=^
|
||||
startsb=[
|
||||
endsb=]
|
||||
backslash=\
|
||||
tilde=~
|
||||
apostrophe='
|
||||
backtick=`
|
||||
litdd=--
|
||||
|
||||
ifdef::backend-docbook[]
|
||||
[linkman-inlinemacro]
|
||||
{0%{target}}
|
||||
{0#<citerefentry>}
|
||||
{0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>}
|
||||
{0#</citerefentry>}
|
||||
endif::backend-docbook[]
|
||||
|
||||
ifdef::backend-xhtml11[]
|
||||
[linkman-inlinemacro]
|
||||
<a href="{target}.{0}.html">{target}{0?({0})}</a>
|
||||
endif::backend-xhtml11[]
|
27
doc/checkpkg.1.asciidoc
Normal file
27
doc/checkpkg.1.asciidoc
Normal file
@@ -0,0 +1,27 @@
|
||||
checkpkg(1)
|
||||
===========
|
||||
|
||||
Name
|
||||
----
|
||||
checkpkg - Compare the current build package with the repository version
|
||||
|
||||
Synopsis
|
||||
--------
|
||||
checkpkg
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
Searches for a locally built package corresponding to the PKGBUILD, and
|
||||
downloads the last version of that package from the Pacman repositories. It
|
||||
then compares the list of .so files provided by each version of the package and
|
||||
outputs if there are soname differences for the new package. A directory is
|
||||
also created using mktemp with files containing a file list for both packages
|
||||
and a library list for both packages.
|
||||
|
||||
See Also
|
||||
--------
|
||||
|
||||
linkman:find-libprovides[1]
|
||||
|
||||
include::footer.asciidoc[]
|
24
doc/find-libdeps.1.asciidoc
Normal file
24
doc/find-libdeps.1.asciidoc
Normal file
@@ -0,0 +1,24 @@
|
||||
find-libdeps(1)
|
||||
===============
|
||||
|
||||
Name
|
||||
----
|
||||
find-libdeps - Find soname dependencies for a package
|
||||
|
||||
Synopsis
|
||||
--------
|
||||
find-libdeps [options]
|
||||
|
||||
Description
|
||||
-----------
|
||||
Finds soname dependencies of a package and prints out a list in the following
|
||||
format '<soname>=<soversion>-<soarch>'.
|
||||
|
||||
Options
|
||||
-------
|
||||
|
||||
*--ignore-internal*::
|
||||
Ignore internal libraries.
|
||||
|
||||
|
||||
include::footer.asciidoc[]
|
24
doc/find-libprovides.1.asciidoc
Normal file
24
doc/find-libprovides.1.asciidoc
Normal file
@@ -0,0 +1,24 @@
|
||||
find-libprovides(1)
|
||||
===================
|
||||
|
||||
Name
|
||||
----
|
||||
find-libprovides - Find soname's which are provided by a package
|
||||
|
||||
Synopsis
|
||||
--------
|
||||
find-libprovides [options]
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
Finds soname's provided by a package and prints out a list in the following
|
||||
format '<soname>=<soversion>-<soarch>'.
|
||||
|
||||
Options
|
||||
-------
|
||||
|
||||
*--ignore-internal*::
|
||||
Ignore internal libraries.
|
||||
|
||||
include::footer.asciidoc[]
|
29
doc/footer.asciidoc
Normal file
29
doc/footer.asciidoc
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
Bugs
|
||||
----
|
||||
Bugs can be reported on the bug tracker 'https://bugs.archlinux.org' in the Arch
|
||||
Linux category and title prefixed with [devtools] or via
|
||||
mailto:arch-projects@archlinux.org[].
|
||||
|
||||
|
||||
Authors
|
||||
-------
|
||||
|
||||
Maintainers:
|
||||
|
||||
* Aaron Griffin <aaronmgriffin@gmail.com>
|
||||
* Allan McRae <allan@archlinux.org>
|
||||
* Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
|
||||
* Dan McGee <dan@archlinux.org>
|
||||
* Dave Reisner <dreisner@archlinux.org>
|
||||
* Evangelos Foutras <evangelos@foutrelis.com>
|
||||
* Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
|
||||
* Jelle van der Waa <jelle@archlinux.org>
|
||||
* Levente Polyak <anthraxx@archlinux.org>
|
||||
* Pierre Schmitz <pierre@archlinux.de>
|
||||
* Sébastien Luttringer <seblu@seblu.net>
|
||||
* Sven-Hendrik Haase <svenstaro@gmail.com>
|
||||
* Thomas Bächler <thomas@archlinux.org>
|
||||
|
||||
For additional contributors, use `git shortlog -s` on the devtools.git
|
||||
repository.
|
25
doc/lddd.1.asciidoc
Normal file
25
doc/lddd.1.asciidoc
Normal file
@@ -0,0 +1,25 @@
|
||||
lddd(1)
|
||||
=======
|
||||
|
||||
Name
|
||||
----
|
||||
lddd - Find broken library links on your system
|
||||
|
||||
Synopsis
|
||||
--------
|
||||
lddd
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
Scans '$PATH', '/lib', '/usr/lib', '/usr/local/lib' and
|
||||
'/etc/ld.so.conf.d/*.conf' directories for ELF files with references to missing
|
||||
shared libraries, and suggests which packages might need to be rebuilt. The
|
||||
collected data is written to a temporary directory created by mktemp.
|
||||
|
||||
See Also
|
||||
--------
|
||||
|
||||
linkman:ldd[1]
|
||||
|
||||
include::footer.asciidoc[]
|
46
doc/mkarchroot.1.asciidoc
Normal file
46
doc/mkarchroot.1.asciidoc
Normal file
@@ -0,0 +1,46 @@
|
||||
mkarchroot(1)
|
||||
==============
|
||||
|
||||
Name
|
||||
----
|
||||
mkarchroot - Creates an arch chroot in a specified location with a specified set of packages
|
||||
|
||||
Synopsis
|
||||
--------
|
||||
mkarchroot [options] [location] [packages]
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
'mkarchroot' is a script to create an Arch Linux chroot at a specified location
|
||||
with specified packages. Typically used by 'makechrootpkg' to create build
|
||||
chroots. Apart from installing specified packages the chroot is created with an
|
||||
en_US.UTF-8 and de_DE.UTF-8 locale and a generated machine-id.
|
||||
|
||||
Options
|
||||
-------
|
||||
|
||||
*-C* <file>::
|
||||
Location of a pacman config file.
|
||||
|
||||
*-M* <file>::
|
||||
Location of a makepkg config file.
|
||||
|
||||
*-c* <dir>::
|
||||
Set pacman cache.
|
||||
|
||||
*-f* <file>::
|
||||
Copy file from the host to the chroot.
|
||||
|
||||
*-s*::
|
||||
Do not run setarch.
|
||||
|
||||
*-h*::
|
||||
Output command line options.
|
||||
|
||||
See Also
|
||||
--------
|
||||
|
||||
linkman:pacman[1]
|
||||
|
||||
include::footer.asciidoc[]
|
48
doc/sogrep.1.asciidoc
Normal file
48
doc/sogrep.1.asciidoc
Normal file
@@ -0,0 +1,48 @@
|
||||
sogrep(1)
|
||||
=========
|
||||
|
||||
Name
|
||||
----
|
||||
sogrep - Find shared library links in an Arch Linux repository
|
||||
|
||||
Synopsis
|
||||
--------
|
||||
sogrep [options] repo libname
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
Check the soname links database for Arch Linux repositories containing packages
|
||||
linked to a given shared library. If the repository specified is "all", then
|
||||
all repositories will be searched, otherwise only the named repository will be
|
||||
searched.
|
||||
|
||||
If the links database does not exist, it will be downloaded first.
|
||||
|
||||
Options
|
||||
-------
|
||||
|
||||
*-v, --verbose*::
|
||||
Provide detailed output containing the matched links for each package, the
|
||||
repository it came from (in the event that all repositories are being
|
||||
searched), and, in combination with `-r`, a progress bar for the links
|
||||
database download.
|
||||
|
||||
*-r, --refresh*::
|
||||
Refresh the links databases
|
||||
|
||||
*-h, --help*::
|
||||
Show a help text
|
||||
|
||||
|
||||
Environment Variables
|
||||
---------------------
|
||||
**SOLINKS_MIRROR**="https://mirror.foo.com"
|
||||
Alternative mirror to use for downloading soname links database.
|
||||
|
||||
**SOCACHE_DIR**="/path/to/directory"::
|
||||
Directory where soname links database is stored, overrides the default
|
||||
directory set by the **XDG_CACHE_HOME** environment variable or the
|
||||
**HOME** environment variable if **XDG_CACHE_HOME** is not set.
|
||||
|
||||
include::footer.asciidoc[]
|
@@ -46,7 +46,7 @@ process_sofile() {
|
||||
# extract the major version: 1
|
||||
soversion="${sofile##*\.so\.}"
|
||||
if [[ "$soversion" = "$sofile" ]] && ((IGNORE_INTERNAL)); then
|
||||
continue
|
||||
return
|
||||
fi
|
||||
if ! in_array "${soname}=${soversion}-${soarch}" "${soobjects[@]}"; then
|
||||
# libfoo.so=1-64
|
||||
@@ -57,7 +57,7 @@ process_sofile() {
|
||||
|
||||
case $script_mode in
|
||||
deps) find_args=(-perm -u+x);;
|
||||
provides) find_args=(-name '*.so*');;
|
||||
provides) find_args=(-name '*.so*');;
|
||||
esac
|
||||
|
||||
find . -type f "${find_args[@]}" | while read -r filename; do
|
||||
|
@@ -250,18 +250,14 @@ download_sources() {
|
||||
local copydir=$1
|
||||
local makepkg_user=$2
|
||||
|
||||
local builddir
|
||||
builddir="$(mktemp -d)"
|
||||
chown "$makepkg_user:" "$builddir"
|
||||
setup_workdir
|
||||
chown "$makepkg_user:" "$WORKDIR"
|
||||
|
||||
# Ensure sources are downloaded
|
||||
sudo -u "$makepkg_user" --preserve-env=GNUPGHOME \
|
||||
env SRCDEST="$SRCDEST" BUILDDIR="$builddir" \
|
||||
env SRCDEST="$SRCDEST" BUILDDIR="$WORKDIR" \
|
||||
makepkg --config="$copydir/etc/makepkg.conf" --verifysource -o ||
|
||||
die "Could not download sources."
|
||||
|
||||
# Clean up garbage from verifysource
|
||||
rm -rf "$builddir"
|
||||
}
|
||||
|
||||
# Usage: move_products $copydir $owner
|
||||
@@ -345,7 +341,7 @@ main() {
|
||||
[[ -n $makepkg_user && -z $(id -u "$makepkg_user") ]] && die 'Invalid makepkg user.'
|
||||
makepkg_user=${makepkg_user:-${SUDO_USER:-$USER}}
|
||||
|
||||
check_root SOURCE_DATE_EPOCH,GNUPGHOME
|
||||
check_root SOURCE_DATE_EPOCH,GNUPGHOME,SRCDEST,SRCPKGDEST,PKGDEST,LOGDEST,MAKEFLAGS,PACKAGER
|
||||
|
||||
# Canonicalize chrootdir, getting rid of trailing /
|
||||
chrootdir=$(readlink -e "$passeddir")
|
||||
|
@@ -11,9 +11,10 @@
|
||||
#
|
||||
#-- The download utilities that makepkg should use to acquire sources
|
||||
# Format: 'protocol::agent'
|
||||
DLAGENTS=('ftp::/usr/bin/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
|
||||
'http::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u'
|
||||
'https::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u'
|
||||
DLAGENTS=('file::/usr/bin/curl -gqC - -o %o %u'
|
||||
'ftp::/usr/bin/curl -gqfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
|
||||
'http::/usr/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
|
||||
'https::/usr/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
|
||||
'rsync::/usr/bin/rsync --no-motd -z %u %o'
|
||||
'scp::/usr/bin/scp -C %u %o')
|
||||
|
||||
@@ -37,11 +38,9 @@ CARCH="x86_64"
|
||||
CHOST="x86_64-pc-linux-gnu"
|
||||
|
||||
#-- Compiler and Linker Flags
|
||||
# -march (or -mcpu) builds exclusively for an architecture
|
||||
# -mtune optimizes for an architecture, but builds for whole processor family
|
||||
CPPFLAGS="-D_FORTIFY_SOURCE=2"
|
||||
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt"
|
||||
CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt"
|
||||
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt"
|
||||
CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt"
|
||||
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
|
||||
#-- Make Flags: change this for DistCC/SMP systems
|
||||
#MAKEFLAGS="-j2"
|
||||
@@ -53,7 +52,7 @@ DEBUG_CXXFLAGS="-g -fvar-tracking-assignments"
|
||||
# BUILD ENVIRONMENT
|
||||
#########################################################################
|
||||
#
|
||||
# Defaults: BUILDENV=(!distcc color !ccache check !sign)
|
||||
# Defaults: BUILDENV=(!distcc !color !ccache check !sign)
|
||||
# A negated environment option will do the opposite of the comments below.
|
||||
#
|
||||
#-- distcc: Use the Distributed C/C++/ObjC compiler
|
||||
@@ -76,7 +75,7 @@ BUILDENV=(!distcc color !ccache check !sign)
|
||||
# These are default values for the options=() settings
|
||||
#########################################################################
|
||||
#
|
||||
# Default: OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !optipng !upx !debug)
|
||||
# Default: OPTIONS=(!strip docs libtool staticlibs emptydirs !zipman !purge !debug)
|
||||
# A negated option will do the opposite of the comments below.
|
||||
#
|
||||
#-- strip: Strip symbols from binaries/libraries
|
||||
@@ -86,11 +85,9 @@ BUILDENV=(!distcc color !ccache check !sign)
|
||||
#-- emptydirs: Leave empty directories in packages
|
||||
#-- zipman: Compress manual (man and info) pages in MAN_DIRS with gzip
|
||||
#-- purge: Remove files specified by PURGE_TARGETS
|
||||
#-- upx: Compress binary executable files using UPX
|
||||
#-- optipng: Optimize PNG images with optipng
|
||||
#-- debug: Add debugging flags as specified in DEBUG_* variables
|
||||
#
|
||||
OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !optipng !upx !debug)
|
||||
OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !debug)
|
||||
|
||||
#-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512
|
||||
INTEGRITY_CHECK=(md5)
|
||||
@@ -106,6 +103,8 @@ MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info})
|
||||
DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc})
|
||||
#-- Files to be removed from all packages (if purge is specified)
|
||||
PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)
|
||||
#-- Directory to store source code in for debug packages
|
||||
DBGSRCDIR="/usr/src/debug"
|
||||
|
||||
#########################################################################
|
||||
# PACKAGE OUTPUT
|
||||
|
149
sogrep
Executable file
149
sogrep
Executable file
@@ -0,0 +1,149 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# sogrep - find shared library links in an Arch Linux repository.
|
||||
#
|
||||
# Copyright (c) 2019 by Eli Schwartz <eschwartz@archlinux.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
# globals
|
||||
: ${SOLINKS_MIRROR:="https://mirror.pkgbuild.com"}
|
||||
: ${SOCACHE_DIR:="${XDG_CACHE_HOME:-${HOME}/.cache}/sogrep"}
|
||||
repos=('staging' 'testing' 'core' 'extra'
|
||||
'community-staging' 'community-testing' 'community'
|
||||
'multilib-staging' 'multilib-testing' 'multilib'
|
||||
'gnome-unstable' 'kde-unstable')
|
||||
arches=('x86_64')
|
||||
|
||||
# options
|
||||
REFRESH=0
|
||||
VERBOSE=0
|
||||
|
||||
source /usr/share/makepkg/util/parseopts.sh
|
||||
source /usr/share/makepkg/util/util.sh
|
||||
|
||||
recache() {
|
||||
local repo arch verbosity=-s
|
||||
|
||||
(( VERBOSE )) && verbosity=--progress-bar
|
||||
|
||||
for repo in "${repos[@]}"; do
|
||||
for arch in "${arches[@]}"; do
|
||||
rm -rf "${SOCACHE_DIR}/${arch}/${repo}"
|
||||
mkdir -p "${SOCACHE_DIR}/${arch}/${repo}"
|
||||
curl "$verbosity" "${SOLINKS_MIRROR}/${repo}/os/${arch}/${repo}.links.tar.gz" | bsdtar -xf - -C "${SOCACHE_DIR}/${arch}/${repo}"
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
search() {
|
||||
local repo=$1 arch lib=$2 srepos=("${repos[@]}")
|
||||
|
||||
if [[ $repo != all ]]; then
|
||||
if ! in_array "${repo}" "${repos[@]}"; then
|
||||
echo "${BASH_SOURCE[0]##*/}: unrecognized repo '$repo'"
|
||||
echo "Try '${BASH_SOURCE[0]##*/} --help' for more information."
|
||||
exit 1
|
||||
fi
|
||||
srepos=("${repo}")
|
||||
fi
|
||||
|
||||
for arch in "${arches[@]}"; do
|
||||
for repo in "${srepos[@]}"; do
|
||||
local prefix=
|
||||
(( VERBOSE && ${#srepos[@]} > 1 )) && prefix=${repo}/
|
||||
db=${SOCACHE_DIR}/${arch}/${repo}/
|
||||
if [[ -d ${db} ]]; then
|
||||
while read -rd '' pkg; do
|
||||
read -r match
|
||||
pkg=${pkg#${db}}
|
||||
pkg="${prefix}${pkg%-*-*/links}"
|
||||
|
||||
if (( VERBOSE )); then
|
||||
printf '%-35s %s\n' "${pkg}" "${match}"
|
||||
else
|
||||
printf '%s\n' "${pkg}"
|
||||
fi
|
||||
done < <(grep -rZ "${lib}" "${db}") | sort -u
|
||||
fi
|
||||
done
|
||||
done | resort
|
||||
}
|
||||
|
||||
usage() {
|
||||
cat <<- _EOF_
|
||||
Usage: ${BASH_SOURCE[0]##*/} [OPTIONS] REPO LIBNAME
|
||||
|
||||
Check the soname links database for Arch Linux repositories containing
|
||||
packages linked to a given shared library. If the repository specified
|
||||
is "all", then all repositories will be searched, otherwise only the
|
||||
named repository will be searched.
|
||||
|
||||
If the links database does not exist, it will be downloaded first.
|
||||
|
||||
OPTIONS
|
||||
-v, --verbose Show matched links in addition to pkgname
|
||||
-r, --refresh Refresh the links databases
|
||||
-h, --help Show this help text
|
||||
_EOF_
|
||||
}
|
||||
|
||||
# utility function to resort with multiple repos + no-verbose
|
||||
resort() { sort -u; }
|
||||
|
||||
if (( $# == 0 )); then
|
||||
echo "error: No arguments passed."
|
||||
echo "Try '${BASH_SOURCE[0]##*/} --help' for more information."
|
||||
exit 1
|
||||
fi
|
||||
OPT_SHORT='vrh'
|
||||
OPT_LONG=('verbose' 'refresh' 'help')
|
||||
if ! parseopts "$OPT_SHORT" "${OPT_LONG[@]}" -- "$@"; then
|
||||
exit 1
|
||||
fi
|
||||
set -- "${OPTRET[@]}"
|
||||
|
||||
while :; do
|
||||
case $1 in
|
||||
-v|--verbose)
|
||||
resort() { cat; }
|
||||
VERBOSE=1
|
||||
;;
|
||||
-r|--refresh)
|
||||
REFRESH=1
|
||||
;;
|
||||
-h|--help)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
--)
|
||||
shift; break
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if ! (( ( REFRESH && $# == 0 ) || $# == 2 )); then
|
||||
echo "error: Incorrect number of arguments passed."
|
||||
echo "Try '${BASH_SOURCE[0]##*/} --help' for more information."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if (( REFRESH )) || [[ ! -d ${SOCACHE_DIR} ]]; then
|
||||
recache
|
||||
(( $# == 2 )) || exit 0
|
||||
fi
|
||||
|
||||
search "$@"
|
@@ -1,4 +1,4 @@
|
||||
#compdef archbuild archco arch-nspawn archrelease archrm commitpkg finddeps makechrootpkg mkarchroot rebuildpkgs extrapkg=commitpkg corepkg=commitpkg testingpkg=commitpkg stagingpkg=commitpkg communitypkg=commitpkg community-testingpkg=commitpkg community-stagingpkg=commitpkg multilibpkg=commitpkg multilib-testingpkg=commitpkg extra-x86_64-build=archbuild testing-x86_64-build=archbuild staging-x86_64-build=archbuild multilib-build=archbuild multilib-testing-build=archbuild multilib-staging-build=archbuild kde-unstable-x86_64-build=archbuild gnome-unstable-x86_64-build=archbuild communityco=archco
|
||||
#compdef archbuild archco arch-nspawn archrelease commitpkg finddeps makechrootpkg mkarchroot rebuildpkgs extrapkg=commitpkg corepkg=commitpkg testingpkg=commitpkg stagingpkg=commitpkg communitypkg=commitpkg community-testingpkg=commitpkg community-stagingpkg=commitpkg multilibpkg=commitpkg multilib-testingpkg=commitpkg extra-x86_64-build=archbuild testing-x86_64-build=archbuild staging-x86_64-build=archbuild multilib-build=archbuild multilib-testing-build=archbuild multilib-staging-build=archbuild kde-unstable-x86_64-build=archbuild gnome-unstable-x86_64-build=archbuild communityco=archco
|
||||
# License: Unspecified
|
||||
|
||||
m4_include(lib/valid-tags.sh)
|
||||
@@ -23,10 +23,6 @@ _archrelease_args=(
|
||||
"*:arch:($_tags[*])"
|
||||
)
|
||||
|
||||
_archrm_args=(
|
||||
'1:path:_files -/'
|
||||
)
|
||||
|
||||
_commitpkg_args=(
|
||||
"-a[Release to a specific architecture only]:arch:($_arch[*])"
|
||||
'-l[Set bandwidth limit]:limit'
|
||||
|
Reference in New Issue
Block a user