update Makefile and man-pages

update TODO and README

pkg-get: add missing test in search()
This commit is contained in:
John McQuah 2023-06-21 16:24:01 -04:00
parent 07429271a3
commit 252c46d87e
8 changed files with 186 additions and 125 deletions

View File

@ -1,5 +1,5 @@
NAME=pkg-get
VERSION="0.4.6"
VERSION="0.4.8"
PREFIX=/usr
CFGDIR=/etc
@ -8,27 +8,20 @@ MANDIR=/usr/share/man
all:
@echo "Use 'make install' to install pkg-get"
man:
#makeman doc/pkg-get.8.txt
#makeman doc/pkg-repgen.8.txt
#man2ps doc/pkg-get.8 | ps2pdf14 - > doc/pkg-get.pdf
dist: man
dist:
rm -rf ${NAME}-${VERSION}
mkdir ${NAME}-${VERSION}
cp -r doc scripts Makefile ChangeLog COPYING README TODO ${NAME}-${VERSION}
rm -f ${NAME}-${VERSION}/doc/*.txt
rm -f ${NAME}-${VERSION}/doc/*.pdf
mkdir -p ${NAME}-${VERSION}/doc
cp -r scripts Makefile ChangeLog COPYING README TODO ${NAME}-${VERSION}
cp doc/*.8 ${NAME}-${VERSION}/doc
cp doc/*.conf ${NAME}-${VERSION}/doc
tar cvzf ${NAME}-${VERSION}.tar.gz ${NAME}-${VERSION}
rm -rf ${NAME}-${VERSION}
install:
install -D -m 755 scripts/pkg-get.pl ${PREFIX}/bin/pkg-get
install -D -m 755 scripts/pkg-repgen.pl ${PREFIX}/bin/pkg-repgen
install -D -m 755 scripts/pkg-get.pl ${PREFIX}/bin/pkg-get
install -D -m 644 doc/pkg-get.8 ${MANDIR}/man8/pkg-get.8
install -D -m 644 doc/pkg-get.conf ${CFGDIR}/pkg-get.conf
install -D -m 644 doc/pkg-repgen.8 ${MANDIR}/man8/pkg-repgen.8
install -D -m 644 doc/pkg-get.8 ${MANDIR}/man8/pkg-get.8
install -D -m 644 doc/pkg-get.conf ${CFGDIR}/pkg-get.conf

33
README
View File

@ -84,8 +84,8 @@ of previewing the outcome from a 'pkg-get depinst' operation.
useful prt-get commands (grpinst, fsearch, deptree, listorphans, ls,
cat, edit, cache) have no counterpart in pkg-get. Of these omissions,
only the 'grpinst' command is of possible interest for binary package
management; the unimplemented commands and options are better handled
by prt-get itself. If you want a Perl implementation that does
management; the unimplemented commands and options are just as easily
delegated to prt-get itself. If you want a Perl implementation that does
provide these missing commands, consider the script written by user
farkuhar [1].
@ -96,16 +96,31 @@ packages needed by 'foo'. User ppetrov^ has contributed some helper scripts
to facilitate the fixing of these broken binaries; visit the site [2] to
download them.
Further omissions related to dependencies are the absence of any mechanism
for declaring aliases (e.g., package openjdk16-bin can serve as a drop-in
replacement for the listed dependency openjdk16), and the lack of an --ignore
switch (to exclude certain packages from being installed in a 'depinst'
operation). You can work around these omissions by avoiding 'depinst'
entirely, and manually performing the desired 'install' transactions (once
you have a clear sense of what the actual runtime dependencies are).
These gaps in pkg-get's design highlight an awkward fact about trying to erect
an infrastructure for binary package management upon a foundation designed for
compiling source code (the ports tree). Inheriting the Pkgfile's lack of
separation between build-time and runtime dependencies, pkg-get will unwittingly
recurse through all the dependencies (in a 'depinst' transaction) and install
packages that you might not really need. Hence the suggestion to consider
avoiding 'depinst', running only 'install' and the helper script written
by ppetrov^ [2].
In handling any new hard dependencies added by the maintainer since
the previous version of a package, pkg-get performs a sysup in the same
manner as the original prt-get (i.e., new dependencies are not injected
by default). Perhaps in future versions it will be the default to perform
automatic injection of new dependencies, which is easy with binary packages
since there's no need to carry out the installation in any particular order.
In the meantime, you can check the output of
'pkg-get depends $mypkg | grep "\[ \]"'
for each package affected by a sysup, in order to see whether the
maintainer has added new dependencies.
by default). With binary packages there's no need to carry out the
installation in any particular order, so the lack of dependency injection is
actually less of a problem for pkg-get than it was for prt-get. Running
ppetrov^'s script [2] should help identify the packages you will need to
install to fix any breakage.
[1] https://git.sdf.org/jmq/Documentation/src/branch/master/scripts/prt-auf
[2] https://github.com/slackalaxy/depsck

4
TODO
View File

@ -15,4 +15,6 @@ TODO file for pkg-get
- let the user control whether pkg-repgen prints the metadata only for the
latest built package, or for all the versions in the directory
- improve pkg-get help information
- add support for aliases (?)
- switch from MD5 to a different hash function (?)

View File

@ -1,20 +1,20 @@
.TH pkg-get 8 "July 13, 2006" "" ""
.SH NAME
\fBpkg-get \fP- a package management tool for CRUX Linux
\fBpkg\-get \fP- a package management tool for CRUX Linux
\fB
.SH SYNOPSIS
.nf
.fam C
\fBpkg-get\fP \fIcommand\fP <arguments> [\fIoptions\fP]
\fBpkg\-get\fP \fIcommand\fP <arguments> [\fIoptions\fP]
.fam T
.fi
.SH DESCRIPTION
\fBpkg-get\fP is a simple package management tool for CRUX Linux.
\fBpkg\-get\fP is a simple package management tool for CRUX Linux.
It tries to replicate some of the most useful features of the
port management tool \fBprt-get\fP(8) to be used with binary packages.
\fBpkg-get\fP requires a remote or local package repository that
port management tool \fBprt\-get\fP(8) to be used with binary packages.
\fBpkg\-get\fP requires a remote or local package repository that
can be generated by repository maintainers with the
\fBpkg-repgen\fP(8) script.
\fBpkg\-repgen\fP(8) script.
.SH COMMANDS
.TP
.B
@ -26,9 +26,9 @@ update <package1> [<package2>..<packageN>]
Update given packages, download if necessary.
.TP
.B
diff [\fB--all\fP]
diff [\fB\-\-all\fP]
Show a list of outdated packages.
The \fB--all\fP option also displays locked packages.
The \fB\-\-all\fP option also displays locked packages.
.TP
.B
quickdiff
@ -46,25 +46,25 @@ Install given packages and relative dependencies.
.TP
.B
depends <package>
Show a recursive list of dependencies for package
Show a recursive list of dependencies for <package>
and their installation status.
.TP
.B
quickdep <package>
Show a brief list of dependencies for package.
Show a brief list of dependencies for <package>.
.TP
.B
dependent <package> [\fB--all\fP]
Show installed (or all with the \fB--all\fP option) packages
that depend from package.
dependent <package> [\fB\-\-all\fP]
Show installed (or all with the \fB\-\-all\fP option) packages
that depend on <package>.
.TP
.B
path <package>
Show local path of package.
Show local path of <package>.
.TP
.B
info <package>
Show information about package.
Show information about <package>.
.TP
.B
current <package>
@ -80,7 +80,7 @@ Print README information (if available) for the package.
.TP
.B
list
List all packages in the repository.
List all packages in the active repositories.
.TP
.B
listinst
@ -88,18 +88,18 @@ List all installed packages.
.TP
.B
dsearch <string>
Search for packages which name or description contain <string>.
Search for packages whose name or description contains <string>.
.TP
.B
search <string>
Search for packages which name contains <string>.
Search for packages whose name contains <string>.
.TP
.B
dup
List all duplicates ports (present in more than one repository).
List all duplicate ports (present in more than one repository).
.TP
.B
printf <format string1> [\fB--filter\fP=<filter>]
printf <format string1> [\fB\-\-filter\fP=<filter>]
Description blatantly stolen from \fBprt\-get\fP(8).
Print formatted port list. Format string can contain variables,
which are replaced like this:
@ -125,7 +125,7 @@ which are replaced like this:
.IP \(bu 3
%O -> post-install script ("yes"/"no")
.IP \(bu 3
%M -> "Nobody". for compatibility with prt-get
%M -> "None". for compatibility with prt-get
.IP \(bu 3
%P -> "None". for compatibility with prt-get
.IP \(bu 3
@ -143,7 +143,7 @@ You can specify a wildcard filter to filter by package name.
.TP
.B
lock <package1> [<package2>..<packageN>]
Lock a package (ignore updates).
Lock a package (exclude it from being updated in a \fBsysup\fP).
.TP
.B
unlock <package1> [<package2>..<packageN>]
@ -164,47 +164,65 @@ Display brief help screen.
.TP
.B
version
Show \fBpkg-get\fP version.
.SH OPTIONS
Show \fBpkg\-get\fP version.
.SH OPTIONSB
.TP
.B
\fB-r\fP <root>
Use <root> directory for operations involving the package database
(install, depinst, update, isinst, current, listinst, diff, quickdiff, sysup).
This option does not affect the directories from which \fBpkg-get\fP loads the
metadata or tarballs; those settings are still governed by the entries in
the configuration file.
.TP
.B
\fB-do\fP
\fB\-do\fP
Download only. Applicable to: sysup, install, depinst, update.
.TP
.B
\fB-f\fP
\fB\-f\fP
Force installing / upgrading. This is passed to \fBpkgadd\fP(8).
.TP
.B
\fB-im\fP
\fB\-im\fP
Ignore md5sum mismatches.
.TP
.B
\fB--aargs\fP="arguments"
pass the specified arguments to \fBpkgadd\fP(8).
\fB\-\-aargs\fP="arguments"
Pass the specified arguments to \fBpkgadd\fP(8).
.TP
.B
\fB--config\fP=/path/to/file
\fB\-\-config\fP=/path/to/file
Use the specified configuration file.
.TP
.B
\fB--pre-install\fP
\fB\-r\fP <root>
Use <root> directory for operations involving the package database
(install, depinst, update, isinst, current, listinst, diff, quickdiff, sysup).
This option does not affect the directories from which \fBpkg\-get\fP loads the
metadata or tarballs; those settings are still governed by the entries in
the configuration file.
When using \fB\-r\fP <root>, the relevant pkgadd.conf is the one on the
target filesystem, not the one where \fBpkg\-get\fP is running. Any custom
directives in your pkgadd.conf should be copied to the corresponding
location under the new root, or else you should pass the \fB\-\-aargs\fP
option to tell \fBpkgadd\fP to read its configuration from a non-standard
location.
When combined with \fB\-\-pre\-install\fP or \fB\-\-post\-install\fP or
\fB\-\-install\-scripts\fP, setting a root directory other than '/' has the
side effect of copying the PKGINST shell script into the corresponding
location under the new root. This action (and the subsequent chroot command)
is the most direct way to accommodate the user's intention. Unfortunately it
clutters the mounted volume with a small fragment of shell script. If such
clutter is not desired, the option \fB\-r\fP <root> should always be paired
with the configuration setting 'runscripts no', leaving it up to the
administrator of the mounted volume to perform any pre- or post-install
tasks separately.
.TP
.B
\fB\-\-pre\-install\fP
Execute pre-install script if available.
.TP
.B
\fB--post-install\fP
\fB\-\-post\-install\fP
Execute post-install script if available.
.TP
.B
\fB--install-scripts\fP
\fB\-\-install\-scripts\fP
Execute pre-install and post-install
scripts if available.
.RE
@ -216,17 +234,17 @@ Configuration is handled by the /etc/pkg-get.conf file,
.SH EXAMPLES
.TP
.B
\fBpkg-get\fP install sqlite pysqlite
\fBpkg\-get\fP install sqlite pysqlite
Install sqlite and pysqlite.
.TP
.B
\fBpkg-get\fP depinst qt6-base \fB-f\fP
\fBpkg\-get\fP depinst qt6-base \fB\-f\fP
Install qt6-base and all its dependencies, forcing upgrade.
.TP
.B
\fBpkg-get\fP sysup \fB-do\fP
\fBpkg\-get\fP sysup \fB\-do\fP
Download new releases of all the outdated packages.
.SH AUTHORS
Simone Rota <sip@varlock.com>, John McQuah <jmcquah@disroot.org>
.SH SEE ALSO
\fBpkgadd\fP(8), \fBprt-get\fP(8), \fBpkg-repgen\fP(8)
\fBpkgadd\fP(8), \fBprt\-get\fP(8), \fBpkg\-repgen\fP(8)

View File

@ -7,11 +7,11 @@ SYNOPSIS
pkg-get command <arguments> [options]
DESCRIPTION
pkg-get is a simple package management tool for CRUX Linux.
It tries to replicate some of the most useful features of the
port management tool prt-get(8) to be used with binary packages.
pkg-get is a simple package management tool for CRUX Linux. It
tries to replicate some of the most useful features of the port
management tool prt-get(8) to be used with binary packages.
pkg-get requires a remote or local package repository that can be
generated by repository maintainers with the pkg-repgen(8) script.
generated by repository maintainers with the pkg-repgen(8) script.
COMMANDS
install <package1> [<package2>..<packageN>]
@ -21,14 +21,14 @@ COMMANDS
Update given packages, download if necessary.
diff [--all]
Show a list of outdated packages. The --all option also
displays locked packages.
Show a list of outdated packages. The --all option
also dis plays locked packages.
quickdiff
Show a compact list of outdated packages.
sysup [--all]
Update all outdated packages, download if necessary.
Update all outdated packages, download if necessary.
Locked packages are excluded from the operation unless
--all is passed.
@ -36,21 +36,21 @@ COMMANDS
Install given packages and relative dependencies.
depends <package>
Show a recursive list of dependencies for package and
their installation status.
Show a recursive list of dependencies for <package>
and their installation status.
quickdep <package>
Show a brief list of dependencies for package.
Show a brief list of dependencies for <package>.
dependent <package> [--all]
Show installed (or all with the --all option) packages
that depend from package.
that de pend on <package>.
path <package>
Show local path of package.
Show local path of <package>.
info <package>
Show information about package.
Show information about <package>.
current <package>
Show currently installed version of package.
@ -61,7 +61,7 @@ COMMANDS
readme <package>
Print README information (if available) for the package.
list List all packages in the repository.
list List all packages in the active repositories.
listinst
List all installed packages.
@ -77,35 +77,47 @@ COMMANDS
repository).
printf <format string1> [--filter=<filter>]
Description blatantly stolen from prt-get(8). Print
Description blatantly stolen from prt-get(8). Print
formatted port list. Format string can contain variables,
which are replaced like this:
which are re placed like this:
• %n -> name
• %p -> path
• %v -> version
• %r -> release
• %d -> description
• %e -> dependencies
• %u -> url
• %R -> Readme ("yes"/"no")
• %E -> pre-install script ("yes"/"no")
• %O -> post-install script ("yes"/"no")
• %M -> "Nobody". for compatibility with prt-get
• %M -> "None". for compatibility with prt-get
• %P -> "None". for compatibility with prt-get
• %l -> is locked ("yes"/"no")
• %i -> "no" if not installed, "yes" if it's installed
and up to date and "diff" if it's installed and
a new version is in the repository.
• %i -> "no" if not installed, "yes" if it's installed
and up to date and "diff" if it's installed and a new
version is in the repository.
Use "\n" and "\t" to format your output (no additional format
codes supported). The optional format string2 can contain
the same variables as format string1 and is used to sort
the output. You can specify a wildcard filter to filter by
package name.
codes supported). The optional format string2 can contain the
same variables as format string1 and is used to sort the output.
You can specify a wildcard filter to filter by package name.
lock <package1> [<package2>..<packageN>]
Lock a package (ignore updates).
Lock a package (exclude it from being updated in a sysup).
unlock <package1> [<package2>..<packageN>]
Unlock a package.
@ -122,15 +134,7 @@ COMMANDS
version
Show pkg-get version.
OPTIONS
-r <root>
Use <root> directory for operations involving the package
database (install, depinst, update, isinst, current,
listinst, diff, quick diff, sysup). This option does
not affect the directories from which pkg-get loads the
metadata or tarballs; those settings are still governed
by the entries in the configuration file.
OPTIONSB
-do Download only. Applicable to: sysup, install, depinst,
update.
@ -144,6 +148,35 @@ OPTIONS
--config=/path/to/file
Use the specified configuration file.
-r <root>
Use <root> directory for operations involving the package
database (install, depinst, update, isinst, current,
listinst, diff, quickdiff, sysup). This option does
not affect the directories from which pkg-get loads the
metadata or tarballs; those settings are still
governed by the entries in the configuration file.
When using -r <root>, the relevant pkgadd.conf is the one
on the target filesystem, not the one where pkg-get is
running. Any custom directives in your pkgadd.conf should
be copied to the corresponding location under the
new root, or else you should pass the --aargs option to
tell pkgadd to read its configuration from a non-standard
location.
When combined with --pre-install or --post-install
or --install-scripts, setting a root directory other
than '/' has the side effect of copying the PKGINST
shell script into the corresponding location under
the new root. This action (and the subsequent chroot
command) is the most direct way to accommodate the user's
intention. Unfortunately it clutters the mounted volume
with a small fragment of shell script. If such clutter
is not desired, the option -r <root> should always be
paired with the configuration setting 'runscripts no',
leaving it up to the administrator of the mounted volume
to perform any pre- or post- install tasks separately.
--pre-install
Execute pre-install script if available.
@ -173,4 +206,4 @@ AUTHORS
SEE ALSO
pkgadd(8), prt-get(8), pkg-repgen(8)
July 13, 2006 pkg-get(8)
July 13, 2006 pkg-get(8)

View File

@ -1,18 +1,18 @@
.TH pkg-repgen 8 "July 13, 2006" "" ""
.SH NAME
\fBpkg-repgen \fP- generate a package repository for pkg-get
\fBpkg\-repgen \fP- generate a package repository for pkg-get
\fB
.SH SYNOPSIS
.nf
.fam C
\fBpkg-repgen\fP [options][package1\.\.\.packageN]
\fBpkg\-repgen\fP [options][package1\.\.\.packageN]
.fam T
.fi
.SH DESCRIPTION
\fBpkg-repgen\fP generates files needed by a \fBpkg-get\fP(8) package
\fBpkg\-repgen\fP generates files needed by a \fBpkg\-get\fP(8) package
repository. It also generates a html index of the packages.
.SH USAGE
Run \fBpkg-repgen\fP from the directory containing packages to
Run \fBpkg\-repgen\fP from the directory containing packages to
generate the whole repository.
Specify a list of package names to update only those packages
(this is especially useful with large repositories).
@ -22,26 +22,26 @@ scripts.
.SH OPTIONS
.TP
.B
\fB--header\fP=FILE
\fB\-\-header\fP=FILE
insert FILE at the beginning of the html index
.TP
.B
\fB--header\fP=FILE
\fB\-\-header\fP=FILE
insert FILE at the beginning of the html index
.TP
.B
\fB--title\fP=title
\fB\-\-title\fP=title
use the specified title for the index page
.TP
.B
\fB--prtdir\fP=DIR
\fB\-\-prtdir\fP=DIR
use alternative prtdir for prt-get commands
.SH EXAMPLES
\fBpkg-repgen\fP
\fBpkg\-repgen\fP
.PP
\fBpkg-repgen\fP qt6-base qt6-tools
\fBpkg\-repgen\fP qt6-base qt6-tools
.SH AUTHORS
Simone Rota <sip@varlock.com>, John McQuah <jmcquah@disroot.org>
index generation code adapted from Jukka Heino's portspage
.SH SEE ALSO
\fBpkg-get\fP(8), \fBprt-get\fP(8)
\fBpkg\-get\fP(8), \fBprt\-get\fP(8)

View File

@ -1,4 +1,4 @@
pkg-repgen(8)
pkg-repgen(8)
NAME
pkg-repgen - generate a package repository for pkg-get
@ -11,12 +11,12 @@ DESCRIPTION
repository. It also generates a html index of the packages.
USAGE
Run pkg-repgen from the directory containing packages to generate
the whole repository. Specify a list of package names to
update only those packages (this is especially useful with large
repositories). Even when individual packages are specified,
the entire directory is still processed to collect all the
readmes and {pre,post}-install scripts.
Run pkg-repgen from the directory containing packages to
generate the whole repository. Specify a list of package names
to update only those packages (this is especially useful with
large repositories). Even when individual packages are specified,
the entire directory is still processed to collect all the readmes
and {pre,post}-install scripts.
OPTIONS
--header=FILE
@ -43,4 +43,4 @@ AUTHORS
SEE ALSO
pkg-get(8), prt-get(8)
July 13, 2006 pkg-repgen(8)
July 13, 2006 pkg-repgen(8)

View File

@ -560,8 +560,8 @@ sub search {
my %pkg = parsepackage($_, $dir, $url);
next if ($found{$pkg{'name'}});
(index($pkg{'name'}, $arg) < 0) or $found{$pkg{'name'}} = 1;
($found{$pkg{'name'}}==1) or ($type ne "desc")
or (index($pkg{'description'}, $arg) < 0)
(! $found{$pkg{'name'}}) or ($found{$pkg{'name'}}==1)
or ($type ne "desc") or (index($pkg{'description'}, $arg) < 0)
or $found{$pkg{'name'}} = 1;
}
close(REPO);