Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • adelie/apk-tools
  • Abu2rkyi/apk-tools
2 results
Show changes
Commits on Source (540)
src/apk
src/apk-test
src/apk.static
src/help.h
test/*.got
test/repos.out
test/repos.stamp
test/test*.out
test/test*.ok
libfetch/*err.h
*.a
*.o
*.d
*.cmd
*.so
*.so*
*.5
*.8
*.pc
config.mk
stages:
- test
- build
- upload
- release
variables:
PACKAGE_ENDPOINT: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/"
test:alpine:
image: alpine
stage: test
script:
- apk update
- apk add make gcc git musl-dev openssl-dev linux-headers zlib-dev lua5.3-dev lua5.3-lzlib
- make -j$(nproc) check
tags:
- docker-alpine
- x86_64
test:debian:
image: debian
stage: test
script:
- apt-get update
- apt-get install -y make gcc git libssl-dev zlib1g-dev lua5.3-dev lua5.2 lua-zlib-dev sudo
- unlink /bin/sh
- ln -s /bin/bash /bin/sh
- make -j$(nproc) check
tags:
- docker-alpine
- x86_64
build-static:
stage: build
image: alpinelinux/build-base:latest-$ARCH
script:
- abuild-apk add make gcc git musl-dev openssl-dev linux-headers zlib-dev lua5.3-dev lua5.3-lzlib zlib-static openssl-libs-static
- make -j$(nproc) static
- install -s -m0755 src/apk.static src/apk.static-$ARCH
parallel:
matrix:
- ARCH:
- x86_64
- x86
- armv7
- armhf
- aarch64
- s390x
- ppc64le
- riscv64
artifacts:
paths:
- src/apk.static-*
tags:
- docker-alpine
- $ARCH
make-release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
script:
- |-
apk add curl
for artifact in src/apk.static-*; do
! [ -f "$artifact" ] && { echo "No artifacts found"; exit 1; }
ARCH=${artifact#*-}
echo "Uploading binary for $ARCH"
curl --fail -H "JOB-TOKEN: $CI_JOB_TOKEN" -T "$artifact" -o /dev/null ${PACKAGE_ENDPOINT}/$CI_COMMIT_TAG/$ARCH/apk.static
done
- echo "Making a release"
release:
name: $CI_COMMIT_TAG
description: "Release $CI_COMMIT_TAG"
tag_name: $CI_COMMIT_TAG
ref: $CI_COMMIT_TAG
assets:
links:
- name: apk.static (x86_64)
url: $PACKAGE_ENDPOINT/$CI_COMMIT_TAG/x86_64/apk.static
- name: apk.static (x86)
url: $PACKAGE_ENDPOINT/$CI_COMMIT_TAG/x86/apk.static
- name: apk.static (armv7)
url: $PACKAGE_ENDPOINT/$CI_COMMIT_TAG/armv7/apk.static
- name: apk.static (armhf)
url: $PACKAGE_ENDPOINT/$CI_COMMIT_TAG/armhf/apk.static
- name: apk.static (aarch64)
url: $PACKAGE_ENDPOINT/$CI_COMMIT_TAG/aarch64/apk.static
- name: apk.static (s390x)
url: $PACKAGE_ENDPOINT/$CI_COMMIT_TAG/s390x/apk.static
- name: apk.static (ppc64le)
url: $PACKAGE_ENDPOINT/$CI_COMMIT_TAG/ppc64le/apk.static
- name: apk.static (riscv64)
url: $PACKAGE_ENDPOINT/$CI_COMMIT_TAG/riscv64/apk.static
rules:
- if: $CI_COMMIT_TAG
tags:
- docker-alpine
- x86_64
A. Wilcox <AWilcox@Wilcox-Tech.com>
Ariadne Conill <ariadne@dereferenced.org> <nenolod@dereferenced.org>
Ariadne Conill <ariadne@dereferenced.org> <kaniini@dereferenced.org>
Natanael Copa <ncopa@alpinelinux.org> <natanael.copa@gmail.com>
Natanael Copa <ncopa@alpinelinux.org> <ncopa@ncopa-laptop.localdomain>
Natanael Copa <ncopa@alpinelinux.org> <ncopa@alpine-netbook.(none)>
Timo Teräs <timo.teras@iki.fi>
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your freedom to share
and change it. By contrast, the GNU General Public License is intended to
guarantee your freedom to share and change free software--to make sure the
software is free for all its users. This General Public License applies to
most of the Free Software Foundation's software and to any other program whose
authors commit to using it. (Some other Free Software Foundation software
is covered by the GNU Lesser General Public License instead.) You can apply
it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our
General Public Licenses are designed to make sure that you have the freedom
to distribute copies of free software (and charge for this service if you
wish), that you receive source code or can get it if you want it, that you
can change the software or use pieces of it in new free programs; and that
you know you can do these things.
To protect your rights, we need to make restrictions that forbid anyone to
deny you these rights or to ask you to surrender the rights. These restrictions
translate to certain responsibilities for you if you distribute copies of
the software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or
for a fee, you must give the recipients all the rights that you have. You
must make sure that they, too, receive or can get the source code. And you
must show them these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and (2)
offer you this license which gives you legal permission to copy, distribute
and/or modify the software.
Also, for each author's protection and ours, we want to make certain that
everyone understands that there is no warranty for this free software. If
the software is modified by someone else and passed on, we want its recipients
to know that what they have is not the original, so that any problems introduced
by others will not reflect on the original authors' reputations.
Finally, any free program is threatened constantly by software patents. We
wish to avoid the danger that redistributors of a free program will individually
obtain patent licenses, in effect making the program proprietary. To prevent
this, we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.
The precise terms and conditions for copying, distribution and modification
follow.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains a notice
placed by the copyright holder saying it may be distributed under the terms
of this General Public License. The "Program", below, refers to any such program
or work, and a "work based on the Program" means either the Program or any
derivative work under copyright law: that is to say, a work containing the
Program or a portion of it, either verbatim or with modifications and/or translated
into another language. (Hereinafter, translation is included without limitation
in the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not covered
by this License; they are outside its scope. The act of running the Program
is not restricted, and the output from the Program is covered only if its
contents constitute a work based on the Program (independent of having been
made by running the Program). Whether that is true depends on what the Program
does.
1. You may copy and distribute verbatim copies of the Program's source code
as you receive it, in any medium, provided that you conspicuously and appropriately
publish on each copy an appropriate copyright notice and disclaimer of warranty;
keep intact all the notices that refer to this License and to the absence
of any warranty; and give any other recipients of the Program a copy of this
License along with the Program.
You may charge a fee for the physical act of transferring a copy, and you
may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion of it,
thus forming a work based on the Program, and copy and distribute such modifications
or work under the terms of Section 1 above, provided that you also meet all
of these conditions:
a) You must cause the modified files to carry prominent notices stating that
you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in whole or
in part contains or is derived from the Program or any part thereof, to be
licensed as a whole at no charge to all third parties under the terms of this
License.
c) If the modified program normally reads commands interactively when run,
you must cause it, when started running for such interactive use in the most
ordinary way, to print or display an announcement including an appropriate
copyright notice and a notice that there is no warranty (or else, saying that
you provide a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this License.
(Exception: if the Program itself is interactive but does not normally print
such an announcement, your work based on the Program is not required to print
an announcement.)
These requirements apply to the modified work as a whole. If identifiable
sections of that work are not derived from the Program, and can be reasonably
considered independent and separate works in themselves, then this License,
and its terms, do not apply to those sections when you distribute them as
separate works. But when you distribute the same sections as part of a whole
which is a work based on the Program, the distribution of the whole must be
on the terms of this License, whose permissions for other licensees extend
to the entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest your
rights to work written entirely by you; rather, the intent is to exercise
the right to control the distribution of derivative or collective works based
on the Program.
In addition, mere aggregation of another work not based on the Program with
the Program (or with a work based on the Program) on a volume of a storage
or distribution medium does not bring the other work under the scope of this
License.
3. You may copy and distribute the Program (or a work based on it, under Section
2) in object code or executable form under the terms of Sections 1 and 2 above
provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable source code,
which must be distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three years, to give
any third party, for a charge no more than your cost of physically performing
source distribution, a complete machine-readable copy of the corresponding
source code, to be distributed under the terms of Sections 1 and 2 above on
a medium customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer to distribute
corresponding source code. (This alternative is allowed only for noncommercial
distribution and only if you received the program in object code or executable
form with such an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for making
modifications to it. For an executable work, complete source code means all
the source code for all modules it contains, plus any associated interface
definition files, plus the scripts used to control compilation and installation
of the executable. However, as a special exception, the source code distributed
need not include anything that is normally distributed (in either source or
binary form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component itself
accompanies the executable.
If distribution of executable or object code is made by offering access to
copy from a designated place, then offering equivalent access to copy the
source code from the same place counts as distribution of the source code,
even though third parties are not compelled to copy the source along with
the object code.
4. You may not copy, modify, sublicense, or distribute the Program except
as expressly provided under this License. Any attempt otherwise to copy, modify,
sublicense or distribute the Program is void, and will automatically terminate
your rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses terminated
so long as such parties remain in full compliance.
5. You are not required to accept this License, since you have not signed
it. However, nothing else grants you permission to modify or distribute the
Program or its derivative works. These actions are prohibited by law if you
do not accept this License. Therefore, by modifying or distributing the Program
(or any work based on the Program), you indicate your acceptance of this License
to do so, and all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the Program),
the recipient automatically receives a license from the original licensor
to copy, distribute or modify the Program subject to these terms and conditions.
You may not impose any further restrictions on the recipients' exercise of
the rights granted herein. You are not responsible for enforcing compliance
by third parties to this License.
7. If, as a consequence of a court judgment or allegation of patent infringement
or for any other reason (not limited to patent issues), conditions are imposed
on you (whether by court order, agreement or otherwise) that contradict the
conditions of this License, they do not excuse you from the conditions of
this License. If you cannot distribute so as to satisfy simultaneously your
obligations under this License and any other pertinent obligations, then as
a consequence you may not distribute the Program at all. For example, if a
patent license would not permit royalty-free redistribution of the Program
by all those who receive copies directly or indirectly through you, then the
only way you could satisfy both it and this License would be to refrain entirely
from distribution of the Program.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply and
the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents
or other property right claims or to contest validity of any such claims;
this section has the sole purpose of protecting the integrity of the free
software distribution system, which is implemented by public license practices.
Many people have made generous contributions to the wide range of software
distributed through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing to
distribute software through any other system and a licensee cannot impose
that choice.
This section is intended to make thoroughly clear what is believed to be a
consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in certain
countries either by patents or by copyrighted interfaces, the original copyright
holder who places the Program under this License may add an explicit geographical
distribution limitation excluding those countries, so that distribution is
permitted only in or among countries not thus excluded. In such case, this
License incorporates the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions of
the General Public License from time to time. Such new versions will be similar
in spirit to the present version, but may differ in detail to address new
problems or concerns.
Each version is given a distinguishing version number. If the Program specifies
a version number of this License which applies to it and "any later version",
you have the option of following the terms and conditions either of that version
or of any later version published by the Free Software Foundation. If the
Program does not specify a version number of this License, you may choose
any version ever published by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free programs
whose distribution conditions are different, write to the author to ask for
permission. For software which is copyrighted by the Free Software Foundation,
write to the Free Software Foundation; we sometimes make exceptions for this.
Our decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing and reuse
of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM
"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE
OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA
OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES
OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH
HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible
use to the public, the best way to achieve this is to make it free software
which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach
them to the start of each source file to most effectively convey the exclusion
of warranty; and each file should have at least the "copyright" line and a
pointer to where the full notice is found.
<one line to give the program's name and an idea of what it does.>
Copyright (C)< yyyy> <name of author>
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, write to the Free Software Foundation, Inc., 51 Franklin
Street, Fifth Floor, Boston, MA 02110-1301, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this when
it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author Gnomovision comes
with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software,
and you are welcome to redistribute it under certain conditions; type `show
c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may be
called something other than `show w' and `show c'; they could even be mouse-clicks
or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your school,
if any, to sign a "copyright disclaimer" for the program, if necessary. Here
is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision'
(which makes passes at compilers) written by James Hacker.
<signature of Ty Coon >, 1 April 1989 Ty Coon, President of Vice This General
Public License does not permit incorporating your program into proprietary
programs. If your program is a subroutine library, you may consider it more
useful to permit linking proprietary applications with the library. If this
is what you want to do, use the GNU Lesser General Public License instead
of this License.
##
# A set of makefile rules loosely based on kbuild.
all: compile
default: compile
all: compile docs
test check:
ifndef build
......@@ -49,9 +53,15 @@ export srctree objtree
TAGPREFIX ?= v
GIT_REV := $(shell test -d .git && git describe || echo exported)
ifneq ($(GIT_REV), exported)
FULL_VERSION := $(patsubst $(TAGPREFIX)%,%,$(GIT_REV))
ifneq ($(CI_COMMIT_TAG),)
FULL_VERSION := $(CI_COMMIT_TAG)
else ifneq ($(CI_COMMIT_REF_NAME),)
# GitLab but no tag info, use the 'git describe' from environment variable
# once https://gitlab.com/gitlab-org/gitlab-runner/-/merge_requests/1633
# gets completed and merged upstream.
FULL_VERSION := $(VERSION)
else ifneq ($(wildcard .git),)
FULL_VERSION := $(patsubst $(TAGPREFIX)%,%,$(shell git describe))
else
FULL_VERSION := $(VERSION)
endif
......@@ -65,18 +75,22 @@ export FULL_VERSION RCS_FIND_IGNORE
CROSS_COMPILE ?=
CC := $(CROSS_COMPILE)gcc
AR := $(CROSS_COMPILE)ar
LD := $(CROSS_COMPILE)ld
LN := ln -sf
SCDOC := scdoc
SED := sed
INSTALL := install
INSTALLDIR := $(INSTALL) -d
CFLAGS ?= -g -O2
CFLAGS_ALL := -Werror -Wall -Wstrict-prototypes -D_GNU_SOURCE -std=gnu99 -fPIC
CFLAGS_ALL := -Wall -Wstrict-prototypes -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -std=gnu99 -fPIC
CFLAGS_ALL += $(CFLAGS)
LDFLAGS ?= -g
LDFLAGS_ALL += $(LDFLAGS)
export CC LD INSTALL INSTALLDIR CFLAGS_ALL LDFLAGS_ALL
export CC AR LD LN SCDOC SED INSTALL INSTALLDIR CFLAGS_ALL LDFLAGS_ALL
build :=
......@@ -84,9 +98,15 @@ endif
##
# Reset all variables.
ifneq ($(origin subdirs),file)
subdirs :=
endif
ifneq ($(origin targets),file)
targets :=
endif
ifneq ($(origin nontargets),file)
nontargets :=
endif
src :=
obj :=
......@@ -105,7 +125,7 @@ endif
##
# Rules and helpers
PHONY += all compile install clean FORCE
PHONY += all compile install clean docs FORCE
# Convinient variables
comma := ,
......@@ -174,10 +194,14 @@ if_changed_rule = $(if $(strip $(any-prereq) $(arg-check) ), \
#####
# Handle options to gcc.
c_flags = -Wp,-MD,$(depfile),-MT,$@ $(CPPFLAGS) \
c_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CPPFLAGS) \
$(CFLAGS_ALL) $(CFLAGS_EXTRA) $(CFLAGS_$(notdir $@))
ld_flags = $(LDFLAGS_ALL) $(LDFLAGS_EXTRA) $(LDFLAGS_$(notdir $@))
#####
# Generated targets
generate: $(addprefix $(obj)/,$(sort $(generate-y)))
#####
# Compile c-files.
quiet_cmd_cc_o_c = CC $@
......@@ -193,47 +217,96 @@ endef
$(obj)/%.o: override local-target-prereqs=%
$(obj)/%.o: $(src)/%.c FORCE
$(obj)/%.o: $(src)/%.c FORCE | generate
$(call if_changed_rule,cc_o_c)
#####
# Link static libraries
#
__arlibs := $(addprefix $(obj)/,$(sort $(libs-y)))
arobjs := $(addprefix $(obj)/,$(sort $(foreach m,$(libs-y),$($(m)-objs))))
# link shared library
quiet_cmd_ar = AR $@
cmd_ar = $(AR) rcs $@ $(addprefix $(obj)/,$($(@F)-objs))
$(__arlibs): override local-target-prereqs=$(addprefix $(obj)/,$($(*F)-objs))
$(__arlibs): $(obj)/%: $(arobjs) FORCE
$(call if_changed,ar)
targets += $(__arlibs) $(arobjs)
#####
# Link shared libraries
#
__shlibs := $(addprefix $(obj)/,$(sort $(shlibs-y)))
shobjs := $(addprefix $(obj)/,$(sort $(foreach m,$(shlibs-y),$($(m)-objs))))
shobjs := $(addprefix $(obj)/,$(sort $(foreach m,$(shlibs-y),$($(m)-objs)))) $(sort $(foreach m,$(shlibs-y),$($(m)-libs)))
# link shared library
quiet_cmd_shlib = LD -shared $@
cmd_shlib = $(CC) $(ld_flags) -shared -o $@ \
$(addprefix $(obj)/,$($(@F)-objs)) \
$(addprefix $(obj)/,$($(@F)-objs)) \
$($(@F)-libs) \
$(LIBS) $(LIBS_$(@F))
$(__shlibs): override local-target-prereqs=$(addprefix $(obj)/,$($(*F)-objs))
$(__shlibs): override local-target-prereqs=$(addprefix $(obj)/,$($(*F)-objs)) $($(*F)-libs)
$(__shlibs): $(obj)/%: $(shobjs) FORCE
$(call if_changed,shlib)
targets += $(__shlibs) $(shobjs)
#####
# Link programs
# Link an executable based on list of .o files, all plain c
# host-cmulti -> executable
__progs := $(addprefix $(obj)/,$(sort $(progs-y)))
cobjs := $(addprefix $(obj)/,$(sort $(foreach m,$(progs-y),$($(m)-objs))))
cobjs := $(addprefix $(obj)/,$(sort $(foreach m,$(progs-y),$($(m)-objs)))) $(sort $(foreach m,$(progs-y),$($(m)-libs)))
quiet_cmd_ld = LD $@
cmd_ld = $(CC) $(ld_flags) -o $@ \
$(addprefix $(obj)/,$($(@F)-objs)) \
$(addprefix $(obj)/,$($(@F)-objs)) $($(@F)-libs) \
$(LIBS) $(LIBS_$(@F))
$(__progs): override local-target-prereqs=$(addprefix $(obj)/,$($(*F)-objs))
$(__progs): override local-target-prereqs=$(addprefix $(obj)/,$($(*F)-objs)) $($(*F)-libs)
$(__progs): $(obj)/%: $(cobjs) FORCE
$(call if_changed,ld)
targets += $(__progs) $(cobjs)
#####
# Man pages
quiet_cmd_scdoc = SCDOC $@
cmd_scdoc = $(SCDOC) < $< > $@
__scdocs := $(addprefix $(obj)/,$(sort $(scdocs-y)))
nontargets += $(__scdocs)
docs += $(__scdocs)
$(__scdocs): $(obj)/%: $(src)/%.scd
$(call if_changed,scdoc)
####
# Template (.in) files
quiet_cmd_sed = SED $@
cmd_sed = $(SED) \
-e "s|@EXEC_DIR@|$(SBINDIR)|" \
-e "s|@LIB_DIR@|$(LIBDIR)|" \
-e "s|@INCLUDE_DIR@|$(INCLUDEDIR)|" \
-e "s|@VERSION@|$(VERSION)|" \
$< > $@
$(obj)/%: $(src)/%.in FORCE
$(call if_changed,sed)
nontargets += $(addprefix $(obj)/,$(sort $(generate-y)))
###
# why - tell why a a target got build
ifeq ($(VERBOSE),2)
......@@ -243,9 +316,9 @@ why = \
$(if $(strip $(any-prereq)),- due to: $(any-prereq), \
$(if $(arg-check), \
$(if $(cmd_$@),- due to command line change: $(arg-check), \
$(if $(filter $@, $(targets)), \
$(if $(filter $@, $(targets) $(nontargets)), \
- due to missing .cmd file, \
- due to $(notdir $@) not in $$(targets) \
- due to $(notdir $@) not in $$(targets) or $$(nontargets) \
) \
) \
) \
......@@ -263,18 +336,30 @@ endif
%/: FORCE
$(Q)$(MAKE) -f Make.rules build=$(build-dir) $(MAKECMDGOALS)
compile: $(targets)
compile: generate $(targets) $(subdirs)
@:
install: $(targets) FORCE
docs: $(docs) $(subdirs)
@:
install: compile docs $(subdirs) FORCE
tag:
generate:
clean: $(filter %/,$(targets))
clean: $(subdirs)
ifeq ($(toplevelrun),yes)
$(Q)find . $(RCS_FIND_IGNORE) \
\( -name '*.[oas]' -o -name '.*.cmd' -o -name '.*.d' \) \
-type f -print | xargs rm -f
endif
$(Q)rm -rf $(addprefix $(obj)/,$(sort $(progs-y) $(progs-n) $(progs-) $(shlibs-y) $(shlibs-n) $(shlibs-)))
$(Q)rm -rf $(addprefix $(obj)/, \
$(sort $(progs-y) $(progs-n) $(progs-) \
$(shlibs-y) $(shlibs-n) $(shlibs-) \
$(libs-y) $(libs-n) $(libs-) \
$(generate-y) $(generate-n) $(generate-) \
$(scdocs-y) $(scdocs-n) $(scdocs-)))
ifeq ($(origin VERSION),command line)
DIST_VERSION=$(VERSION)
......@@ -295,7 +380,8 @@ FORCE:
# exist, we will rebuild anyway in that case.
targets := $(wildcard $(sort $(targets)))
cmd_files := $(wildcard $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd))
docs := $(wildcard $(sort $(docs)))
cmd_files := $(wildcard $(foreach f,$(targets) $(nontargets),$(dir $(f)).$(notdir $(f)).cmd))
ifneq ($(cmd_files),)
include $(cmd_files)
......
......@@ -4,7 +4,9 @@
-include config.mk
PACKAGE := apk-tools
VERSION := 2.4.5
VERSION := 2.14.0
export VERSION
##
# Default directories
......@@ -15,13 +17,15 @@ LIBDIR := /lib
CONFDIR := /etc/apk
MANDIR := /usr/share/man
DOCDIR := /usr/share/doc/apk
INCLUDEDIR := /usr/include
PKGCONFIGDIR := /usr/lib/pkgconfig
export DESTDIR SBINDIR LIBDIR CONFDIR MANDIR DOCDIR
export DESTDIR SBINDIR LIBDIR CONFDIR MANDIR DOCDIR INCLUDEDIR PKGCONFIGDIR
##
# Top-level rules and targets
# Top-level subdirs
targets := src/
subdirs := libfetch/ src/ doc/
##
# Include all rules and stuff
......@@ -33,11 +37,17 @@ include Make.rules
install:
$(INSTALLDIR) $(DESTDIR)$(DOCDIR)
$(INSTALL) README $(DESTDIR)$(DOCDIR)
$(INSTALL) README.md $(DESTDIR)$(DOCDIR)
test: FORCE
check test: FORCE src/
$(Q)$(MAKE) TEST=y
$(Q)$(MAKE) -C test
static:
$(Q)$(MAKE) STATIC=y
tag: check
git commit . -m "apk-tools-$(VERSION)"
git tag -s v$(VERSION) -m "apk-tools-$(VERSION)"
src/: libfetch/
# Alpine Package Keeper
Alpine Package Keeper (apk) is a package manager developed for Alpine Linux.
Online documentation is available in the [doc/](doc/) directory in the form of man pages.
scdocs-y += \
apk-cache.5 \
apk-keys.5 \
apk-repositories.5 \
apk-world.5 \
apk.8 \
apk-add.8 \
apk-audit.8 \
apk-cache.8 \
apk-del.8 \
apk-dot.8 \
apk-fetch.8 \
apk-fix.8 \
apk-index.8 \
apk-info.8 \
apk-list.8 \
apk-manifest.8 \
apk-policy.8 \
apk-search.8 \
apk-stats.8 \
apk-update.8 \
apk-upgrade.8 \
apk-verify.8 \
apk-version.8
install:
for page in $(scdocs-y); do \
section=$${page#*.}; \
$(INSTALLDIR) $(DESTDIR)$(MANDIR)/man$$section; \
$(INSTALL) $(obj)/$$page $(DESTDIR)$(MANDIR)/man$$section/; \
done
apk-add(8)
# NAME
apk add - add packages to _world_ and commit changes
# SYNOPSIS
*apk add* [<_options_>...] _packages_...
# DESCRIPTION
*apk add* adds the requested packages to _world_ and installs (or upgrades)
them if not already present, ensuring all dependencies are met.
To upgrade individual packages without modifying _world_ use *apk-fix*(8).
By default *apk* tries to select a set of packages so that all dependencies
are satisfied. This means that some packages can be held back in an older
version if there is direct or implicit dependencies to the older version.
# OPTIONS
*apk add* supports the commit options described in *apk*(8), as well as the
following options:
*--initdb*
Initialize a new package database.
*-l, --latest*
Always choose the latest package by version. However, the versions
considered are based on the package pinning. Primarily this overrides
the default heuristic and will cause an error to displayed if all
dependencies cannot be satisfied.
*-u, --upgrade*
Upgrade _packages_ and it's dependencies. Normally *apk add* will
avoid changing installed package unless it is required by the newly
added _packages_ or their dependencies. This changes the default
preference to upgrading the package to the latest installable version.
*-t, --virtual* _NAME_
Create virtual package _NAME_ with given dependencies. This new package
will get the _packages_ as dependencies instead of _world_. Finally the
_NAME_ is added to _world_. An optional version specifier for the virtual
package can be given via syntax _NAME_=_VERSION_. The version defaults
to synthesized version based on time.
One can use this to ensure that selected set of packages are installed,
and later the temporary modification be undone with *apk-del*(8) _NAME_
without removing packages that were installed earlier.
*--no-chown*
Do not change file owner or group. By default apk will manage the file
ownership when running as root. However, this option is turned on when
running as non-root user, as changing file ownership is not permitted
by the system then.
apk-audit(8)
# NAME
apk audit - audit directories for changes
# SYNOPSIS
*apk audit* [<_options_>...] _directories_...
# DESCRIPTION
*apk audit* audits the system or specified directories for changes compared to
the package database.
The audit can be done against configuration files only (*--backup*) to generate
list of files needed to be stored in the overlay in run-from-tmps configuration.
Alternatively, it can audit all installed files (*--system* or *--full*) to
e.g. detect unauthorized modifications of system files.
By default, the output format is one file per line, for each modified file.
A character is printed indicating the line type, followed by a space,
then the affected path or details. The changes detected are:
|[ -
:< Database detail record
| \+
: On-disk detail record
| A
: File added
| d
: Directory added
| D
: Directory added (with non-listed files/subdirs)
| e
: error occured during audit (e.g. no permissions to read file)
| M
: File metadata changed (uid, gid, or mode)
| m
: Directory metadata changed
| U
: File contents modified
| X
: File deleted
| x
: xattrs changed
# OPTIONS
*--backup*
Audit configuration files only (default). The list of files to be
audited is generated from the masks in protected_paths.d.
*--check-permissions*
Check file permissions too. Namely, the uid, gid and file mode will
be checked in addition to the file content.
*--details*
Enable reporting of detail records.
*--full*
Audit all system files. Same as *--system*, but in addition reports
all added directories and files. A built-in default override for
protected paths is used, unless a *--protected-paths* is explicitly
specified.
*--ignore-busybox-symlinks*
Ignore symlinks whose target is the busybox binary.
*--packages*
Print only the packages with changed files. Instead of the full output
each modification, the set of packages with at least one modified file
is printed.
To repair all packages with modified files, one could use:
apk audit --packages -q | xargs apk fix
*--protected-paths* _FILE_
Use given FILE for protected paths listings. This also makes apk ignore
the regular protected_paths.d directories.
*--system*
Audit all system files. All files provided by packages are verified
for integrity with the exception of configuration files (listed in
protected_paths.d). This is useful detecting unauthorized file changes.
New files or directories are not reported.
*-r, --recursive*
Descend into directories and audit them as well.
apk-cache(5)
# NAME
*/etc/apk/cache* - local cache of package files
# DESCRIPTION
If */etc/apk/cache* is a symlink to a local directory, *apk*(8) will it as a
local cache for downloaded package files and repository indicies. The cache
must not reside on a tmpfs.
To enable the apk cache, run the following commands as root:
mkdir -p /var/cache/apk++
ln -s /var/cache/apk /etc/apk/cache
For information on cache maintenance, see *apk-cache*(8).
apk-cache(8)
# NAME
apk cache - manage a local cache of package files
# SYNOPSIS
*apk cache* [<_options_>...] clean
*apk cache* [<_options_>...] download [_dependency_...]
*apk cache* [<_options_>...] purge
*apk cache* [<_options_>...] sync [_dependency_...]
# DESCRIPTION
Manage local package cache by removing obsolete packages, or downloading
missing or newer packages from the repositories.
*apk cache download* will fetch package files from the repositories and store
them in the cache, which must be enabled upfront (see *apk-cache*(5)). By
default _world_ dependencies are used to determine what to download. If
_dependency_ arguments are given, they will by default replace the _world_.
*apk cache clean* will remove package files which no longer exist in any
repository index. Specifying the global option *--purge* will additionally
remove all uninstalled package on tmpfs installations, and all packages on
disk installations.
*apk cache purge* is a synonym for *clean --purge*.
*apk cache sync* performs both operations.
# OPTIONS
*--add-dependencies*
Add the argument dependencies to _world_ dependencies when determining
which packages to download.
*-a, --available*
Selected packages to be downloaded from active repositories even if
it means replacing or downgrading the installed package.
*--ignore-conflict*
Ignore conflicts when resolving dependencies. This can be useful when
pre-populating cache for creation of multiple images in one go.
*-l, --latest*
Always choose the latest package by version. However, the versions
considered are based on the package pinning. Primarily this overrides
the default heuristic and will cause an error to displayed if all
dependencies cannot be satisfied.
*-u, --upgrade*
Upgrade _packages_ and it's dependencies. Normally *apk add* will
avoid changing installed package unless it is required by the newly
added _packages_ or their dependencies. This changes the default
preference to upgrading the package to the latest installable version.
*-s, --simulate*
Simulate the requested operation without making any changes.
apk-del(8)
# NAME
apk del - remove packages from _world_ and commit changes
# SYNOPSIS
*apk del* [<_options_>...] _packages_...
# DESCRIPTION
*apk del* removes packages from _world_ and uninstalls them if no longer
required by any other packages.
# OPTIONS
*apk del* supports the commit options described in *apk*(8), as well as the
following options:
*-r, --rdepends*
Recursively delete all top-level reverse dependencies, too.
apk-dot(8)
# NAME
apk dot - generate graphviz graphs
# SYNOPSIS
*apk dot* [<_options_>...] [_pkgmask_...]
# DESCRIPTION
*apk dot* renders package dependencies as graphviz graphs.
The graph is generated for the packages matching the masks given, or for every
known package if unspecified (this will generate a large and unwieldy graph).
# OPTIONS
*--errors*
Consider only packages with errors. This is useful for visually reporting
e.g. cyclic dependencies and missing packages.
*--installed*
Consider only installed packages.
apk-fetch(8)
# NAME
apk fetch - download packages from global repositories to a local directory
# SYNOPSIS
*apk fetch* [<_options_>...] _packages_...
# DESCRIPTION
*apk fetch* downloads the requested packages from the configured package
repositories (see *apk-repositories*(5)) to a local directory. The current
working directory is used as the destination directory unless *-o* is
specified.
# OPTIONS
*--built-after* _TIMESPEC_
Only fetch packages that have buildtime more recent than TIMESPEC.
TIMESPEC can be a "YYYY-MM-DD HH:MM:SS" date, or seconds since epoch.
*-l, --link*
Create hard links if possible.
*-o, --output* _DIR_
Write the downloaded file(s) to _DIR_.
*-R, --recursive*
Fetch packages and all of their dependencies.
*-s, --stdout*
Dump the .apk file(s) to stdout.
*Note*: this option is incompatible with *-o*, *-R*, and the global
*--progress* option.
*-w, --world*
Download packages needed to satisfy _world_. Implies *--recursive*.
*--simulate*
Simulate the requested operation without making any changes.
*Note*: this option is unreliable if needed indexes are not up-to-date
as this omits refresing or downloading of missing indexes.
*--url*
Print the full URL for downloaded packages.
apk-fix(8)
# NAME
apk fix - repair packages or system
# SYNOPSIS
*apk fix* [<_options_>...] [_packages_...]
# DESCRIPTION
*apk fix* applies repair strategies to correct errors in the installation of
the specified packages, or all installed packages if none are specified.
# OPTIONS
*apk fix* supports the commit options described in *apk*(8), as well as the
following options:
*-d, --depends*
Also fix dependencies of specified packages.
*-r, --reinstall*
Reinstall packages (default).
*-u, --upgrade*
Upgrade name _PACKAGE_ if an upgrade exists and does not break
dependencies.
*-x, --xattr*
Fix packages with broken xattrs.
*--directory-permissions*
Reset all directory permissions.
apk-index(8)
# NAME
apk index - create repository index file from packages
# SYNOPSIS
*apk index* [<_options_>...] _packages_...
# DESCRIPTION
*apk index* creates a repository index from a list of package files. See
*apk-repositories*(8) for more information on repository indicies.
Generally, the resulting index must be cryptographically signed before *apk*
will accept it. See *abuild-sign*(1) for details.
# OPTIONS
*-d, --description* _TEXT_
Add a description to the index. Upstream, this is used to add version
information based on the git commit SHA of aports HEAD at the time of
index generation.
*--merge*
Merge _packages_ into the existing _INDEX_.
*-o, --output* _FILE_
Output generated index to _FILE_.
*--prune-origin*
Prune packages from the existing _INDEX_ with same origin as any of
the new _packages_ during merge.
*-x, --index* _INDEX_
Read an existing index from _INDEX_ to speed up the creation of the new
index by reusing data when possible.
*--no-warnings*
Disable the warning about missing dependencies. This happens when A,
depends on package B, that does not have a provider in the indexed
repository.
*--rewrite-arch* _ARCH_
Set all package's architecture to _ARCH_.
apk-info(8)
# NAME
apk info - print detailed information about packages
# SYNOPSIS
*apk info* [<_options_>...] _packages_...
*apk info* -W _file_
# DESCRIPTION
*apk info* prints information known about the listed packages. By default, it
prints the description, webpage, and installed size of the package (equivalent
to *apk info -dws*).
Each field printed is prefaced by the name of the package and its package
version, then the field to be displayed, and a newline. The following lines
display the appropriate information, then an empty line terminates that field.
*apk info -W* _file_ prints the package which owns the specified file.
# OPTIONS
*-a, --all*
List all information known about the package.
*-d, --description*
Print the package description.
*-e, --installed*
Check package installed status. For each installed package, print it's
name. The exit status is the number of given packages not installed.
Thus, zero (or success) is returned if all named packages are installed.
*-L, --contents*
List files included in the package.
*-P, --provides*
List what the package provides.
*-r, --rdepends*
List reverse dependencies of the package (all other packages which
depend on the package).
*-R, --depends*
List the dependencies of the package.
*-s, --size*
Print the package's installed size.
*-w, --webpage*
Print the URL for the package's upstream webpage.
*-W, --who-owns*
Print the package which owns the specified file.
*--install-if*
List the package's install_if rule. When the dependencies in this list
are satisfied, the package will be installed automatically.
*--license*
Print the package SPDX license identifier.
*--replaces*
List the other packages for which this package is marked as a
replacement.
*--rinstall-if*
List other packages whose install_if rules refer to this package.
*--triggers*
Print active triggers for the package.