Compare commits

..

25 Commits

Author SHA1 Message Date
a2626355ac fix printf when used with --regex
strip parentheses when parsing softdeps
2023-12-02 14:46:00 +00:00
bfb5cde112 be more selective when applying forceRebuild 2023-09-15 04:22:01 -04:00
d2951b0897 use a common style to show missing or already-installed ports (FS#1843)
i3-softdeps.md: slight rewording
2023-09-14 20:12:16 -04:00
1287e9920d respect -fr (forceRebuild) even if built package is newer than Pkgfile 2023-09-14 20:11:52 -04:00
a073423a89 updated ChangeLog 2023-09-04 19:10:31 -04:00
284b9e5e21 add support for rmlog_on_uninst 2023-09-04 15:13:04 -04:00
4c821419fb refresh the man-page examples 2023-09-01 16:03:14 -04:00
e97879074b i3-softdeps.md: minor revisions 2023-08-26 17:24:39 -04:00
449c0e0553 i3 softdeps test: updated
i3-softdeps.md: fix markup
2023-08-25 10:52:05 -04:00
5ee692a858 upload a discussion of the i3 softdeps test 2023-08-25 10:00:19 -04:00
91632a574d prune unreachable code paths
revise man-page discussion of --install-root
2023-08-24 10:48:09 -04:00
1c3bcde003 upload results of the i3 softdeps test 2023-08-22 20:30:10 -04:00
4b069aa3d6 revise the softdeps calculation 2023-08-22 09:12:05 -04:00
e67aa2cbd3 consolidate the tests in calcDependencies() 2023-08-21 07:52:08 -04:00
507afd9766 report pre- and post-install scripts in test mode 2023-06-23 15:28:05 -04:00
68239f077b support more format codes in the argument to 'dup'
expand man-page to explain some asymmetries
2023-06-23 11:46:46 -04:00
06b1599c8c man-page: add a few references and another example
correct misspellings and inaccuracies

fix formatting
2023-06-21 21:16:32 -04:00
7c1126f0b0 man-page: fix indentation and formatting
document the interaction between --install-root and 'runscripts yes'
2023-06-20 16:55:36 -04:00
b5aa185537 cache the pkgmk.conf settings to avoid repeated disk reads (FS#595) 2023-06-08 11:42:58 -04:00
3a53676253 fix several compile warnings (-Wreorder, unused parameter) 2023-06-08 07:04:48 -04:00
7dc024e103 switch from autotools to meson; update docs 2023-06-02 16:05:42 -04:00
6e4a4d8daa respect --install-root when running pre- and post-install scripts 2023-06-02 15:56:31 -04:00
f2c0f370d4 cut down on duplicate code; fix FS#1930; expand man-page examples 2023-06-02 15:53:29 -04:00
8ac36484c5 expand the prt-get man-page with more examples
add more details to the prt-cache man-page
2023-03-13 14:37:34 -04:00
5d2b5e0ac0 fix FS#1910; merge Alan's patch for the --group flag; update shell completions
remove some anachronisms from the aliases file
2023-03-13 14:36:00 -04:00
30 changed files with 1514 additions and 2915 deletions

View File

@ -1 +1,2 @@
Johannes Winkelmann, jw@tks6.net Johannes Winkelmann, jw@tks6.net
John McQuah, jmq@rawtext.club

View File

@ -1,15 +1,39 @@
* 31.08.2023 John McQuah * 31.08.2023 John McQuah
- allow prt-get to remove build log when uninstalling a package (feature - allow deletion of build log when a package is removed (feature requested
requested by samsep10l) by samsep10l)
- man-page updates
- demonstrate how to troubleshoot a failed depinst due to omitted softdeps
- discuss the rmlog_on_uninst feature
* 31.03.2023 John McQuah * 29.05.2023 John McQuah
- respect the user's choice of --install-root when running pre- or - eliminate code duplication in printDepTree
- respect the user's choice of --install-root when running pre- and
post-install scripts post-install scripts
- update man-page with an example of core-only sysup
- switch from autotools to meson
* 19.03.2023 John McQuah
- switch between install and update on a port-by-port basis, whichever is needed
- allow dependency injection during sysup (controllable via --nodeps)
- check whether a built package already exists before calling pkgmk
- consolidate printDependent and printDepTree
- consolidate sysup, printQuickDiff, and printDiff
- let the argParser recognize some synonyms for old commands
- assign meanings to --nodeps and --depsort for other subroutines
* 10.03.2023 John McQuah * 10.03.2023 John McQuah
- make it possible to consider optional dependencies when updating - make it possible for the dependency resolver to consider optionals
- bump version of the cache file format, to warn users about the
'Packager' field being replaced by 'Optional' * 27.02.2022 Alexandr Savca, Tim Biermann
- fix segfault in prt-cache
* 5.19.5 16.10.2020 Matt Housh, Juergen Daubert
- add a regex fix for listinst
- move aliases file to /etc
* 5.19.2 01.03.2019 James Buren
- fix misc compiler warnings
- fix FS#1646, caused by wrong use of close() instead of fclose()
* 5.16 26.06.2008 Johannes Winkelmann * 5.16 26.06.2008 Johannes Winkelmann
- don't loop forever when version= contains unsupported $() tokens - don't loop forever when version= contains unsupported $() tokens

8
FAQ
View File

@ -1,8 +0,0 @@
Q: Why are there no wildcards for install/update/grpinst
A: Because you don't want it (dependencies)
Q: Why is there no prt-get depinst?
A:
Q: Why is there no GUI or shared lib for/of prt-get?
A:

15
README
View File

@ -9,6 +9,7 @@ ports from crux (http://crux.nu). It offers some simplification over
pure pkgmk, but might hide some interesting details about the install pure pkgmk, but might hide some interesting details about the install
process. process.
Installing: Installing:
----------- -----------
Download an iso of the latest CRUX release for a precompiled package. Download an iso of the latest CRUX release for a precompiled package.
@ -23,18 +24,20 @@ found _first_ will be used.
Feel free to file a bug report on the Gitea issue tracker: Feel free to file a bug report on the Gitea issue tracker:
https://git.crux.nu:82/farkuhar/prt-get/issues/ https://git.crux.nu:82/farkuhar/prt-get/issues/
more information
---------------- More information:
See the man pages for prt-get(8), prt-get.conf(5) and prt-cache for more -----------------
See the man pages for prt-get(8), prt-get.conf(5) and prt-cache(8) for more
information. The CRUX homepage also offers a (somewhat dated) User Manual information. The CRUX homepage also offers a (somewhat dated) User Manual
and Quick Start guide: and Quick Start guide:
https://crux.nu/doc/prt-get%20-%20User%20Manual.html https://crux.nu/doc/prt-get%20-%20User%20Manual.html
https://crux.nu/doc/prt-get%20-%20Quick%20start.html https://crux.nu/doc/prt-get%20-%20Quick%20start.html
"it must be user error" (thinkgeek) "it must be user error" (thinkgeek)
----------------------------------- -----------------------------------
port directories may only contain ports, or else prt-get can fail (which Port directories may only contain ports, or else prt-get can fail (which
means that nothing is installed, your system takes no harm). The reason means that nothing is installed, your system suffers no harm). The reason
for this is because the additional checking slows down the application for this is because the additional checking slows down the application
too much too much.

2
TODO
View File

@ -1,5 +1,5 @@
- add --rebuild-set to dependent - add --rebuild-set to dependent
- allow dependency injection for sysup, with previews - allow dependency injection for sysup (done), with previews (?)
- prefer toolchain (patch in trac) - prefer toolchain (patch in trac)
- logging: check for non-root owned symlinks - logging: check for non-root owned symlinks
- logging: reject relative logfile names - logging: reject relative logfile names

View File

@ -1,10 +0,0 @@
man_MANS = prt-get.8 prt-cache.8 prt-get.conf.5
clean-local:
rm -rf *.log *.aux *.toc *.dvi *.idx *.pdf api
apidoc:
doxygen
EXTRA_DIST = $(man_MANS) coding

View File

@ -1,492 +0,0 @@
# Makefile.in generated by automake 1.12.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
subdir = doc
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(top_srcdir)/mkinstalldirs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
man5dir = $(mandir)/man5
am__installdirs = "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)"
man8dir = $(mandir)/man8
NROFF = nroff
MANS = $(man_MANS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
man_MANS = prt-get.8 prt-cache.8 prt-get.conf.5
EXTRA_DIST = $(man_MANS) coding
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu doc/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-man5: $(man_MANS)
@$(NORMAL_INSTALL)
@list1=''; \
list2='$(man_MANS)'; \
test -n "$(man5dir)" \
&& test -n "`echo $$list1$$list2`" \
|| exit 0; \
echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(man5dir)" || exit 1; \
{ for i in $$list1; do echo "$$i"; done; \
if test -n "$$list2"; then \
for i in $$list2; do echo "$$i"; done \
| sed -n '/\.5[a-z]*$$/p'; \
fi; \
} | while read p; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
done | \
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
sed 'N;N;s,\n, ,g' | { \
list=; while read file base inst; do \
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \
fi; \
done; \
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
while read files; do \
test -z "$$files" || { \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \
done; }
uninstall-man5:
@$(NORMAL_UNINSTALL)
@list=''; test -n "$(man5dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
sed -n '/\.5[a-z]*$$/p'; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir)
install-man8: $(man_MANS)
@$(NORMAL_INSTALL)
@list1=''; \
list2='$(man_MANS)'; \
test -n "$(man8dir)" \
&& test -n "`echo $$list1$$list2`" \
|| exit 0; \
echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \
{ for i in $$list1; do echo "$$i"; done; \
if test -n "$$list2"; then \
for i in $$list2; do echo "$$i"; done \
| sed -n '/\.8[a-z]*$$/p'; \
fi; \
} | while read p; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
done | \
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
sed 'N;N;s,\n, ,g' | { \
list=; while read file base inst; do \
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
fi; \
done; \
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
while read files; do \
test -z "$$files" || { \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
done; }
uninstall-man8:
@$(NORMAL_UNINSTALL)
@list=''; test -n "$(man8dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
sed -n '/\.8[a-z]*$$/p'; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir)
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
cscope cscopelist:
distdir: $(DISTFILES)
@list='$(MANS)'; if test -n "$$list"; then \
list=`for p in $$list; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
if test -n "$$list" && \
grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
echo "error: found man pages containing the 'missing help2man' replacement text:" >&2; \
grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
echo " typically 'make maintainer-clean' will remove them" >&2; \
exit 1; \
else :; fi; \
else :; fi
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(MANS)
installdirs:
for dir in "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-local mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-man
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man: install-man5 install-man8
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-man
uninstall-man: uninstall-man5 uninstall-man8
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-local \
distclean distclean-generic distdir dvi dvi-am html html-am \
info info-am install install-am install-data install-data-am \
install-dvi install-dvi-am install-exec install-exec-am \
install-html install-html-am install-info install-info-am \
install-man install-man5 install-man8 install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am uninstall uninstall-am uninstall-man \
uninstall-man5 uninstall-man8
clean-local:
rm -rf *.log *.aux *.toc *.dvi *.idx *.pdf api
apidoc:
doxygen
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

110
doc/i3-softdeps.md Normal file
View File

@ -0,0 +1,110 @@
# Followup on installing i3 with the softdeps-aware fork of prt-get
## (Was: Re: [prt-get nicetohave](https://lists.crux.nu/pipermail/crux/2023-August/007375.html))
## 2023-08-25
The "Optional" metadata field stirred up some controversy when first
proposed. At the time, it was preferred to write Pkgfiles whose build()
functions contain no branching logic to customize the build for the host
machine. Maintainers would even try to suppress the branching logic hidden
inside the autotools ./configure script using command-line switches to
hard-code the desired defaults [1]. Peer pressure eventually wore away at
the resistance to this new metadata field, so it is now in widespread use
despite there being no official mandate for contributors to test their ports
under all possible configurations. Whenever a port can adapt to a variety of
use-cases, maintainers try to document that versatility in the "Optional"
field. But our package management tools remain unable to use that data! At
present, it requires a human reading the Pkgfile, for the data in the "Optional"
field to affect the order in which ports are built. Thankfully, sorting with
optional dependencies taken into account is now possible in prt-get itself,
either with the
[softdeps](https://git.crux.nu:82/farkuhar/prt-get/src/branch/softdeps) or the
[mixed-upinst](https://git.crux.nu:82/farkuhar/prt-get/src/branch/mixed-upinst)
branch of the fork by farkuhar.
Respecting the limitations of a prt-get that only knows about hard dependencies
would entail following the old practice and hard-coding the configure options
in each port. This example of letting our tools dictate how we work (rather
than updating the tools to fit a new workflow) would encourage a portdb more
like the AUR, with a seemingly endless variety of dups that all have
their own particular combination of configure options. Thankfully the
unwieldiness of this prospect was enough to deter maintainers from clinging to
an outmoded interpretation of KISS [3], and they adopted the new norm of
"fluid Pkgfiles" (FS#1576) even as prt-get remained unable to incorporate this
fluidity in its operations.
As recently as November 2021, users of CRUX could still have noticed a remnant
of the historical preference for non-fluid Pkgfiles, illustrated by the
coexisting pair harfbuzz and harfbuzz-icu. These ports differed from each other
only in the configuration option that enables linking to icu. A port that
depends on the icu-linked harfbuzz would list harfbuzz-icu among its
dependencies, while a port that did not require such linking would only
list harfbuzz.
Such dups in the portdb, all using the same upstream tarball, inevitably
have overlapping footprints, and it becomes impossible to avoid filesystem
collisions if a user running `prt-get depinst foo` triggers an attempt to
pkgadd a variant of an already-installed port. Once the set of installed
ports is sufficiently diverse, maintaining prt-get.aliases so as to avoid
such collisions becomes an impossible task.
Nix (and GoboLinux even earlier) solves the overlapping footprint problem
by giving each package its own separate directory in the filesystem. This
solution arguably fits quite well with the historical CRUX preference for
rigid Pkgfiles, offering a one-to-one correspondence between a repository
of non-fluid ports, and the filesystem where built packages are unpacked.
But CRUX was reluctant to impose an additional layer of complexity on top
of the Filesystem Hierarchy Standard, and so the Nix and GoboLinux solution
never gained serious consideration in the CRUX community.
As the last vestige of a historical preference for non-fluid ports,
harfbuzz and harfbuzz-icu persisted alongside each other until surprisingly
recently, only getting merged into one fluid port with commit
b2e30dbf8c96e03f4fe4b39b1e5ffbecd8372787. This merge allowed users to
simplify prt-get.aliases, removing `harfbuzz-icu: harfbuzz` (if they had
ever added such an entry to avoid filesystem collisions).
Equipping prt-get with softdeps awareness is just letting our tools evolve
to match the trend toward fluid Pkgfiles. If the new prt-get capabilities
are deemed to violate the CRUX Mantra [2], then the same criticism can be
leveled against fluid Pkgfiles. Such criticisms were in fact expressed
(by Anton most stridently, and by Tilman and Juergen in a gentler tone)
during the discussions of USE flags and "prt-get nicetohave" [3,4]. But the
resistance to fluid Pkgfiles has diminished over the years, to such an extent
that nobody has seriously proposed crafting the dependency graph so that
`prt-get depinst i3` is impossible to fail [5], say by making i3 depend on a
duplicate port libxkbcommon-x11 (which would differ from libxkbcommon only by
hard-coding the meson option "-D enable-x11" and by listing xkeyboard-config
as a hard dependency --- similar to how harfbuzz-icu differed from harfbuzz).
A duplicate port of libxkbcommon is indeed a KISS solution, with prt-get in its
present state. That nobody bothered to propose such a dup is a clear indication
that we are not going back to non-fluid Pkgfiles anytime soon. So either our
Pkgfiles have irrevocably become "just a bit" more complex (and therefore no
longer "simple"), or they are in fact the simplest way to accommodate the modern
software landscape. In the latter case, a KISS objection to the corresponding
logic in prt-get is hypocritical. In the former case, it could be argued that two
wrongs do not make a right, and the trend away from KISS Pkgfiles does not
justify making prt-get "just a bit" more complex. But then we would have an
awkward mismatch between the capabilities of prt-get, and the ports that it
has to handle. This mismatch is only a slight annoyance at present (the
experienced users that make up the CRUX target audience can usually diagnose
the problem themselves if they encounter a build failure like [5]), but before the
software landscape becomes even more convoluted and such build failures harder
to avoid, we should have the discussion on adding new logic to prt-get.
[1] It should be noted that the autotools ./configure script (or its
meson or cmake counterpart) might not actually expose all compile-time
options via command-line switches. Hence some testing of the host
environment is unavoidable, unless the port maintainer performs substantial
downstream patching of the source tree.
[2] We do not want to prepare for all necessities and build a complex system
which in 90% of all cases is overkill ... making something "just a bit"
more complex is not "simple" anymore. (https://crux.nu/Main/Mantra)
[3] https://lists.crux.nu/pipermail/crux-devel/2006-August/001912.html
[4] https://lists.crux.nu/pipermail/crux-devel/2008-May/003366.html
[5] The possibility of this command failing was first noted by jaeger in
https://libera.irclog.whitequark.org/crux/2023-08-21 (16:36)

291
doc/i3-softdeps.test Normal file
View File

@ -0,0 +1,291 @@
Thanks to hestia and jaeger for inspiring this hacking session (2023-08-22).
(Update 2023-08-25): see i3-softdeps.md in this directory for more
discussion on the merits of adding new prt-get features.
In light of the recent changes to libxkbcommon, jaeger made the observation
that `prt-get depinst i3` on a core-only system hits an error, as
libxkbcommon will be built without x11 support. To establish a reference point
for subsequent experiments, here is the list of targets that would be selected
by the latest official release of prt-get (5.19.6), in response to the
recommended way of installing a desired port.
All commands were performed on a pkg-cleaned installation of CRUX 3.7, leaving
the ports at whatever outdated version they had when this particular system was
last in daily use.
In[0]: prt-get depinst --test i3
Out[0]:
*** prt-get: test mode
-- Packages installed
fribidi
xorg-util-macros
xorg-libpixman
libev
libpng
libxml2
xorg-xtrans
libxkbcommon
libxslt
xorg-xcb-proto
yajl
xorg-xorgproto
freetype
glib
xorg-libice
xorg-libxau
xorg-libxdmcp
fontconfig
gobject-introspection
xorg-libsm
xorg-libxcb
xorg-libx11
xorg-xcb-util
xorg-xcb-util-renderutil
xorg-xcb-util-keysyms
xorg-xcb-util-wm
xorg-libxext
xorg-libxrender
xorg-libxt
xorg-libxkbfile
xorg-xcb-util-image
xorg-xcb-util-xrm
cairo
startup-notification
xorg-xkbcomp
xorg-xcb-util-cursor
harfbuzz
xkeyboard-config
xorg-libxft
pango
i3
-- installed packages with README files:
fontconfig
prt-get: installed successfully
*** prt-get: test mode end
As seen in the output above, at the time of building libxkbcommon, there are
only 7 non-core ports installed, none of which is xkeyboard-config,
so the flag '-D enable-x11=false' gets passed to the meson setup command for
libxkbcommon. Thus the necessary linking to x11 libs does not happen, and i3
cannot compile successfully.
Suppose we try to fix this omission in the most natural way: append
xkeyboard-config at the end of i3's dependency list.
sed -i '/^# Depends on/s/$/ xkeyboard-config/' /usr/ports/opt/i3/Pkgfile
Even this change is not enough! prt-get is not aware of the optional
dependency relationship between libxkbcommon and xkeyboard-config, and so
cannot insist that libxkbcommon comes later in the list of targets. jw
came to a similar conclusion 15 years ago (footnote 1).
Let's see whether farkuhar's softdeps-aware fork can do any better on this
task. The naive approach, prt-get depinst --softdeps i3, still doesn't work
because it will not automagically make two passes through the dependency tree
(the first pass to assemble a minimal installation set, and the second pass to
insert edges in the digraph based on optional dependency relationships among
the targets found). Instead, you have to manually ask for two traversals of the
dependency tree using a command substitution.
In[1]: prt-get isinst $(prt-get quickdep i3) | awk '/not installed/ {print $2}' \
| xargs prt-get depinst --test --softdeps
(Note that it's also necessary to filter out the already-installed ports before
passing the quickdep output to `prt-get depinst` because this branch still
makes a distinction between install and update transactions.)
Out[1]:
*** prt-get: test mode
-- Packages installed
fribidi
xorg-util-macros
xorg-libpixman
libev
xorg-xtrans
libpng
libxml2
fontconfig
libxslt
xorg-xcb-proto
yajl
xorg-xorgproto
glib [post: deferred]
xorg-libxau
xorg-libxdmcp
xorg-libice
xorg-libxcb
xorg-libsm
xorg-libx11
xorg-xcb-util
xorg-xcb-util-renderutil
xorg-xcb-util-keysyms
xorg-xcb-util-wm
xorg-libxkbfile
xorg-libxext
xorg-libxrender
xorg-libxt
xorg-xcb-util-image
xorg-xcb-util-xrm
xorg-xkbcomp
cairo
startup-notification
xorg-xcb-util-cursor
xkeyboard-config
gobject-introspection
libxkbcommon
harfbuzz
freetype
xorg-libxft
pango
i3
-- installed packages with README files:
/usr/ports/opt/fontconfig
prt-get: installed successfully
*** prt-get: test mode end
This output looks more likely to succeed. Note that libxkbcommon would be built
AFTER its optional dependency xkeyboard-config, because when xkeyboard-config
appears among the depinst targets, that dependency relationship gets
incorporated into the sorting algorithm.
The mixed-upinst branch of farkuhar's prt-get goes further. Not only do you
get the feature of respecting optional dependencies, you can also do the
command substitution without the awk filter, and the appropriate mode
(install or update) will be selected for each target.
In[2]: prt-get depinst --softdeps --test $(prt-get quickdep i3)
Out[2]:
*** prt-get: test mode
-- Successful packages
fribidi
xz
zlib
ncurses
expat
libffi
libnghttp2
openssl
libuv
lzlib
rhash
xorg-util-macros
libpcre2
xorg-libpixman
libev
libpng
elfutils
libxml2
readline
fontconfig
xorg-xtrans
file
curl
libxslt
sqlite3
libarchive
util-linux
python3
cmake
python3-setuptools
xorg-xcb-proto
yajl
meson
xorg-xorgproto
glib [post: deferred]
xorg-libxau
xorg-libxdmcp
xorg-libice
xorg-libxcb
xorg-libsm
xorg-libx11
xorg-xcb-util
xorg-xcb-util-renderutil
xorg-xcb-util-keysyms
xorg-xcb-util-wm
xorg-libxkbfile
xorg-libxext
xorg-libxrender
xorg-libxt
xorg-xcb-util-image
xorg-xcb-util-xrm
xorg-xkbcomp
cairo
startup-notification
xorg-xcb-util-cursor
xkeyboard-config
gobject-introspection
libxkbcommon
harfbuzz
freetype
xorg-libxft
pango
i3
-- Successful packages with README files:
fontconfig
prt-get: install successful.
*** prt-get: test mode end
The output of the last command reveals why we recommend performing a sysup
before installing new ports. Because dependencies in core are not listed unless
they are dynamically linked in, some of the out-of-date core ports on my test
system would get updated later, possibly leading to breakage (e.g, if the
desired port is relying on a new or backward-incompatible feature in one of
the foundational pieces of the toolchain).
Footnotes:
1. https://lists.crux.nu/pipermail/crux-devel/2008-May/003375.html
2. The more intuitive version of the above commands, `prt-get depinst
--test --softdeps i3`, currently does NOT consider the dependency
relationship "libxkbcommon optionally depends on xkeyboard-config", because
the latter port is neither currently installed, nor listed explicitly as an
install target. This safeguard is meant to allow the operation to proceed
after a SINGLE pass through the deptree, without pulling in ALL the ports
listed as "Optional:" . In future we might consider letting the more
intuitive command automatically make TWO passes through the deptree:
first to pick up all the hard dependencies, and then to insert edges in the
digraph that encode the optional dependencies among these targets. But such
"automagic side-effects" (two traversals versus one) are typically frowned
upon in CRUX, so for now we are happy to employ the command substitution
$(prt-get quickdep i3) thereby communicating to prt-get our intention for
two traversals of the deptree.
3. The result of trial 2 would be identical to that of
`prt-get install --softdeps $(prt-get quickdep i3)` using the
mixed-upinst branch, because 'install' on this branch behaves the same
as 'depinst'. In https://lists.crux.nu/pipermail/crux/2008-June/001784.html
jw describes this change as "prt-get no more silently assumes that the user
didn't want a particular dependency".
farkuhar's mixed-upinst branch still gives you the option to override this
dependency-resolution-by-default; you just have to enter 'install --nodeps'
instead of simply 'install'.
4. Some maintainers prefer to do a filesystem check to determine whether a
needed dependency was linked to one of its optional libraries, and then
exit early with a message alerting the user to rebuild one of the packages
in the dependency tree. See contrib/libreoffice for an example. This
preference is arguably more aligned with CRUX's stance against excessively
"holding the user's hand". The softdeps feature is not intended to supplant
the user's thinking, but rather to give convenient access to a more versatile
topological sorting algorithm than the one coded in the official prt-get. The
toposort algorithm used in the above experiments remains true to the style
of jw's original code, but you can see another working implementation in
farkuhar's Perl rewrite
https://git.sdf.org/jmq/Documentation/src/branch/master/scripts/prt-auf .

View File

@ -14,7 +14,7 @@ pkgutils from CRUX (see http://www.crux.nu)
.B prt\-get command [options] <arguments> .B prt\-get command [options] <arguments>
.br .br
.SH "DESCRIPTION" .SH "DESCRIPTION"
prt\-get is a package management tool which provides additional prt-get is a package management tool which provides additional
functionality to the CRUX package management system. It works with the functionality to the CRUX package management system. It works with the
local ports tree and is therefore fully compatible with ports(8) and local ports tree and is therefore fully compatible with ports(8) and
pkgmk(8)/pkgadd(8)/pkgrm(8). It offers the following features: pkgmk(8)/pkgadd(8)/pkgrm(8). It offers the following features:
@ -42,16 +42,16 @@ search within the ports
.PP .PP
What prt\-get basically does is build, install/upgrade, and remove packages, using What prt-get basically does is build, install/upgrade, and remove packages,
pkgmk, pkgadd, and pkgrm. Additionally, you don't have be in the port's using pkgmk, pkgadd, and pkgrm. Additionally, you don't have be in the port's
directory to call prt\-get. prt\-get will search for the respective port directory to call prt-get. prt-get will search for the respective port
itself in a list of directories specified in /etc/prt\-get.conf. This itself in a list of directories specified in /etc/prt-get.conf. This
allows you to just install or update a package, without caring where allows you to just install or update a package, without caring where
it actually is located on your file system. it actually is located on your file system.
.PP .PP
prt\-get also lets you search for ports by name, prt-get also lets you search for ports by name,
find information about ports (without installing them of course), find information about ports (without installing them of course),
or print the dependencies of a port (as a space- or newline-separated list, or print the dependencies of a port (as a space- or newline-separated list,
or a formatted tree). Note that dependencies are no or a formatted tree). Note that dependencies are no
@ -59,109 +59,91 @@ requirement for crux packages and therefore not always accurate.
.PP .PP
prt\-get has a test mode so you can see what effect an install/update prt-get has a test mode so you can see what effect an install/update
operation would have. Use the \-\-test switch for this (more details in operation would have. Use the --test switch for this (more details in
the \fBOPTIONS\fP section below). the \fBOPTIONS\fP section below).
.SH "RETURN VALUE" .SH "RETURN VALUE"
prt\-get returns 0 on success and a non-zero value otherwise (exact prt-get returns 0 on success and a non-zero value otherwise (exact
value -> meaning mapping to be determined...) value -> meaning mapping to be determined...)
.SH "COMMANDS" .SH "COMMANDS"
prt\-get uses so\-called commands, which always have to be the first prt-get uses so-called commands, which always have to be the first
non-option argument passed. This is very similar to non-option argument passed. This is very similar to
.B cvs(1). .B cvs(1).
[command] can be one of the following: [command] can be one of the following:
.TP .TP
.B install [\-\-margs] [\-\-aargs] [\-\-log] <package1> [<package2> ...] .B install [\-\-margs] [\-\-aargs] [\-\-log] [\-\-nodeps] [\-\-softdeps] <package1> [<package2> ...]
Install all packages in the listed order. Note that you can do this Install or update the packages given on the command line. Note that you can do
from any directory. this from any directory. Pass the --nodeps flag to prevent \fBprt\-get\fP from
resolving dependencies and injecting any needed packages into the list of targets.
Pass the --softdeps flag if you want the dependency resolver to also consider
the "Optional" relationships among the packages given on the command line.
.TP .TP
.B depinst [\-\-margs] [\-\-aargs] [\-\-log] [\-\-softdeps] <package1> [<package2> ...] .B depinst [\-\-margs] [\-\-aargs] [\-\-log] [\-\-softdeps] <package1> [<package2> ...]
Install all packages given on the command line, including their dependencies. Basically a synonym for install (without the --nodeps flag).
Note that already-installed packages will be left at their current version,
even if out of date. prt\-get depinst behaves this way because all of its
child pkgadd processes will \fBlack\fP the \-u flag, which is needed when
updating an already-installed package.
Passing the --softdeps flag tells \fBprt-get\fP to consider also the optional
dependencies when sorting. The --softdeps flag does NOT affect the
calculation of the minimal set of packages needed to satisfy the
transaction; only hard dependencies are used when constructing this set. But
if there are any optional dependency relationships among the ports in the
resulting set, they will be respected when prt-get determines the sequence
in which to build.
.TP .TP
.B update [\-\-margs] [\-\-aargs] [\-\-log] <package1> [<package2> ...] .B update [\-\-margs] [\-\-aargs] [\-\-log] [\-\-softdeps] <package1> [<package2> ...]
Update all packages listed in this order. Note: if the latest version of a Basically a synonym for install. Earlier versions of \fBprt\-get\fP did not
package has acquired dependencies that were not needed by the adjust the \fBpkgadd(8)\fP arguments on a package-by-package basis, but
currently-installed version and are not present on the system, the update applied "install mode" or "update mode" to the entire transaction. This
command will not attempt to resolve this omission. prt-get update behaves version of \fBprt\-get\fP interprets the install command less rigidly, and tries
this way because pkgadd invocations inherit the flag -u for every package in to sync all affected ports with their repository versions unless instructed
the transaction, causing an error if the package is not already installed. otherwise (using \fBprt\-get lock\fP, the --prefer-higher option, or the
You can follow the CRUX mailing list or the IRC channels to stay informed of prt-get.aliases file).
the situations where an update will require manual intervention, or filter
the output of
.B prt\-get quickdep $(prt\-get quickdiff)
through \fBprt\-get isinst\fP to get a list of packages suitable for an
\fBinstall\fP or \fBupdate\fP command.
See the \fBEXAMPLES\fP section below for details.
.TP .TP
.B remove <package1> [<package2> ...] .B remove <package1> [<package2> ...]
Remove packages listed in this order Remove packages listed in this order
.TP .TP
.B sysup [\-\-softdeps] [\-\-nodeps] .B sysup [\-\-softdeps] [\-\-nodeps] [\-\-prefer\-higher] [\-\-strict\-diff]
Update all installed packages which are outdated. Sorts by hard dependencies Update all installed packages which are outdated. Sorts by hard dependencies
by default. Passing the --softdeps switch tells \fBprt\-get\fP to also consider by default. Passing the --softdeps switch tells \fBprt\-get\fP to also consider
optional dependencies when sorting. Passing the --nodeps switch tells prt-get optional dependencies when sorting. Passing the --nodeps switch tells prt-get
not to sort by dependencies at all, for approximately the same effect as not to sort by dependencies at all.
.B prt\-get update $(prt\-get quickdiff).
As with an \fBupdate\fP command, the child \fBpkgadd\fP processes will .B Note:
inherit the \-u flag, so if a port has acquired new dependencies since If a port has acquired new dependencies since its last successful build,
its last successful build, those new dependencies will be omitted from those new dependencies \fIwill\fP be injected into the transaction. An elegant
the transaction (unless they happen to be installed for some other reason and description of this new behaviour is "prt-get no more silently assumes that
are also in need of an update). See the \fBEXAMPLES\fP section for a way to the user didn't want a particular dependency" [1]. You can still disable the
automate the resolution of such omissions. Also see the automatic dependency injection by passing the --nodeps switch. Other
.B lock ways to fine-tune the selection of ports that are included in a \fBsysup\fP are the
and commands \fBlock\fP and \fBunlock\fP, the prt-get.aliases file, and the
.B unlock mutually exclusive switches --prefer-higher, --strict-diff (documented below).
commands to keep the currently installed versions, even if there are
changes in the ports tree. If you want to update only diffs which have [1] https://lists.crux.nu/pipermail/crux/2008-June/001784.html
a lower version installed than the one in the ports tree, use the
--prefer-higher option.
.TP .TP
.B lock <package1> [<package2>...] .B lock <package1> [<package2>...]
Do not update these packages in a Exclude these packages from being updated in a
.B sysup .B sysup
operation operation.
.TP .TP
.B unlock <package1> [<package2>...] .B unlock <package1> [<package2>...]
Remove lock from these packages Remove lock from these packages
.TP .TP
.B listlocked [-v|-vv] .B listlocked [\-v|\-vv]
List names of packages which are locked. As always, List names of packages which are locked. As always,
.B -v .B \-v
will additionally show the version, and will additionally show the version, and
.B -vv .B \-vv
also includes the description from the Pkgfile. Note that the also includes the description from the Pkgfile. Note that the
.B -vv .B \-vv
switch will slow down the operation remarkably. switch will slow down the operation remarkably.
.TP .TP
.B diff [\-\-all] [\-\-prefer\-higher] [<package1> <package2> ...] .B diff [\-\-all] [\-\-prefer\-higher] [<package1> <package2> ...]
Show differences between installed packages and ports in the ports Show differences between installed packages and ports in the ports
tree. If arguments are given, shows only differences for these tree. Package names passed as argument will truncate the output to
packages, otherwise all differences are shown. It's also possible to use show only those packages. It's also possible to use shell-like
shell-like
.B wildcards .B wildcards
for the diff command. Make sure you escape where needed. Locked for the diff command. Make sure you escape where needed. Locked
packages are only displayed if you use the --all switch. If you want packages are only displayed if you use the --all switch. If you want
@ -169,20 +151,14 @@ to see only diffs which have a lower version installed than the one in
the ports tree, use the --prefer-higher option. the ports tree, use the --prefer-higher option.
.TP .TP
.B quickdiff .B quickdiff [\-\-prefer\-higher]
Print a simple list of packages which have a different version in the Print a simple list of packages which have a different version in the
ports tree than what is installed. The output is sorted alphabetically, ports tree than what is installed. The output is sorted alphabetically,
but you can generate a (larger) list sorted by dependencies using but you can generate a (larger) list sorted by dependencies using
.B prt\-get quickdep $(prt\-get quickdiff). .B prt\-get quickdep $(prt\-get quickdiff).
Note that the resulting list is usually a mix of installed and
not-installed packages, so it must be filtered by
.B prt\-get isinst
before being passed as argument to prt\-get install or prt\-get update. See the
.B EXAMPLES
section below.
If you want to see only diffs which have a lower version installed than the one in If you want to see only diffs which have a lower version installed than
the ports tree, use the --prefer-higher option. the one in the ports tree, use the --prefer-higher option.
.TP .TP
.B search [\-v|\-vv] [\-\-path] [\-\-regex] <expr> .B search [\-v|\-vv] [\-\-path] [\-\-regex] <expr>
@ -195,20 +171,19 @@ in their name
Search the ports tree (both name and description) for the pattern Search the ports tree (both name and description) for the pattern
.B expr .B expr
(which can be a shell-like wildcard pattern or a regexp). The search in (which can be a shell-like wildcard pattern or a regexp). The search in
the description is not case sensitive. Note that this requires prt\-get the description is not case sensitive. Note that this requires prt-get
to read every Pkgfile, which makes it rather slow. If you like searching by to read every Pkgfile, which makes it rather slow; if you like searching
description, consider using the cache functionality, so you only have to by description, consider using the cache functionality, so you only have to
read all the Pkgfiles after each update of the ports tree. read every Pkgfile when the ports tree is updated.
.TP .TP
.B fsearch [\-\-full] [\-\-regex] <pattern> .B fsearch [\-\-full] [\-\-regex] <pattern>
Search the ports tree for Search the ports tree for
.B pattern .B pattern
as file name in their footprint. When called without '--full', strips as file name in their footprint. When called without '--full', strips
the directories from the file names before matching. the directories from the file names before matching. Pattern can be a
Pattern can be a shell-like wildcard pattern (e.g. prt-get fsearch "*.h") shell-like wildcard pattern (e.g. prt-get fsearch "*.h") or a regular
or a regular expression (e.g. prt-get fsearch --regex 'liblz(o2|ma).*') expression (e.g. prt-get fsearch --regex 'liblz(o2|ma).*')
.TP .TP
.B info <port> .B info <port>
@ -224,22 +199,22 @@ Print the port's README file if it exists; if set, uses $PAGER
.TP .TP
.B depends [\-\-softdeps] <package1> [<package2> ...] .B depends [\-\-softdeps] <package1> [<package2> ...]
Print a recursive list of dependencies needed to install the packages Print a recursive list of dependencies needed to install the packages passed
passed as argument. It shows a list of the dependencies that were found in as argument. It shows a list of the dependencies that were found in the
the ports tree, plus a list of the dependencies that could not be found. ports tree, plus a list of the dependencies that could not be found. Pass
Pass the --softdeps flag if you want the sorting algorithm to consider the --softdeps flag if you want the sorting algorithm to consider
optional dependencies too. optional dependencies too.
.TP .TP
.B quickdep [\-\-softdeps] <package1> [<package2> ...] .B quickdep [\-\-softdeps] <package1> [<package2> ...]
Same output as \fBdepends\fP, but separated by spaces rather than newlines, Same output as \fBdepends\fP, but separated by spaces rather than newlines, and
and stripped of any dependencies that could not be found in the ports tree. stripped of any dependencies that could not be found in the ports tree.
Useful in case the list of dependencies is too large to fit on one screen, Useful in case the list of dependencies is too large to fit on one screen, or
or if you don't want to filter out manually the ports that are invalid if you don't want to filter out manually the ports that are invalid targets for
targets for installation. For example, instead of installation. For example, instead of
.B prt\-get depinst xorg-server .B prt\-get depinst xorg-server
you might micromanage the process as follows: you might micromanage the process as follows:
.B for i in $(prt\-get quickdep xorg-server); do if prt\-get isinst $i 2>/dev/null; then prt\-get update \-fr $i; else prt\-get install $i; fi; done .B for i in $(prt\-get quickdep xorg-server); do prt\-get install \-fr \-\-nodeps $i; done
which ensures that the latest version of each dependency is built. which ensures that the latest version of each dependency is built.
Note: It might be useful to run Note: It might be useful to run
@ -251,30 +226,29 @@ for successful builds.
.B deptree [\-\-softdeps] <package> .B deptree [\-\-softdeps] <package>
Print a tree of the dependencies of the package Print a tree of the dependencies of the package
.B <package>. .B <package>.
Pass the --softdeps flag to also show the installed packages that might Pass the --softdeps flag to also show the installed packages that might have been
have been eagerly linked, if they were present when eagerly linked when
.B <package> .B <package>
(or its dependencies) were built. or its dependencies were compiled.
Subtrees already shown are marked with '-->' to save some space. In Subtrees already shown are marked with '-->' to save some space. In
order to show them all, add the --all switch. order to show them all, add the --all switch.
.SH "" .SH ""
.TP .TP
.B dependent [\-\-recursive] [\-\-softdeps] [\-\-all] [\-\-tree] <package> .B dependent [\-\-recursive] [\-\-softdeps] [\-\-all] <package>
Print a list of ports whose "Depends on:" line contains Print a list of ports whose "Depends on:" line contains
.B <package> .B <package>
(or its dependents, if --recursive was passed). Use the --softdeps flag to (or its dependents, if --recursive is passed). Use the --softdeps flag to also
also search the "Optional:" lines for \fB<package>\fP. search the "Optional:" lines for \fB<package>\fP .
By default, output is restricted to ports that are installed. To see all By default, output is restricted to ports that are installed. To see all the
the dependencies, use the --all switch. Use --tree to get a nicely indented dependencies, add the --all switch. Use --tree to get a nicely indented list.
list.
.TP .TP
.B dup [-v] [format] .B dup [\-v] [format]
List ports which can be found in multiple directories configured in List ports which can be found in multiple directories configured in
.B /etc/prt-get.conf \fB/etc/prt\-get.conf\fP.
Use the \fB\-v\fP switch to see a verbose report, which will show for each Use the \fB\-v\fP switch to see a verbose report, which will show for each
dup the port that takes precedence, and the port that is hidden (including dup the port that takes precedence, and the port that is hidden (including
full path and version info). The verbose switch is basically an alias for a full path and version info). The verbose switch is basically an alias for a
@ -291,19 +265,19 @@ symbols will be replaced as follows.
.TP .TP
\ \ \ \(bu \ \ \ \(bu
%p1 -> Full path (including name) to port taking precedence %p1 -> full path (including name) to port taking precedence
.TP .TP
\ \ \ \(bu \ \ \ \(bu
%p2 -> Full path (including name) to port being hidden %p2 -> full path (including name) to port being hidden
.TP .TP
\ \ \ \(bu \ \ \ \(bu
%v1 -> Version of port taking precedence %v1 -> version of port taking precedence
.TP .TP
\ \ \ \(bu \ \ \ \(bu
%v2 -> Version of port being hidden %v2 -> version of port being hidden
.TP .TP
\ \ \ \(bu \ \ \ \(bu
@ -333,7 +307,7 @@ for the list command. Make sure you escape where needed
.TP .TP
.B printf <format string1> [\-\-sort=<format string2>] [\-\-filter=<filter>] .B printf <format string1> [\-\-sort=<format string2>] [\-\-filter=<filter>]
Print formatted port list format string can contain variables, which Print formatted port list. Format string can contain variables, which
are replaced like this: are replaced like this:
.TP .TP
\ \ \ \(bu \ \ \ \(bu
@ -369,11 +343,11 @@ are replaced like this:
.TP .TP
\ \ \ \(bu \ \ \ \(bu
%M -> Maintainer %M -> maintainer
.TP .TP
\ \ \ \(bu \ \ \ \(bu
%R -> Readme ("yes"/"no") %R -> readme ("yes"/"no")
.TP .TP
\ \ \ \(bu \ \ \ \(bu
@ -393,8 +367,8 @@ are replaced like this:
up to date and "diff" if it's installed and a new version is in the up to date and "diff" if it's installed and a new version is in the
ports tree. ports tree.
Use "\\n" and "\\t" to format your output (no additional format symbols Use "\en" and "\et" to format your output (no additional format codes
suported). The optional format string2 can contain the same variables supported). The optional format string2 can contain the same variables
as format string1 and is used to sort the output. You can specify a as format string1 and is used to sort the output. You can specify a
.B wildcard filter .B wildcard filter
to filter by package name. to filter by package name.
@ -425,8 +399,8 @@ Output appears alphabetically separated by newlines, making it suitable for
process substitution as shown in the process substitution as shown in the
.B EXAMPLES .B EXAMPLES
section below. Note that some core ports might be runtime section below. Note that some core ports might be runtime
dependencies despite their absence in the "Depends on:" line; see \fBPkgfile(5)\fP dependencies despite their absence in the "Depends on:" line;
for an explanation of this practice. see \fBPkgfile(5)\fP for an explanation of this practice.
.TP .TP
.B isinst <package1> [<package2> ...] .B isinst <package1> [<package2> ...]
@ -439,28 +413,24 @@ but does not print the version information. This command has a return value of
greater than 0. greater than 0.
.TP .TP
.B current <package> .B current <package1> [<package2> ...]
Show the currently-installed version of <package>, or a message Shows the currently-installed version of <package>, or a message
that <package> is not installed. Unlike that <package> is not installed.
.B prt\-get isinst package1 package2,
this command does \fBnot\fP accept more than one package as argument. Use
.B pkginfo \-i| grep \-E '^(package1|package2|...)'
to work around this limitation.
.TP .TP
.B ls [\-\-path] <package> .B ls [\-\-path] <package>
List the contents of the port's directory Print out a listing of the port's directory
.TP .TP
.B cat <package> [<file>] .B cat <package> [<file>]
Print the file to stdout. If <file> is not specified, 'Pkgfile' is used. If set, uses $PAGER. Print to stdout (or $PAGER, if set) the contents of <file> in the port's
directory. If <file> is not specified, 'Pkgfile' is used.
.TP .TP
.B edit <package> [<file>] .B edit <package> [<file>]
Edit the file using the editor specified in the $EDITOR environment variable. Edit the file using the editor specified in the $EDITOR environment variable.
If <file> is not specified, 'Pkgfile' is used. If <file> is not specified, 'Pkgfile' is used.
.TP .TP
.B help .B help
Show a help screen Show a help screen
@ -495,14 +465,6 @@ Force install; Implies 'pkgadd -f'; same as --aargs=-f
.B \-fr .B \-fr
Force rebuild, Implies 'pkgmk -f'; same as --margs=-f Force rebuild, Implies 'pkgmk -f'; same as --margs=-f
.TP
.B \-um
Update md5sum, implies 'pkgmk -um'; same as --margs=-um
.TP
.B \-im
Ignore md5sum, implies 'pkgmk -im'; same as --margs=-im
.TP .TP
.B \-us .B \-us
Update signature, implies 'pkgmk -us'; same as --margs=-us Update signature, implies 'pkgmk -us'; same as --margs=-us
@ -545,10 +507,15 @@ future uses and consistency reasons
.B \-\-ignore=<package1,package2,...> .B \-\-ignore=<package1,package2,...>
Don't install these packages, even if they're listed as dependencies Don't install these packages, even if they're listed as dependencies
.TP
.B \-\-nodeps
Leave the list of requested packages as-is, without sorting by dependencies
or injecting missing dependencies.
.TP .TP
.B \-\-softdeps .B \-\-softdeps
Consider optional dependencies when determining the order in which to build Consider optional dependencies when determining the order in which to build
the packages passed as arguments (in a \fBdepinst\fP or \fBsysup\fP operation). the packages passed as arguments (in \fBinstall\fP or \fBsysup\fP operations).
Also affects the output of \fBdeptree\fP, \fBdependent\fP, and \fBlistorphans\fP. Also affects the output of \fBdeptree\fP, \fBdependent\fP, and \fBlistorphans\fP.
.TP .TP
@ -557,20 +524,20 @@ Use cache file for this command
.TP .TP
.B \-\-test .B \-\-test
Dry run, don't actually install anything, mostly interesting for Dry run, don't actually install anything. Mostly interesting for
.B prt\-get install, prt\-get update, prt\-get sysup .B prt\-get install, prt\-get update, prt\-get sysup
.TP .TP
.B \-\-pre-install .B \-\-pre\-install
Execute pre-install script if it's there Execute pre-install script if it's there
.TP .TP
.B \-\-post-install .B \-\-post\-install
Execute post-install script if it's there Execute post-install script if it's there
.TP .TP
.B \-\-install-scripts .B \-\-install\-scripts
Execute pre-install and post-install script if they're there Execute pre-install and post-install script if they're there.
The options --pre-install, --post-install, and --install-scripts offer a The options --pre-install, --post-install, and --install-scripts offer a
convenient way to temporarily override the prt-get.conf directive 'runscripts convenient way to temporarily override the prt-get.conf directive 'runscripts
@ -581,18 +548,17 @@ no\(dq, or point prt-get to an alternative configuration file using
--config=<file>. (see below for the documentation of these options) --config=<file>. (see below for the documentation of these options)
.TP .TP
.B \-\-install-root=<dir> .B \-\-install\-root=<dir>
Use <dir> as root directory for your installation; allows you to install Use <dir> as root directory for your installation; allows you to install
the requested packages onto a different directory than '/'. In daily usage, the requested packages onto a different directory than '/'. In daily usage,
this option is not required; it's primarily interesting if you're developing this option is not required; it's primarily interesting if you're developing
an independent installation. an independent installation.
Pre- and post-install scripts will not be executed if the target root directory Pre- and post-install scripts will not be executed if the requested
lacks a copy of the ports tree. So if you're maintaining an installation on a root directory lacks a copy of the ports tree. So if you're maintaining an
volume mounted somewhere other than '/', it's not enough to have the installation mounted somewhere different than '/', it's not enough to put
line 'runscripts yes' in your prt-get.conf; you also have to ensure that the line 'runscripts yes' in your prt-get.conf; you also have to ensure that the
the pre- and post-install scripts can be found in the same location pre- and post-install scripts can be found in the same location relative to <dir>.
relative to <dir>.
The setting for --install-root determines which package database is used for The setting for --install-root determines which package database is used for
reading/writing (so <dir>/var/lib/pkg/db must exist), and where the pkg.tar.?z reading/writing (so <dir>/var/lib/pkg/db must exist), and where the pkg.tar.?z
@ -611,15 +577,15 @@ unpacks it into <dir>.
When setting --install-root=<dir>, install or update commands might behave When setting --install-root=<dir>, install or update commands might behave
unexpectedly if <dir>/etc/pkgadd.conf exists and is different from unexpectedly if <dir>/etc/pkgadd.conf exists and is different from
/etc/pkgadd.conf . In order to preserve the \fBpkgadd.conf(5)\fP settings from /etc/pkgadd.conf . In order to preserve the \fBpkgadd.conf(5)\fP settings from
the host system, append the option --aargs='-c /etc/pkgadd.conf' to your host system, append the option --aargs='-c /etc/pkgadd.conf' to your \fBprt\-get
\fBprt-get install\fP command, or just copy the desired directives into install\fP command, or just copy the desired directives into
<dir>/etc/pkgadd.conf . <dir>/etc/pkgadd.conf .
.TP .TP
.B \-\-log .B \-\-log
Write build output to log file. Basically a convenient alias for Write build output to log file. Basically a convenient alias for
\fB\-\-config\-set=\(dqwritelog enabled\(dq\fP. Note that there is no similar \fB\-\-config\-set=\(dqwritelog enabled\(dq\fP. Note that there is no similar
alias allowing you to temporarily override the one configuration directive alias allowing you to temporarily override the configuration directive
\(dqwritelog enabled\(dq; you have to resort to \fB\-\-config\-set=\(dqwritelog \(dqwritelog enabled\(dq; you have to resort to \fB\-\-config\-set=\(dqwritelog
disabled\(dq\fP if that is your intention. disabled\(dq\fP if that is your intention.
@ -651,8 +617,9 @@ transactions as well.
.TP .TP
.B \-v, \-vv .B \-v, \-vv
(verbosity level) Show version of a port (\-v), or show both version (verbosity level) Show version of a port (-v), or show both version
and description (\-vv). Passing more than one of these options is equivalent to \-vv. and description (-vv). Passing more than one of these options is equivalent
to -vv.
.TP .TP
.B \-\-path .B \-\-path
@ -677,29 +644,49 @@ Override the 'preferhigher' configuration option. Equivalent to
.SH "CONFIGURATION" .SH "CONFIGURATION"
.TP .TP
See man prt\-get.conf(5) See man prt-get.conf(5)
.SH "EXAMPLES" .SH "EXAMPLES"
.TP .TP
.B prt\-get install irssi .B prt\-get install irssi
Download, build and install irssi, with one simple command Download, build and install irssi (and any of its missing dependencies), with
one simple command
.TP .TP
.B prt\-get install paper yasm .B prt\-get install --nodeps jasper
Install paper and yasm. Abort with an informative error message if either Install jasper, without trying to resolve dependencies.
package is already installed, allowing you to issue a revised command.
.TP .TP
.B prt\-get update \-fr openssh .B prt\-get update --softdeps webkitgtk
Update your current version of openssh, forcing a rebuild even if no version difference is detected. Get the latest version of webkitgtk, rebuilding any of its outdated dependencies
Useful if there was a major version change in one of its dependencies, and \fBrevdep openssh\fP (hard and soft) in the optimal order.
indicates a broken package. :\-)
.TP
.B prt\-get update -fr openssh
Update your current version of openssh, forcing a rebuild even if no version
difference is detected.
Useful if there was a major soversion change in one of its dependencies,
and \fBrevdep openssh\fP indicates a broken package. :-)
.TP .TP
.B MISSLIBS=$(revdep \-vvv mpv | awk \-v FS=: '/(missing library)/ {print $3}'); [ \-n \(dq${MISSLIBS[@]}\(dq ] && for i in ${MISSLIBS[@]}; do prt\-get fsearch $i; done .B MISSLIBS=$(revdep \-vvv mpv | awk \-v FS=: '/(missing library)/ {print $3}'); [ \-n \(dq${MISSLIBS[@]}\(dq ] && for i in ${MISSLIBS[@]}; do prt\-get fsearch $i; done
(adapted from a script by ppetrov^) Check for the presence of the runtime libraries needed by mpv. (adapted from a script by ppetrov^) Check for the presence of the runtime libraries needed by mpv.
If any are absent, search the footprints to determine which ports provide the missing libraries. If any are absent, search the footprints to determine which ports provide the missing libraries.
.TP
.B prt\-get isinst $(ls /usr/pkgmk/packages/*.tar.gz | sed 's/.*\e///; s/#.*//;') | awk '/not installed/ { print $2 }'
Determine whether there are any packages (in a shared output directory) that
have since been uninstalled, or were never installed after a successful run
of \fBpkgmk\fP.
.TP
.B prt\-get printf '%i:%p:%n\en' | awk \-v FS=: '/^diff:\e/usr\e/ports\e/core/ { print $3 }' | xargs prt\-get update
Basically a \fBsysup\fP operation, but restricted to the core collection.
Because core ports are often omitted from the dependency line if they aren't
dynamically linked in, the \fBsysup\fP sorting algorithm might not put them
at the front of the queue. Run this command before a regular \fBsysup\fP in
order to ensure that core ports are updated first.
.TP .TP
.B prt\-get isinst $(prt\-get info ffmpeg | awk \-v FS=: '/^Optional/ {gsub(/,/,\(dq \(dq,$2); print $2}') | awk \-v FS=\(dq \(dq '/not installed/ {print $2}' .B prt\-get isinst $(prt\-get info ffmpeg | awk \-v FS=: '/^Optional/ {gsub(/,/,\(dq \(dq,$2); print $2}') | awk \-v FS=\(dq \(dq '/not installed/ {print $2}'
Show all the optional dependencies of ffmpeg that are not currently installed. Show all the optional dependencies of ffmpeg that are not currently installed.
@ -713,16 +700,17 @@ spend any resources on ffmpeg until all of its optional dependencies are in
place. place.
.TP .TP
.B prt\-get isinst $(if grep \-qE '^ffmpeg:' /etc/prt\-get.softdeps 2>/dev/null; then grep \-E '^ffmpeg:' /etc/prt\-get.softdeps | cut \-d: \-f2 | tr ',' ' '; else prt\-get info ffmpeg | awk \-v FS=: '/^Optional/ {gsub(/,/,\(dq \(dq,$2); print $2}'; fi) | awk \-v FS=\(dq \(dq '/not installed/ {print $2}' | xargs prt\-get depinst \-\-group \-\-softdeps ffmpeg .B prt\-get isinst $(if grep \-qE '^ffmpeg:' /etc/prt\-get.softdeps 2>/dev/null; then grep \-E '^ffmpeg:' /etc/prt\-get.softdeps | cut \-d: \-f2 | tr ',' ' '; else prt-get info ffmpeg | awk \-v FS=: '/^Optional/ {gsub(/,/,\(dq \(dq,$2); print $2}'; fi) | awk \-v FS=\(dq \(dq '/not installed/ {print $2}' | xargs prt\-get depinst \-\-group \-\-softdeps ffmpeg
Extension of the above (addressing a use case envisioned by ivandi). The Extension of the above (addressing a use case envisioned by ivandi). The
user can create the file /etc/prt-get.softdeps containing a line like user can create the file /etc/prt-get.softdeps containing a line like
.B ffmpeg: x264 x265 .B ffmpeg: x264 x265
and then the above command will perform a depinst --group operation to ensure that and then the above command will perform a depinst --group operation to
at least x264 and x265 (but not necessarily any of the other optional ensure that at least x264 and x265 (but not necessarily any of the other
dependencies) are present before trying to build ffmpeg. In the absence of such optional dependencies) are present before trying to build ffmpeg. In the
a .softdeps config, the operation reverts to the behaviour of the preceding absence of such a .softdeps config, the operation reverts to the behaviour
example (maximal feature set). Implementing Gentoo USE flags with such an of the preceding example (maximal feature set). Implementing Gentoo USE
awkward one-liner might draw criticism from advocates of the KISS principle. flags with such an awkward one-liner might draw criticism from advocates of
the KISS principle.
.TP .TP
.B prt\-get search \-\-regex '^(m|n|p)c.*' .B prt\-get search \-\-regex '^(m|n|p)c.*'
@ -733,32 +721,29 @@ Return a list of all ports whose names start with "mc", "nc", or "pc"
Return a list of all ports having "irc" in their name or description Return a list of all ports having "irc" in their name or description
.TP .TP
.B prt\-get fsearch \-\-full \(dq/usr/etc/*\(dq | awk '/^Found in/ { $0=gensub(/Found in .*\e/(.+):/,\(dq\e\e1\(dq,\(dqg\(dq); print;}' .B comm -13 <(ls /usr/ports/core) <(prt-get listorphans)
Return a list of all ports that store their configs in /usr/etc. Omit the
pipe to awk if you also want a detailed list of the files that matched.
.TP
.B comm \-13 <(ls /usr/ports/core) <(prt\-get listorphans)
(based on comments from Romster and jue) Filter out the core ports from the list of orphans, in (based on comments from Romster and jue) Filter out the core ports from the list of orphans, in
shells (like bash) that support process substitution shells (like bash) that support process substitution
.TP .TP
.B comm \-13 <(cat ~/.keepers <(ls /usr/ports/core) | sort) <(prt\-get listorphans) | xargs prt\-get remove .B comm -13 <(cat ~/.keepers <(ls /usr/ports/core) | sort) <(prt\-get listorphans) | xargs prt\-get remove
(system-hosing extension of the above) A one-liner inspired by \fBpkg\-clean\fP (system-hosing extension of the above) A one-liner inspired by \fBpkg\-clean\fP
and \fBpkgfoster\fP, but without the safeguard of interactivity. \fBDo not try this on a and \fBpkgfoster\fP, but without the safeguard of interactivity.
mission-critical system.\fP \fBDo not try this on a mission-critical system.\fP
.TP .TP
.B prt\-get isinst $(prt\-get quickdep $(prt\-get quickdiff)) | awk '/not installed/ {print $2}' .B prt\-get isinst $(prt\-get quickdep $(prt\-get quickdiff)) | awk '/not installed/ {print $2}'
(adapted from a comment by Fun) After updating your ports tree, print out a list of dependencies (adapted from a comment by Fun) After updating your ports tree, print out a
that were not needed the last time you built your currently-installed ports, but are needed now by list of dependencies that were not needed the last time you built your
the newer versions of these ports. The output of this command is sorted by dependencies, therefore currently-installed ports, but are needed now by the newer versions of
these ports. The output of this command is sorted by dependencies, therefore
suitable for piping to \fBxargs prt\-get install\fP. suitable for piping to \fBxargs prt\-get install\fP.
.TP .TP
.B prt\-get isinst $(prt\-get quickdep $(prt\-get quickdiff)) | awk '/is installed/ {print $2}' .B comm \-13 <(prt\-get depends firefox\-bin |tail \-n +2 |sort) <(prt\-get depends firefox |tail \-n +2 |sort)
Same as above, but only print the dependencies that are already installed. The output of this Find the build-time dependencies of firefox. Runtime dependencies would
command is suitable for piping to \fBxargs prt\-get update\fP. also appear in the list generated by the first process substitution, and
\fBcomm \-13\fP will suppress what the two lists have in common.
.TP .TP
.B prt\-get isinst $(prt\-get quickdep i3) | awk '/not installed/ { print $2 }' | xargs prt\-get depinst \-\-softdeps \-\-test .B prt\-get isinst $(prt\-get quickdep i3) | awk '/not installed/ { print $2 }' | xargs prt\-get depinst \-\-softdeps \-\-test
@ -769,13 +754,17 @@ awk filter in the middle is needed to prevent the command from failing with the
error message "already installed". error message "already installed".
.TP .TP
.B comm \-3 <(prt\-get printf \(dq%i:%n %v\-%r\en\(dq | grep \-v ^no | cut \-d: \-f2 | sort) <(pkginfo \-i | sort) .B prt\-get printf \(dq%p\et%u\en\(dq | grep myrepo | cut \-f 2
(inspired by a bug report from teodor) an alternative to \fBprt\-get diff\fP. Print the upstream URL for each port in the collection \(dqmyrepo\(dq,
In the output, left-justified lines show the version available in the perhaps as the first step in keeping your personal overlay up to date.
repositories, while indented lines show the version installed. On a
reasonably up-to-date system, the two processes in the above command will .TP
return many identical lines; these are suppressed by the -3 flag to .B for u in $(prt\-get printf \(dq%M:%p/%n\en\(dq | grep \-i ^unmaintained | cut \-d: \-f2); do cd ${u%/*}; printf \(dq||%s ||\(dq ${u##*/}; git log ${u##*/} | head \-n 5 | awk '/^Date/ { $0=gensub(/^Date:\es+/,"","g"); printf(\(dq %s ||\en\(dq,$0); }'; cd \- >/dev/null; done
\fBcomm(1)\fP. Generate a table of unmaintained ports and the dates of their most recent
commit, in PmWiki syntax (left-justified port names, centered dates).
Requires that your repositories are synchronized using the \fBgit(1)\fP driver.
Subsequent sorting by date may be done using \fBsort(1)\fP with the flags
-k, -M, and -n (the appropriate key defs will depend on your locale).
.TP .TP
.B for L in /var/log/pkgbuild/*.log; do P=${L%__*}; P=${P##*/}; VR=${L##*__}; VR=${VR%.log}; if ! prt\-get isinst $P >/dev/null; then mv $L /var/log/uninstalled/; elif [ \(dq$(prt\-get current $P)\(dq != \(dq$VR\(dq ]; then mv $L /var/log/oldbuild/; fi; done .B for L in /var/log/pkgbuild/*.log; do P=${L%__*}; P=${P##*/}; VR=${L##*__}; VR=${VR%.log}; if ! prt\-get isinst $P >/dev/null; then mv $L /var/log/uninstalled/; elif [ \(dq$(prt\-get current $P)\(dq != \(dq$VR\(dq ]; then mv $L /var/log/oldbuild/; fi; done
@ -787,37 +776,21 @@ on declaring \(dqlogfile /var/log/pkgbuild/%n__%v-%r.log\(dq and \(dqwritelog
enabled\(dq in \fBprt\-get.conf(5)\fP. Logs saved with a different filename enabled\(dq in \fBprt\-get.conf(5)\fP. Logs saved with a different filename
pattern will require slight adjustments to the command. pattern will require slight adjustments to the command.
.TP
.B prt\-get printf \(dq%p\et%u\en\(dq | awk '($1 ~ /\e/myrepo$/) { print $2 }'
Print the upstream URL for each port in the collection \(dqmyrepo\(dq, perhaps
as the first step in keeping your personal overlay up to date.
.TP
.B prt\-get printf \(dq%M\et%n\en\(dq | grep \-c ^Tim
Count how many ports our most-overworked core team member claims responsibility for.
.TP
.B for u in $(prt\-get printf \(dq%M:%p/%n\en\(dq | grep \-i ^unmaintained | cut \-d: \-f2); do cd ${u%/*}; printf \(dq||%s ||\(dq ${u##*/}; git log ${u##*/} | head \-n 5 | awk '/^Date/ { $0=gensub(/^Date:\es+/,"","g"); printf(\(dq %s ||\en\(dq,$0); }'; cd \- >/dev/null; done
Generate a table of unmaintained ports and the dates of their most recent
commit, in PmWiki syntax (left-justified port names, centered dates).
Requires that your repositories are synchronized using the \fBgit(1)\fP driver.
Subsequent sorting by date may be done using \fBsort(1)\fP with the flags
-k, -M, and -n (the appropriate key defs will depend on your locale).
.TP .TP
.B prt\-get listinst \-\-depsort | xargs prt\-get install \-\-install\-root=/mnt .B prt\-get listinst \-\-depsort | xargs prt\-get install \-\-install\-root=/mnt
Sort the list of installed packages by dependencies, and then install all Sort the list of installed packages by dependencies, and then install all
those packages onto a backup filesystem (mounted at /mnt). If you have a customized those packages onto a backup filesystem (mounted at /mnt). If you have a
pkgadd.conf that you want applied to this operation, either copy it to customized pkgadd.conf that you want applied to this operation, either copy
/mnt/etc where pkgadd will be looking for it, or pass the additional option \-\-aargs=\(dq\-c it to /mnt/etc where pkgadd will be looking for it, or pass the additional
/etc/pkgadd.conf\(dq to the install command. option \-\-aargs=\(dq\-c /etc/pkgadd.conf\(dq to the install command.
.TP .TP
.B prt\-get list \-\-path \-\-regex '^xorg.*' | grep \-v \(dq/usr/ports/xorg\(dq .B prt\-get list \-\-path \-\-regex '^xorg.*' | grep \-v \(dq/usr/ports/xorg\(dq
Show the ports whose names begin with xorg, but which appear outside the xorg port collection. Show the ports whose names begin with xorg, but which appear outside the
xorg port collection.
(At the time of writing, this command returned at least two font ports.) (At the time of writing, this command returned at least two font ports.)
.SH "AUTHORS" .SH "AUTHORS"
Johannes Winkelmann <jw@tks6.net>, and others cited inline Johannes Winkelmann <jw@tks6.net>, and others cited inline
.SH "SEE ALSO" .SH "SEE ALSO"
prt\-get.conf(5), prt\-cache(8), Pkgfile(5), pkgmk(8), pkgadd(8), ports(8) prt-get.conf(5), prt-cache(8), Pkgfile(5), pkgmk(8), pkgadd(8), ports(8)

View File

@ -128,35 +128,36 @@ replaced with the port's path, e.g. for port gcc in core, %p would be
and %n would be and %n would be
.B gcc. .B gcc.
This allows you to have separate log files per port. This allows you to have separate log files per port.
Separate log files for each version and release can be achieved Separate log files for each version and release can be achieved using
using the placeholders %v and %r, respectively. But if you want to the placeholders %v and %r, respectively. But if you want to enable
enable \fBrmlog_on_uninst\fP, it is best to avoid %p, %v, and %r \fBrmlog_on_uninst\fP, it is best to avoid %p, %v, and %r when
when specifying \fBlogfile\fP (as explained below). specifying \fBlogfile\fP (as explained below).
.B rmlog_on_uninst .B rmlog_on_uninst
which can be set to 'yes' or 'no'; when set to yes, uninstalling a can be set to 'yes' or 'no'; when set to yes, uninstalling a package
package will also try to delete its build log. Replacements in the template will also try to delete its build log. Replacements in the template
\fBlogfile\fP will be made using the \fIcurrent values\fP from the database \fBlogfile\fP will be made using the \fIcurrent values\fP from the
of installed packages, and from the active repositories. If log files exist database of installed packages, and from the active repositories. If
with different values of %p, %v, or %r than what the database and repositories log files exist with different values of %p, %v, or %r than what the
provide, then the pattern substitutions will fail to match the names of those database and repositories provide, then the pattern substitutions will
logs, and this feature will be a no-op. For example, suppose you specify fail to match the names of those logs, and this feature will be a no-op.
the logfile pattern \(dq%p/.buildlogs/%n-%v-%r.log\(dq, and you have a package For example, suppose you specify the logfile pattern
installed on your system through many versions, or after it has been \(dq%p/.buildlogs/%n__%v-%r.log\(dq, and you have a package installed
moved from opt to contrib. Uninstalling that package would leave behind all the on your system through many versions, or after it has been moved from
build logs except the latest. This pattern is also fragile with respect to opt to contrib. Uninstalling that package would leave behind all the
repository purges; if one of your installed ports is dropped from the official build logs except the latest. This pattern is also fragile with respect
repos, then either \(dq%p\(dq will expand to the path of your personal overlay to repository purges; if one of your installed ports is dropped from
(you did make a copy, right?), or it will not expand at all! See the EXAMPLES the official repos, then either \(dq%p\(dq will expand to the path of
section of \fBprt\-get(8)\fP for an alternative way to tidy up your directory your personal overlay (you did make a copy, right?), or it will not
of build logs. expand at all! See the EXAMPLES section of \fBprt\-get(8)\fP for
alternative ways to tidy up your directory of build logs.
.B readme .B readme
can be set to 'disabled', to suppress the notification after can be set to 'disabled', to suppress the notification after installing
installing a port with a README file; 'compact', to collect all the READMEs a port with a README file; 'compact', to collect all the READMEs
into one post-transaction output; or 'verbose', to print separate into one post-transaction output; or 'verbose', to print separate
information about each port with a README file. See information about each port with a README file. See
.B prt-get(8) .B prt\-get(8)
and especially the readme command how to read those README files using and especially the readme command how to read those README files using
prt-get. prt-get.

View File

@ -1,4 +0,0 @@
EXTRA_DIST = prt-get_complete prt-get.aliases prt-get.deplist prt-get.conf
sysconf_DATA = prt-get.conf

View File

@ -1,403 +0,0 @@
# Makefile.in generated by automake 1.12.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
subdir = misc
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(top_srcdir)/mkinstalldirs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(sysconfdir)"
DATA = $(sysconf_DATA)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = prt-get_complete prt-get.aliases prt-get.deplist prt-get.conf
sysconf_DATA = prt-get.conf
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu misc/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu misc/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-sysconfDATA: $(sysconf_DATA)
@$(NORMAL_INSTALL)
@list='$(sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(sysconfdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(sysconfdir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(sysconfdir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(sysconfdir)" || exit $$?; \
done
uninstall-sysconfDATA:
@$(NORMAL_UNINSTALL)
@list='$(sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(sysconfdir)'; $(am__uninstall_files_from_dir)
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
cscope cscopelist:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(DATA)
installdirs:
for dir in "$(DESTDIR)$(sysconfdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-sysconfDATA
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-sysconfDATA
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic distclean \
distclean-generic distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip install-sysconfDATA installcheck installcheck-am \
installdirs maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \
uninstall-am uninstall-sysconfDATA
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -17,8 +17,7 @@ prtdir /usr/ports/opt
### log options: ### log options:
# writelog enabled # (enabled|disabled) # writelog enabled # (enabled|disabled)
# logmode overwrite # (append|overwrite) # logmode overwrite # (append|overwrite)
# rmlog_on_success no # (yes|no) # rm_on_success no # (yes|no)
# rmlog_on_uninst no # (yes|no)
logfile /var/log/pkgbuild/%n.log logfile /var/log/pkgbuild/%n.log
# path, %p=path to port dir, %n=port name # path, %p=path to port dir, %n=port name
# %v=version, %r=release # %v=version, %r=release

View File

@ -1,29 +0,0 @@
# Makefile.am for prt-get by Johannes Winkelmann
install-exec-local: install-binPROGRAMS
(cd $(DESTDIR)$(bindir); ln -sf prt-get prt-cache)
bin_PROGRAMS=prt-get
prt_get_SOURCES= argparser.cpp argparser.h\
depresolver.cpp depresolver.h \
installtransaction.cpp installtransaction.h \
main.cpp \
package.cpp package.h \
pkgdb.cpp pkgdb.h \
prtget.cpp prtget.h \
repository.cpp repository.h \
stringhelper.cpp stringhelper.h \
process.cpp process.h \
configuration.cpp configuration.h \
signaldispatcher.cpp signaldispatcher.h \
lockfile.cpp lockfile.h \
file.cpp file.h \
locker.cpp locker.h \
versioncomparator.cpp versioncomparator.h \
datafileparser.cpp datafileparser.h \
pg_regex.cpp pg_regex.h
AM_CPPFLAGS = -DSYSCONFDIR=\"$(sysconfdir)\" \
-DLOCALSTATEDIR=\"$(localstatedir)\"

View File

@ -1,552 +0,0 @@
# Makefile.in generated by automake 1.12.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# Makefile.am for prt-get by Johannes Winkelmann
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
bin_PROGRAMS = prt-get$(EXEEXT)
subdir = src
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(top_srcdir)/depcomp $(top_srcdir)/mkinstalldirs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS)
am_prt_get_OBJECTS = argparser.$(OBJEXT) depresolver.$(OBJEXT) \
installtransaction.$(OBJEXT) main.$(OBJEXT) package.$(OBJEXT) \
pkgdb.$(OBJEXT) prtget.$(OBJEXT) repository.$(OBJEXT) \
stringhelper.$(OBJEXT) process.$(OBJEXT) \
configuration.$(OBJEXT) signaldispatcher.$(OBJEXT) \
lockfile.$(OBJEXT) file.$(OBJEXT) locker.$(OBJEXT) \
versioncomparator.$(OBJEXT) datafileparser.$(OBJEXT) \
pg_regex.$(OBJEXT)
prt_get_OBJECTS = $(am_prt_get_OBJECTS)
prt_get_LDADD = $(LDADD)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
CXXLD = $(CXX)
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
-o $@
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(prt_get_SOURCES)
DIST_SOURCES = $(prt_get_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
prt_get_SOURCES = argparser.cpp argparser.h\
depresolver.cpp depresolver.h \
installtransaction.cpp installtransaction.h \
main.cpp \
package.cpp package.h \
pkgdb.cpp pkgdb.h \
prtget.cpp prtget.h \
repository.cpp repository.h \
stringhelper.cpp stringhelper.h \
process.cpp process.h \
configuration.cpp configuration.h \
signaldispatcher.cpp signaldispatcher.h \
lockfile.cpp lockfile.h \
file.cpp file.h \
locker.cpp locker.h \
versioncomparator.cpp versioncomparator.h \
datafileparser.cpp datafileparser.h \
pg_regex.cpp pg_regex.h
AM_CPPFLAGS = -DSYSCONFDIR=\"$(sysconfdir)\" \
-DLOCALSTATEDIR=\"$(localstatedir)\"
all: all-am
.SUFFIXES:
.SUFFIXES: .cpp .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p; \
then echo "$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) files[d] = files[d] " " $$1; \
else { print "f", $$3 "/" $$4, $$1; } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
} \
; done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-e 's/$$/$(EXEEXT)/' `; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(bindir)" && rm -f $$files
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
prt-get$(EXEEXT): $(prt_get_OBJECTS) $(prt_get_DEPENDENCIES) $(EXTRA_prt_get_DEPENDENCIES)
@rm -f prt-get$(EXEEXT)
$(CXXLINK) $(prt_get_OBJECTS) $(prt_get_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argparser.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/configuration.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/datafileparser.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/depresolver.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/installtransaction.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/locker.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lockfile.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/package.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pg_regex.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkgdb.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prtget.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/repository.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signaldispatcher.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stringhelper.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/versioncomparator.Po@am__quote@
.cpp.o:
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
.cpp.obj:
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
for dir in "$(DESTDIR)$(bindir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-binPROGRAMS install-exec-local
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
clean-generic cscopelist ctags distclean distclean-compile \
distclean-generic distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-binPROGRAMS \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-exec-local install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-binPROGRAMS
install-exec-local: install-binPROGRAMS
(cd $(DESTDIR)$(bindir); ln -sf prt-get prt-cache)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -27,26 +27,28 @@ ArgParser::ArgParser( int argc, char** argv )
m_hasFilter( false ), m_hasFilter( false ),
m_noStdConfig( false ), m_noStdConfig( false ),
m_writeLog( false ), m_writeLog( false ),
m_nodeps( false ), m_depSort( true ),
m_softdeps( false ), m_softdeps( false ),
m_revdep(false),
m_all( false ), m_all( false ),
m_printPath( false ), m_printPath( false ),
m_execPreInstall( false ), m_execPreInstall( false ),
m_execPostInstall( false ), m_execPostInstall( false ),
m_preferHigher( false ), m_preferHigher( false ),
m_strictDiff( false ), m_strictDiff( false ),
m_sysup( false ),
m_group( false ), m_group( false ),
m_useRegex(false), m_useRegex(false),
m_fullPath(false), m_fullPath(false),
m_quick(false),
m_recursive(false), m_recursive(false),
m_printTree(false), m_printTree(false),
m_depSort(false),
m_alternateConfigFile( "" ), m_alternateConfigFile( "" ),
m_pkgmkArgs( "" ), m_pkgmkArgs( "" ),
m_pkgaddArgs( "" ), m_pkgaddArgs( "" ),
m_pkgrmArgs( "" ), m_pkgrmArgs( "" ),
m_sortArgs( "" ),
m_filter( "" ), m_filter( "" ),
m_sortArgs( "" ),
m_commandName( "" ), m_commandName( "" ),
m_unknownOption( "" ), m_unknownOption( "" ),
m_installRoot( "" ), m_installRoot( "" ),
@ -80,7 +82,7 @@ bool ArgParser::isCommandGiven() const
/*! /*!
\return a list of arguments not processed by ArgParser \return a list of arguments not processed by ArgParser
*/ */
const list<char*>& ArgParser::otherArgs() const const list<string>& ArgParser::otherArgs() const
{ {
return m_otherArgs; return m_otherArgs;
} }
@ -103,7 +105,6 @@ const string& ArgParser::pkgmkArgs() const
return m_pkgmkArgs; return m_pkgmkArgs;
} }
/*! /*!
\return addtional arguments to pkgadd \return addtional arguments to pkgadd
*/ */
@ -112,7 +113,6 @@ const string& ArgParser::pkgaddArgs() const
return m_pkgaddArgs; return m_pkgaddArgs;
} }
/*! /*!
\return the name of the alternative configuration file \return the name of the alternative configuration file
*/ */
@ -121,36 +121,34 @@ const string& ArgParser::alternateConfigFile() const
return m_alternateConfigFile; return m_alternateConfigFile;
} }
/*! /*!
parse the arguments parse the arguments
\return true on success \return true on success
*/ */
bool ArgParser::parse() bool ArgParser::parse() {
{ const int commandCount = 28;
const int commandCount = 34; string commands[commandCount] = { "help", "info", "version",
string commands[commandCount] = { "list", "search", "dsearch", "search", "dsearch", "fsearch",
"info", "version", "cache", "cache", "install", "remove",
"depends", "install", "depinst", "current", "isinst", "diff",
"help", "isinst", "dup", "update", "path", "printf", "readme",
"quickdep", "diff", "quickdiff", "list", "listinst", "listorphans",
"path", "listinst", "printf", "readme", "lock", "unlock", "listlocked",
"dependent", "sysup", "current", "cat", "ls", "edit", "dumpconfig",
"fsearch", "lock", "unlock", "dup", "depends", "deptree"
"listlocked", "cat", "ls", "edit", };
"remove", "deptree", "dumpconfig",
"listorphans" }; Type commandID[commandCount] = { HELP, INFO, SHOW_VERSION,
SEARCH, DSEARCH, FSEARCH,
CREATE_CACHE, INSTALL, REMOVE,
CURRENT, ISINST, DIFF,
PATH, PRINTF, README,
LIST, LISTINST, LISTORPHANS,
LOCK, UNLOCK, LISTLOCKED,
CAT, LS, EDIT, DUMPCONFIG,
DUP, DEPENDS, DEPTREE
};
Type commandID[commandCount] = { LIST, SEARCH, DSEARCH, INFO,
SHOW_VERSION, CREATE_CACHE,
DEPENDS, INSTALL, DEPINST,
HELP, ISINST, DUP, UPDATE,
QUICKDEP, DIFF, QUICKDIFF,
PATH, LISTINST, PRINTF, README,
DEPENDENT, SYSUP, CURRENT,
FSEARCH, LOCK, UNLOCK, LISTLOCKED,
CAT, LS, EDIT, REMOVE, DEPTREE,
DUMPCONFIG, LISTORPHANS };
if ( m_argc < 2 ) { if ( m_argc < 2 ) {
return false; return false;
} }
@ -170,71 +168,42 @@ bool ArgParser::parse()
for ( int i = 1; i < m_argc; ++i ) { for ( int i = 1; i < m_argc; ++i ) {
if ( m_argv[i][0] == '-' ) { if ( m_argv[i][0] == '-' ) {
string s = m_argv[i]; string s = m_argv[i];
if ( s == "-v" ) { if ( s == "-v" ) { m_verbose += 1;
m_verbose += 1; } else if ( s == "-vv" ) { m_verbose += 2;
} else if ( s == "-vv" ) { } else if ( s == "--test" ) { m_isTest = true;
m_verbose += 2; } else if ( s == "--cache" ) { m_useCache = true;
} else if ( s == "--test" ) { } else if ( s == "--depsort" ) { m_depSort = true;
m_isTest = true; } else if ( s == "--nodeps" ) { m_depSort = false;
} else if ( s == "--cache" ) { } else if ( s == "--softdeps" ) { m_softdeps = true;
m_useCache = true; } else if ( s == "--all" ) { m_all = true;
} else if ( s == "--nodeps" ) { } else if ( s == "--path" ) { m_printPath = true;
m_nodeps = true; } else if ( s == "--log" ) { m_writeLog = true;
} else if ( s == "--softdeps" ) { } else if ( s == "--pre-install" ) { m_execPreInstall = true;
m_softdeps = true; } else if ( s == "--post-install" ) { m_execPostInstall = true;
} else if ( s == "--all" ) { } else if ( s == "--install-scripts" ) { m_execPreInstall = true;
m_all = true;
} else if ( s == "--path" ) {
m_printPath = true;
} else if ( s == "--log" ) {
m_writeLog = true;
} else if ( s == "--pre-install" ) {
m_execPreInstall = true;
} else if ( s == "--post-install" ) {
m_execPostInstall = true; m_execPostInstall = true;
} else if ( s == "--install-scripts" ) { } else if ( s == "--no-std-config" ) { m_noStdConfig = true;
m_execPreInstall = true;
m_execPostInstall = true;
} else if ( s == "--no-std-config" ) {
m_noStdConfig = true;
} else if ( s == "--prefer-higher" || s == "-ph" ) { } else if ( s == "--prefer-higher" || s == "-ph" ) {
m_preferHigher = true; m_preferHigher = true;
} else if ( s == "--strict-diff" || s == "-sd" ) { } else if ( s == "--strict-diff" || s == "-sd" ) {
m_strictDiff = true; m_strictDiff = true;
} else if ( s == "--group" || s == "-g" ) { } else if ( s == "--group" || s == "-g" ) { m_group = true;
m_group = true; } else if ( s == "--quick" || s == "-Q" ) { m_quick = true;
} else if ( s == "--regex" ) { } else if ( s == "--regex" ) { m_useRegex = true;
m_useRegex = true; } else if ( s == "--full" ) { m_fullPath = true;
} else if ( s == "--full" ) { } else if ( s == "--recursive" || s == "-R" ) { m_recursive = true;
m_fullPath = true; } else if ( s == "--tree" || s == "-T" ) { m_printTree = true;
} else if ( s == "--recursive" ) { } else if ( s == "-f" ) { m_pkgaddArgs += " " + s;
m_recursive = true; } else if ( s == "-fi" ) { m_pkgaddArgs += " -f";
} else if ( s == "--tree" ) { } else if ( s == "-fr" ) { m_pkgmkArgs += " -f";
m_printTree = true; } else if ( s == "-if" ) { m_pkgmkArgs += " " + s;
} else if ( s == "--depsort" ) { } else if ( s == "-uf" ) { m_pkgmkArgs += " " + s;
m_depSort = true; } else if ( s == "-im" ) { m_pkgmkArgs += " " + s;
} else if ( s == "-f" ) { } else if ( s == "-um" ) { m_pkgmkArgs += " " + s;
m_pkgaddArgs += " " + s; } else if ( s == "-is" ) { m_pkgmkArgs += " " + s;
} else if ( s == "-fr" ) { } else if ( s == "-us" ) { m_pkgmkArgs += " " + s;
m_pkgmkArgs += " -f"; } else if ( s == "-kw" ) { m_pkgmkArgs += " " + s;
} else if ( s == "-if" ) { } else if ( s == "-ns" ) { m_pkgmkArgs += " " + s;
m_pkgmkArgs += " " + s;
} else if ( s == "-uf" ) {
m_pkgmkArgs += " " + s;
} else if ( s == "-im" ) {
m_pkgmkArgs += " " + s;
} else if ( s == "-um" ) {
m_pkgmkArgs += " " + s;
} else if ( s == "-is" ) {
m_pkgmkArgs += " " + s;
} else if ( s == "-us" ) {
m_pkgmkArgs += " " + s;
} else if ( s == "-kw" ) {
m_pkgmkArgs += " " + s;
} else if ( s == "-ns" ) {
m_pkgmkArgs += " " + s;
} else if ( s == "-fi" ) {
m_pkgaddArgs += " -f";
} }
// substrings // substrings
@ -244,11 +213,11 @@ bool ArgParser::parse()
m_pkgaddArgs += " " + s.substr( 8 ); m_pkgaddArgs += " " + s.substr( 8 );
} else if ( s.substr( 0, 8 ) == "--rargs=" ) { } else if ( s.substr( 0, 8 ) == "--rargs=" ) {
m_pkgrmArgs = s.substr( 8 ); m_pkgrmArgs = s.substr( 8 );
} else if ( s.substr( 0, 7 ) == "--sort=" ) {
m_sortArgs = s.substr( 7 );
} else if ( s.substr( 0, 9 ) == "--filter=" ) { } else if ( s.substr( 0, 9 ) == "--filter=" ) {
m_filter = s.substr( 9 ); m_filter = s.substr( 9 );
m_hasFilter = true; m_hasFilter = true;
} else if ( s.substr( 0, 7 ) == "--sort=" ) {
m_sortArgs = s.substr( 7 );
} else if ( s.substr( 0, 9 ) == "--config=" ) { } else if ( s.substr( 0, 9 ) == "--config=" ) {
m_alternateConfigFile = s.substr( 9 ); m_alternateConfigFile = s.substr( 9 );
m_isAlternateConfigGiven = true; m_isAlternateConfigGiven = true;
@ -271,17 +240,40 @@ bool ArgParser::parse()
} else { } else {
if (!m_isCommandGiven) { if (!m_isCommandGiven) {
string s = m_argv[i]; string s = m_argv[i];
m_commandName = s;
if ( s == "grpinst") { if ( s == "grpinst") {
m_isCommandGiven = true; m_isCommandGiven = true;
m_commandType = commandID[7]; m_commandType = INSTALL;
m_group = true; m_group = true;
cout << "Warning: grpinst is obsolescent"; cout << "Warning: grpinst is obsolescent";
cout << "; using install --group" << endl; cout << "; using install --group" << endl;
} else if (s == "depinst") {
m_isCommandGiven = true;
m_commandType = INSTALL;
m_depSort = true;
} else if (s == "update") {
m_isCommandGiven = true;
m_commandType = INSTALL;
} else if (s == "sysup") {
m_isCommandGiven = true;
m_commandType = DIFF;
m_sysup = true;
} else if (s == "quickdiff") {
m_isCommandGiven = true;
m_commandType = DIFF;
m_quick = true;
} else if (s == "quickdep") {
m_isCommandGiven = true;
m_commandType = DEPENDS;
m_quick = true;
} else if (s == "dependent") {
m_isCommandGiven = true;
m_commandType = DEPTREE;
m_revdep = true;
} else { } else {
for ( int i = 0; i < commandCount; ++i ) { for ( int i = 0; i < commandCount; ++i ) {
if ( s == commands[i] ) { if ( s == commands[i] ) {
m_isCommandGiven = true; m_isCommandGiven = true;
m_commandName = s;
m_commandType = commandID[i]; m_commandType = commandID[i];
break; break;
} }
@ -297,12 +289,9 @@ bool ArgParser::parse()
} }
} }
return m_isCommandGiven; return m_isCommandGiven;
} }
/*! /*!
\return true whether --test has been specified \return true whether --test has been specified
*/ */
@ -311,7 +300,6 @@ bool ArgParser::isTest() const
return m_isTest; return m_isTest;
} }
/*! /*!
\return the level of verbose: -v -> 1, -vv -> 2 \return the level of verbose: -v -> 1, -vv -> 2
*/ */
@ -320,7 +308,6 @@ int ArgParser::verbose() const
return m_verbose; return m_verbose;
} }
/*! /*!
\return whether --cache has been specified \return whether --cache has been specified
*/ */
@ -329,7 +316,6 @@ bool ArgParser::useCache() const
return m_useCache; return m_useCache;
} }
/*! /*!
\return whether prt-get was called as 'prt-cache' or not \return whether prt-get was called as 'prt-cache' or not
*/ */
@ -346,14 +332,6 @@ bool ArgParser::writeLog() const
return m_writeLog; return m_writeLog;
} }
/*!
\return the --sort="..." string
*/
const string& ArgParser::sortArgs() const
{
return m_sortArgs;
}
/*! /*!
\return whether there was a --filter argument \return whether there was a --filter argument
*/ */
@ -362,7 +340,6 @@ bool ArgParser::hasFilter() const
return m_hasFilter; return m_hasFilter;
} }
/*! /*!
\return whether there was a --no-std-config argument \return whether there was a --no-std-config argument
*/ */
@ -371,7 +348,6 @@ bool ArgParser::noStdConfig() const
return m_noStdConfig; return m_noStdConfig;
} }
/*! /*!
\return the --filter="..." string \return the --filter="..." string
*/ */
@ -381,16 +357,18 @@ const string& ArgParser::filter() const
} }
/*! /*!
\return whether there was a --nodeps argument \return the --sort="..." string
*/ */
bool ArgParser::nodeps() const const string& ArgParser::sortArgs() const
{ {
return m_nodeps; return m_sortArgs;
}
bool ArgParser::depSort() const
{
return m_depSort;
} }
/*!
\return whether there was a --softdeps argument
*/
bool ArgParser::followSoftdeps() const bool ArgParser::followSoftdeps() const
{ {
return m_softdeps; return m_softdeps;
@ -409,6 +387,16 @@ bool ArgParser::printPath() const
return m_printPath; return m_printPath;
} }
bool ArgParser::revdep() const
{
return m_revdep;
}
bool ArgParser::quick() const
{
return m_quick;
}
bool ArgParser::recursive() const bool ArgParser::recursive() const
{ {
return m_recursive; return m_recursive;
@ -416,12 +404,7 @@ bool ArgParser::recursive() const
bool ArgParser::printTree() const bool ArgParser::printTree() const
{ {
return m_printTree; return (m_printTree || m_commandName == "deptree");
}
bool ArgParser::depSort() const
{
return m_depSort;
} }
const string& ArgParser::commandName() const const string& ArgParser::commandName() const
@ -470,6 +453,11 @@ bool ArgParser::strictDiff() const
return m_strictDiff; return m_strictDiff;
} }
bool ArgParser::sysup() const
{
return m_sysup;
}
bool ArgParser::group() const bool ArgParser::group() const
{ {
return m_group; return m_group;
@ -485,7 +473,6 @@ bool ArgParser::fullPath() const
return m_fullPath; return m_fullPath;
} }
const string& ArgParser::ignore() const const string& ArgParser::ignore() const
{ {
return m_ignore; return m_ignore;

View File

@ -31,14 +31,15 @@ public:
bool parse(); bool parse();
/*! Command type */ /*! Command type */
enum Type { HELP, LIST, SEARCH, DSEARCH, INSTALL, DEPINST, enum Type { HELP, INFO, SHOW_VERSION,
INFO, DEPENDS, ISINST, DUP, UPDATE, SEARCH, DSEARCH, FSEARCH,
QUICKDEP, DIFF, CREATE_CACHE, INSTALL, REMOVE,
QUICKDIFF, SHOW_VERSION, CREATE_CACHE, PATH, CURRENT, ISINST, DIFF,
LISTINST, PRINTF, README, DEPENDENT, SYSUP, PATH, PRINTF, README,
CURRENT, FSEARCH, LOCK, UNLOCK, LISTLOCKED, LIST, LISTINST, LISTORPHANS,
CAT, LS, EDIT, REMOVE, LOCK, UNLOCK, LISTLOCKED,
DEPTREE, DUMPCONFIG, LISTORPHANS }; CAT, LS, EDIT, DUMPCONFIG,
DUP, DEPENDS, DEPTREE };
bool isCommandGiven() const; bool isCommandGiven() const;
bool isTest() const; bool isTest() const;
@ -48,27 +49,29 @@ public:
bool writeLog() const; bool writeLog() const;
bool hasFilter() const; bool hasFilter() const;
bool noStdConfig() const; bool noStdConfig() const;
bool nodeps() const; bool depSort() const;
bool followSoftdeps() const;
bool all() const; bool all() const;
bool printPath() const; bool printPath() const;
bool execPreInstall() const; bool execPreInstall() const;
bool execPostInstall() const; bool execPostInstall() const;
bool preferHigher() const; bool preferHigher() const;
bool strictDiff() const; bool strictDiff() const;
bool sysup() const;
bool group() const; bool group() const;
bool useRegex() const; bool useRegex() const;
bool fullPath() const; bool fullPath() const;
bool revdep() const;
bool quick() const;
bool recursive() const; bool recursive() const;
bool printTree() const; bool printTree() const;
bool depSort() const;
bool followSoftdeps() const;
const string& alternateConfigFile() const; const string& alternateConfigFile() const;
const string& pkgmkArgs() const; const string& pkgmkArgs() const;
const string& pkgaddArgs() const; const string& pkgaddArgs() const;
const string& pkgrmArgs() const; const string& pkgrmArgs() const;
const string& sortArgs() const;
const string& filter() const; const string& filter() const;
const string& sortArgs() const;
const string& installRoot() const; const string& installRoot() const;
const string& ignore() const; const string& ignore() const;
@ -78,7 +81,7 @@ public:
const string& commandName() const; const string& commandName() const;
const string& unknownOption() const; const string& unknownOption() const;
const list<char*>& otherArgs() const; const list<string>& otherArgs() const;
int verbose() const; int verbose() const;
@ -99,8 +102,9 @@ private:
bool m_writeLog; bool m_writeLog;
bool m_nodeps; bool m_depSort;
bool m_softdeps; bool m_softdeps;
bool m_revdep;
bool m_all; bool m_all;
bool m_printPath; bool m_printPath;
@ -109,21 +113,21 @@ private:
bool m_execPostInstall; bool m_execPostInstall;
bool m_preferHigher; bool m_preferHigher;
bool m_strictDiff; bool m_strictDiff;
bool m_sysup;
bool m_group; bool m_group;
bool m_useRegex; bool m_useRegex;
bool m_fullPath; bool m_fullPath;
bool m_quick;
bool m_recursive; bool m_recursive;
bool m_printTree; bool m_printTree;
bool m_depSort;
string m_alternateConfigFile; string m_alternateConfigFile;
string m_pkgmkArgs; string m_pkgmkArgs;
string m_pkgaddArgs; string m_pkgaddArgs;
string m_pkgrmArgs; string m_pkgrmArgs;
string m_sortArgs;
string m_filter; string m_filter;
string m_sortArgs;
string m_commandName; string m_commandName;
string m_unknownOption; string m_unknownOption;
string m_installRoot; string m_installRoot;
@ -136,7 +140,7 @@ private:
int m_verbose; int m_verbose;
list<char*> m_otherArgs; list<string> m_otherArgs;
list< pair<char*, ConfigArgType> > m_configData; list< pair<char*, ConfigArgType> > m_configData;
}; };

View File

@ -37,7 +37,8 @@ Configuration::Configuration( const std::string& configFile,
m_useRegex( false ), m_useRegex( false ),
m_followSoftdeps( false ), m_followSoftdeps( false ),
m_makeCommand( "" ), m_addCommand( "" ), m_makeCommand( "" ), m_addCommand( "" ),
m_removeCommand( "" ), m_runscriptCommand( "" ) m_removeCommand( "" ), m_runscriptCommand( "" ),
m_compressionMode( "" ), m_packageDir( "" )
{ {
} }
@ -95,6 +96,25 @@ string Configuration::logFilePattern() const
return m_logFilePattern; return m_logFilePattern;
} }
string Configuration::packageDir() const
{
string value = "";
char line[256];
string cmd = "eval " + m_packageDir + " && echo \"$PKGMK_PACKAGE_DIR\"";
FILE* p = popen(cmd.c_str(), "r");
if (p) {
fgets(line, 256, p);
value = StringHelper::stripWhiteSpace(line);
pclose(p);
}
return value;
}
string Configuration::compressionMode() const
{
return ( m_compressionMode == "" ) ? "gz" : m_compressionMode;
}
const list< pair<string, string> >& Configuration::rootList() const const list< pair<string, string> >& Configuration::rootList() const
{ {
@ -156,8 +176,6 @@ void Configuration::parseLine(const string& line, bool prepend)
} else if ( startsWithNoCase( s, "writelog" ) ) { } else if ( startsWithNoCase( s, "writelog" ) ) {
s = stripWhiteSpace( s.replace( 0, 8, "" ) ); s = stripWhiteSpace( s.replace( 0, 8, "" ) );
if ( s == "enabled" ) { if ( s == "enabled" ) {
// it's already set to false, so we can just enable it.
// like this, the command line switch works as well
m_writeLog = true; m_writeLog = true;
} else if ( s == "disabled" ) { } else if ( s == "disabled" ) {
m_writeLog = false; m_writeLog = false;
@ -209,6 +227,8 @@ void Configuration::parseLine(const string& line, bool prepend)
s = stripWhiteSpace( s.replace( 0, 8, "" ) ); s = stripWhiteSpace( s.replace( 0, 8, "" ) );
if ( s == "yes" ) { if ( s == "yes" ) {
m_useRegex = true; m_useRegex = true;
} else if ( s == "no" ) {
m_useRegex = false;
} }
} else if ( startsWithNoCase( s, "softdeps" ) ) { } else if ( startsWithNoCase( s, "softdeps" ) ) {
s = stripWhiteSpace( s.replace( 0, 8, "" ) ); s = stripWhiteSpace( s.replace( 0, 8, "" ) );
@ -228,6 +248,32 @@ void Configuration::parseLine(const string& line, bool prepend)
} }
} }
bool Configuration::parsePkgmkConf(int readOrder)
{
string fileName = (readOrder == 1) ? "/etc/pkgmk.conf" : "/usr/bin/pkgmk";
FILE* fp = fopen(fileName.c_str(), "r");
if (!fp)
return false;
string s;
char line[256];
while (fgets(line, 256, fp)) {
s = StringHelper::stripWhiteSpace(getValueBefore(line,'#'));
if ( StringHelper::startsWith(s, "PKGMK_COMPRESSION_MODE=") &&
(readOrder==1 || m_compressionMode == "") ) {
m_compressionMode = s.substr(23);
StringHelper::replaceAll(m_compressionMode,"\"","");
StringHelper::replaceAll(m_compressionMode,"'","");
} else if ( StringHelper::startsWith(s, "PKGMK_PACKAGE_DIR=") &&
(readOrder==1 || m_packageDir == "" ) ) {
m_packageDir = s;
}
}
fclose(fp);
return ( m_compressionMode != "" && m_packageDir != "" );
}
bool Configuration::runScripts() const bool Configuration::runScripts() const
{ {
return m_runScripts; return m_runScripts;

View File

@ -46,6 +46,8 @@ public:
bool useRegex() const; bool useRegex() const;
bool followSoftdeps() const; bool followSoftdeps() const;
bool parsePkgmkConf(int readOrder);
void addConfig(const std::string& line, void addConfig(const std::string& line,
bool configSet, bool configSet,
bool configPrepend); bool configPrepend);
@ -55,6 +57,9 @@ public:
std::string removeCommand() const; std::string removeCommand() const;
std::string runscriptCommand() const; std::string runscriptCommand() const;
std::string compressionMode() const;
std::string packageDir() const;
private: private:
std::string m_configFile; std::string m_configFile;
const ArgParser* m_parser; const ArgParser* m_parser;
@ -82,6 +87,8 @@ private:
std::string m_removeCommand; std::string m_removeCommand;
std::string m_runscriptCommand; std::string m_runscriptCommand;
std::string m_compressionMode;
std::string m_packageDir;
void parseLine(const std::string& line, bool prepend=false); void parseLine(const std::string& line, bool prepend=false);
}; };

View File

@ -27,6 +27,7 @@ using namespace std;
#include "pkgdb.h" #include "pkgdb.h"
#include "stringhelper.h" #include "stringhelper.h"
#include "argparser.h" #include "argparser.h"
#include "versioncomparator.h"
#include "process.h" #include "process.h"
#include "configuration.h" #include "configuration.h"
@ -71,38 +72,6 @@ InstallTransaction::InstallTransaction( const list<string>& names,
} }
/*!
Create a nice InstallTransaction
\param names a list of port names to be installed
\param repo the repository to look for packages
\param pkgDB the pkgDB with already installed packages
*/
InstallTransaction::InstallTransaction( const list<char*>& names,
const Repository* repo,
PkgDB* pkgDB,
const Configuration* config )
: m_pkgDB( pkgDB ),
m_resolver(),
m_repo( repo ),
m_depCalced( false ),
m_installedPackages(),
m_alreadyInstalledPackages(),
m_ignoredPackages(),
m_depNameList(),
m_depList(),
m_missingPackages(),
m_installErrors(),
m_config( config )
{
list<char*>::const_iterator it = names.begin();
for ( ; it != names.end(); ++it ) {
m_packages.push_back( make_pair( *it, m_repo->getPackage( *it ) ) );
}
}
/*! /*!
Create a nice InstallTransaction Create a nice InstallTransaction
\param names a list of port names to be installed \param names a list of port names to be installed
@ -142,17 +111,17 @@ InstallTransaction::installError() const
/*! /*!
install (commit) a transaction install (commit) a transaction
\param parser the argument parser \param parser the argument parser
\param update whether this is an update operation
\return returns an InstallResult telling whether installation worked \return returns an InstallResult telling whether installation worked
*/ */
InstallTransaction::InstallResult InstallTransaction::InstallResult
InstallTransaction::install( const ArgParser* parser, InstallTransaction::install( const ArgParser* parser )
bool update )
{ {
if ( m_packages.empty() ) { if ( m_packages.empty() ) {
return NO_PACKAGE_GIVEN; return NO_PACKAGE_GIVEN;
} }
bool update;
const string forceRebuild = "-fr";
list<string> ignoredPackages; list<string> ignoredPackages;
StringHelper::split(parser->ignore(), ',', ignoredPackages); StringHelper::split(parser->ignore(), ',', ignoredPackages);
@ -175,12 +144,33 @@ InstallTransaction::install( const ArgParser* parser,
continue; continue;
} }
// consider aliases here, but don't show them specifically // Set the update flag if the package is installed and out of date,
if ( !update && m_pkgDB->isInstalled( package->name(), true ) ) { // or if the user has forced a rebuild.
// ignore // Proceed to the next target if package is installed and up to date,
// or is provided by an alias.
if ( m_pkgDB->isInstalled( it->first, false ) ) {
VersionComparator::COMP_RESULT
rpDiff = VersionComparator::compareVersions(
m_repo->getPackageVersion( package->name() ),
m_pkgDB->getPackageVersion( package->name() ) );
if ( rpDiff == VersionComparator::EQUAL &&
parser->pkgmkArgs().find(forceRebuild) == string::npos ) {
m_alreadyInstalledPackages.push_back( package->name() ); m_alreadyInstalledPackages.push_back( package->name() );
continue; continue;
} else if ( (! m_config->preferHigher()) || parser->strictDiff()
|| rpDiff == VersionComparator::GREATER
|| ( parser->pkgmkArgs().find(forceRebuild)
!= string::npos && find(parser->otherArgs().begin(),
parser->otherArgs().end(), it->first)
!= parser->otherArgs().end() ) ) {
update = true;
} else {
continue;
} }
} else if ( m_pkgDB->isInstalled( it->first, true ) ) {
continue;
}
InstallTransaction::InstallResult result; InstallTransaction::InstallResult result;
InstallInfo info( package->hasReadme() ); InstallInfo info( package->hasReadme() );
@ -191,29 +181,25 @@ InstallTransaction::install( const ArgParser* parser,
info.postState = ( package->hasPostInstall() && info.postState = ( package->hasPostInstall() &&
(parser->execPostInstall() || m_config->runScripts()) (parser->execPostInstall() || m_config->runScripts())
) ? DEFERRED : NONEXISTENT; ) ? DEFERRED : NONEXISTENT;
m_installedPackages.push_back( make_pair( package->path() m_installedPackages.push_back( make_pair( package->path() + "/" + package->name(), info));
+ "/" + package->name(), info));
continue; continue;
} }
if ((result = installPackage( package, parser, update, info )) == SUCCESS) { if ((result = installPackage( package, parser, update, info )) == SUCCESS) {
m_installedPackages.push_back( make_pair( package->path() m_installedPackages.push_back( make_pair( package->path() + "/" + package->name(), info));
+ "/" + package->name(), info));
} else { } else {
// log failures are critical // log failures and pkgdest errors are critical,
// don't proceed to the next install target if encountered
if ( result == LOG_DIR_FAILURE || if ( result == LOG_DIR_FAILURE ||
result == LOG_FILE_FAILURE || result == LOG_FILE_FAILURE ||
result == NO_LOG_FILE || result == NO_LOG_FILE ||
result == CANT_LOCK_LOG_FILE || result == CANT_LOCK_LOG_FILE ||
// or pkgdest
result == PKGDEST_ERROR ) { result == PKGDEST_ERROR ) {
return result; return result;
} }
m_installErrors.push_back( make_pair(package->name(), info) ); m_installErrors.push_back( make_pair(package->path() + "/" + package->name(), info) );
if ( parser->group() ) { if ( parser->group() ) {
return PKGMK_FAILURE; return PKGMK_FAILURE;
} }
@ -235,8 +221,7 @@ InstallTransaction::installPackage( const Package* package,
const ArgParser* parser, const ArgParser* parser,
bool update, bool update,
InstallTransaction::InstallInfo& info ) InstallTransaction::InstallInfo& info )
const const {
{
InstallTransaction::InstallResult result = SUCCESS; InstallTransaction::InstallResult result = SUCCESS;
#ifdef USE_LOCKING #ifdef USE_LOCKING
@ -252,7 +237,7 @@ InstallTransaction::installPackage( const Package* package,
commandName = "prt-cache"; commandName = "prt-cache";
} }
// - initial information about the package to be build // - initial information about the package to be built
string message; string message;
message = commandName + ": "; message = commandName + ": ";
if (update) { if (update) {
@ -310,23 +295,25 @@ InstallTransaction::installPackage( const Package* package,
write( fdlog, timestamp.c_str(), timestamp.length()); write( fdlog, timestamp.c_str(), timestamp.length());
} }
string pkgdir = package->path() + "/" + package->name(); string portdir = package->path() + "/" + package->name();
chdir( pkgdir.c_str() ); chdir( portdir.c_str() );
string runscriptCommand = "sh"; string runscriptCommand = "/bin/sh";
if (m_config->runscriptCommand() != "") { if (m_config->runscriptCommand() != "") {
runscriptCommand = m_config->runscriptCommand(); runscriptCommand = m_config->runscriptCommand();
} }
if (parser->installRoot() != "") { if (parser->installRoot() != "") {
runscriptCommand = "chroot " + parser->installRoot() + runscriptCommand; runscriptCommand = "chroot " + parser->installRoot() + " "
+ runscriptCommand;
} }
// -- pre-install // -- pre-install
struct stat statData; struct stat statData; struct stat fstatData;
if ((parser->execPreInstall() || m_config->runScripts()) && if ((parser->execPreInstall() || m_config->runScripts()) &&
stat((parser->installRoot() + pkgdir + "/" + "pre-install").c_str(), &statData) == 0) { stat((parser->installRoot() + portdir + "/pre-install").c_str(),
&statData) == 0) {
Process preProc( runscriptCommand, Process preProc( runscriptCommand,
pkgdir + "/" + "pre-install", portdir + "/pre-install",
fdlog ); fdlog );
if (preProc.executeShell()) { if (preProc.executeShell()) {
info.preState = FAILED; info.preState = FAILED;
@ -336,22 +323,39 @@ InstallTransaction::installPackage( const Package* package,
} }
// -- build // -- build
string pkgdest = m_config->packageDir();
string builtPkg = package->name() + "#" + package->version() + "-" +
package->release() + ".pkg.tar." + m_config->compressionMode();
string builtPkgPath = ( pkgdest != "" ) ? pkgdest + "/" + builtPkg :
portdir + "/" + builtPkg ;
string cmd = PKGMK_DEFAULT_COMMAND; string cmd = PKGMK_DEFAULT_COMMAND;
if (m_config->makeCommand() != "") { if (m_config->makeCommand() != "") {
cmd = m_config->makeCommand(); cmd = m_config->makeCommand();
} }
// skip the build if a package exists newer than Pkgfile
// (e.g., created by running pkgmk manually)
if ( stat(builtPkgPath.c_str(), &statData) +
stat((portdir + "/Pkgfile").c_str(), &fstatData) == 0) {
time_t pkgMtime = statData.st_mtime;
time_t pfMtime = fstatData.st_mtime;
if ( ( difftime(pkgMtime,pfMtime) > 0 ) and
(parser->pkgmkArgs().find(" -f") == string::npos) ) {
cmd = "/bin/true"; }
}
string args = "-d " + parser->pkgmkArgs(); string args = "-d " + parser->pkgmkArgs();
if ( parser->pkgmkArgs().find(" -f") != string::npos &&
find( parser->otherArgs().begin(), parser->otherArgs().end(),
package->name() ) == parser->otherArgs().end() ) {
StringHelper::replaceAll(args," -f","");
}
Process makeProc( cmd, args, fdlog ); Process makeProc( cmd, args, fdlog );
if ( makeProc.executeShell() ) { if ( makeProc.executeShell() ) {
result = PKGMK_FAILURE; result = PKGMK_FAILURE;
} else { } else {
// -- update string message = ( pkgdest == "" ) ? "" :
string pkgdest = getPkgmkPackageDir(); commandName + ": Using PKGMK_PACKAGE_DIR " + pkgdest;
if ( pkgdest != "" ) {
// TODO: don't manipulate pkgdir
pkgdir = pkgdest;
string message = "prt-get: Using PKGMK_PACKAGE_DIR: " + pkgdir;
if (parser->verbose() > 0) { if (parser->verbose() > 0) {
cout << message << endl; cout << message << endl;
} }
@ -361,10 +365,7 @@ InstallTransaction::installPackage( const Package* package,
} }
} }
// the following chdir is a noop if usePkgDest() returns false // no need to chdir if we provide absolute paths to pkgadd
if ( chdir( pkgdir.c_str() ) != 0 ) {
result = PKGDEST_ERROR;
} else {
cmd = PKGADD_DEFAULT_COMMAND; cmd = PKGADD_DEFAULT_COMMAND;
if (m_config->addCommand() != "") { if (m_config->addCommand() != "") {
cmd = m_config->addCommand(); cmd = m_config->addCommand();
@ -375,25 +376,20 @@ InstallTransaction::installPackage( const Package* package,
args = "-r " + parser->installRoot() + " "; args = "-r " + parser->installRoot() + " ";
} }
if ( update ) { if ( update ) {
args += "-u "; args += "-u ";
} }
if ( !parser->pkgaddArgs().empty() ) { if ( !parser->pkgaddArgs().empty() ) {
args += parser->pkgaddArgs() + " "; args += parser->pkgaddArgs() + " ";
} }
args += args += builtPkgPath;
package->name() + "#" +
package->version() + "-" +
package->release() + ".pkg.tar." + getPkgmkCompressionMode();
// - inform the user about what's happening // - inform the user about what's happening
string fullCommand = commandName + ": " + cmd + " " + args; string fullCommand = commandName + ": " + cmd + args;
string summary; string summary;
if (update) { if (update) {
string from = m_pkgDB->getPackageVersion(package->name()); string from = m_pkgDB->getPackageVersion(package->name());
string to = package->version() + "-" + package->release(); string to = m_repo->getPackageVersion(package->name());
if (from == to) { if (from == to) {
summary = commandName + ": " + "reinstalling " + summary = commandName + ": " + "reinstalling " +
package->name() + " " + to; package->name() + " " + to;
@ -402,9 +398,8 @@ InstallTransaction::installPackage( const Package* package,
package->name() + " from " + from + " to " + to; package->name() + " from " + from + " to " + to;
} }
} else { } else {
summary = commandName + ": " + "installing " + summary = commandName + ": " + "installing " + package->name() +
package->name() + " " + " " + package->version() + "-" + package->release();
package->version() + "-" + package->release();
} }
// - print and log // - print and log
@ -432,14 +427,10 @@ InstallTransaction::installPackage( const Package* package,
} else { } else {
// exec post install // exec post install
if ((parser->execPostInstall() || m_config->runScripts() ) && if ((parser->execPostInstall() || m_config->runScripts() ) &&
stat((parser->installRoot() + package->path() stat((parser->installRoot() + portdir + "/post-install").c_str(),
+ "/" + package->name() + "/" + "post-install").c_str(),
&statData) == 0) { &statData) == 0) {
// Work around the pkgdir variable change
Process postProc( runscriptCommand, Process postProc( runscriptCommand,
package->path() + "/" + package->name()+ portdir + "/post-install", fdlog );
"/" + "post-install",
fdlog );
if (postProc.executeShell()) { if (postProc.executeShell()) {
info.postState = FAILED; info.postState = FAILED;
} else { } else {
@ -447,8 +438,6 @@ InstallTransaction::installPackage( const Package* package,
} }
} }
} }
}
}
if ( m_config->writeLog() ) { if ( m_config->writeLog() ) {
@ -481,8 +470,7 @@ bool InstallTransaction::calculateDependencies()
return false; return false;
} }
list< pair<string, const Package*> >::const_iterator it = list<pair<string, const Package*>>::const_iterator it = m_packages.begin();
m_packages.begin();
for ( ; it != m_packages.end(); ++it ) { for ( ; it != m_packages.end(); ++it ) {
const Package* package = it->second; const Package* package = it->second;
if ( package ) { if ( package ) {
@ -526,7 +514,7 @@ void InstallTransaction::checkDependencies( bool greedy,
if ( index == -1 ) { if ( index == -1 ) {
index = m_depList.size(); index = m_depList.size();
if ( (!greedy) or isRequired( package->name() ) ) { if ( ( not greedy ) or (isRequired( package->name() )) ) {
m_depList.push_back( package->name() ); m_depList.push_back( package->name() );
} }
} }
@ -593,7 +581,7 @@ void InstallTransaction::checkDependencies( bool greedy,
Method to determine whether a soft dependency should be part of the transaction Method to determine whether a soft dependency should be part of the transaction
*/ */
bool InstallTransaction::isRequired(const string &pname) { bool InstallTransaction::isRequired(const string &pname) {
if ( m_pkgDB->isInstalled(pname,false) ) { return true; } if ( m_pkgDB->isInstalled(pname) ) { return true; }
list<pair<string, const Package*>>::iterator it = m_packages.begin(); list<pair<string, const Package*>>::iterator it = m_packages.begin();
for ( ; it != m_packages.end(); ++it ) { for ( ; it != m_packages.end(); ++it ) {
if ( pname == it->first ) { return true; } if ( pname == it->first ) { return true; }
@ -652,11 +640,11 @@ InstallTransaction::installedPackages() const
/*! /*!
calculate dependendencies for this package calculate dependendencies for this package
*/ */
InstallTransaction::InstallResult bool InstallTransaction::calcDependencies( )
InstallTransaction::calcDependencies( )
{ {
if ( m_packages.empty() ) { if ( m_packages.empty() ) {
return NO_PACKAGE_GIVEN; cout << "No packages given for this transaction" << endl;
return false;
} }
bool validPackages = false; bool validPackages = false;
@ -669,75 +657,19 @@ InstallTransaction::calcDependencies( )
m_missingPackages.push_back( make_pair( it->first, string("") ) ); m_missingPackages.push_back( make_pair( it->first, string("") ) );
} }
} }
if (!validPackages) { if (!validPackages) {
return PACKAGE_NOT_FOUND; cout << "No valid packages for this transaction" << endl;
return false;
} }
if ( !calculateDependencies() ) { if ( !calculateDependencies() ) {
return CYCLIC_DEPEND; cout << "Cyclic dependencies detected" << endl;
return false;
} }
return SUCCESS; return true;
}
/*
* getPkgDest assumes that you're in the build directory already
*/
string InstallTransaction::getPkgmkSetting(const string& setting)
{
string value = "";
value = getPkgmkSettingFromFile(setting, "/etc/pkgmk.conf");
if (value.size() == 0) {
value = getPkgmkSettingFromFile(setting, "/usr/bin/pkgmk");
}
return value;
}
string InstallTransaction::getPkgmkSettingFromFile(const string& setting, const string& fileName)
{
FILE* fp = fopen(fileName.c_str(), "r");
if (!fp)
return "";
string candidate;
string s;
char line[256];
while (fgets(line, 256, fp)) {
s = StringHelper::stripWhiteSpace(line);
if (StringHelper::startsWith(s, setting + "=")) {
candidate = s;
}
}
fclose(fp);
string value = "";
if (candidate.length() > 0) {
string cmd = "eval " + candidate + " && echo $" + setting;
FILE* p = popen(cmd.c_str(), "r");
if (p) {
fgets(line, 256, p);
value = StringHelper::stripWhiteSpace(line);
pclose(p);
}
}
return value;
} }
const list<string>& InstallTransaction::ignoredPackages() const const list<string>& InstallTransaction::ignoredPackages() const
{ {
return m_ignoredPackages; return m_ignoredPackages;
} }
string InstallTransaction::getPkgmkPackageDir()
{
return getPkgmkSetting("PKGMK_PACKAGE_DIR");
}
string InstallTransaction::getPkgmkCompressionMode()
{
string value = getPkgmkSetting("PKGMK_COMPRESSION_MODE");
return value.size() ? value : "gz";
}

View File

@ -33,10 +33,6 @@ class Configuration;
class InstallTransaction class InstallTransaction
{ {
public: public:
InstallTransaction( const list<char*>& names,
const Repository* repo,
PkgDB* pkgDB,
const Configuration* config );
InstallTransaction( const list<string>& names, InstallTransaction( const list<string>& names,
const Repository* repo, const Repository* repo,
PkgDB* pkgDB, PkgDB* pkgDB,
@ -54,7 +50,7 @@ public:
/*! Result of an installation */ /*! Result of an installation */
enum InstallResult { enum InstallResult {
SUCCESS, /*!< yeah, success */ SUCCESS, /*!< yeah, success */
NO_PACKAGE_GIVEN, /*!< no package give to install */ NO_PACKAGE_GIVEN, /*!< no package given to install */
PACKAGE_NOT_FOUND, /*!< package not found */ PACKAGE_NOT_FOUND, /*!< package not found */
PKGMK_FAILURE, /*!< error while pkgmk */ PKGMK_FAILURE, /*!< error while pkgmk */
PKGDEST_ERROR, /*!< can't change to PKGDEST */ PKGDEST_ERROR, /*!< can't change to PKGDEST */
@ -83,22 +79,17 @@ public:
bool hasReadme; bool hasReadme;
}; };
InstallResult install( const ArgParser* parser, InstallResult install( const ArgParser* parser );
bool update ); bool calcDependencies();
InstallResult calcDependencies();
const list< pair<string, InstallInfo> >& installedPackages() const; const list< pair<string, InstallInfo> >& installedPackages() const;
const list<string>& alreadyInstalledPackages() const; const list<string>& alreadyInstalledPackages() const;
const list<string>& ignoredPackages() const; const list<string>& ignoredPackages() const;
const list<string>& dependencies() const; const list<string>& dependencies() const;
const list< pair<string,string> >& missing() const; const list< pair<string,string> >& missing() const;
const list< pair<string, InstallInfo> >& installError() const; const list< pair<string, InstallInfo> >& installError() const;
static string getPkgmkPackageDir();
static string getPkgmkCompressionMode();
private: private:
bool calculateDependencies(); bool calculateDependencies();
void checkDependencies( bool greedy, const Package* package, int depends=-1 ); void checkDependencies( bool greedy, const Package* package, int depends=-1 );
@ -109,10 +100,6 @@ private:
InstallInfo& info ) const; InstallInfo& info ) const;
bool isRequired(const string &pname); bool isRequired(const string &pname);
static string getPkgmkSetting(const string& setting);
static string getPkgmkSettingFromFile(const string& setting,
const string& fileName);
PkgDB* m_pkgDB; PkgDB* m_pkgDB;
DepResolver m_resolver; DepResolver m_resolver;
const Repository* m_repo; const Repository* m_repo;
@ -126,21 +113,20 @@ private:
// packages< pair<name, hasReadme> > installed by this transaction // packages< pair<name, hasReadme> > installed by this transaction
list< pair<string, InstallInfo> > m_installedPackages; list< pair<string, InstallInfo> > m_installedPackages;
// packages which were requested to be installed which where already // packages requested to be installed, but already present
list<string> m_alreadyInstalledPackages; list<string> m_alreadyInstalledPackages;
// packages which are required by the transaction, but ignored by // packages required by the transaction, but ignored by the user
// the user
list<string> m_ignoredPackages; list<string> m_ignoredPackages;
list<string> m_depNameList; list<string> m_depNameList;
vector<string> m_depList; vector<string> m_depList;
vector<string> treeWalk; vector<string> treeWalk;
// packages requested to be installed not found in the ports tree // packages requested to be installed, but not found in the ports tree
list< pair<string, string> > m_missingPackages; list< pair<string, string> > m_missingPackages;
// packages where build/installed failed // packages where build/install failed
list< pair<string, InstallInfo> > m_installErrors; list< pair<string, InstallInfo> > m_installErrors;
/// prt-get itself /// prt-get itself

View File

@ -57,17 +57,13 @@ int main( int argc, char** argv )
ArgParser::Type command = argParser.commandType(); ArgParser::Type command = argParser.commandType();
switch ( command ) switch ( command ) {
{
case ArgParser::HELP: case ArgParser::HELP:
prtGet.printUsage(); prtGet.printUsage();
break; break;
case ArgParser::SHOW_VERSION: case ArgParser::SHOW_VERSION:
prtGet.printVersion(); prtGet.printVersion();
break; break;
case ArgParser::LIST:
prtGet.listPackages();
break;
case ArgParser::DUP: case ArgParser::DUP:
prtGet.listShadowed(); prtGet.listShadowed();
break; break;
@ -84,25 +80,16 @@ int main( int argc, char** argv )
prtGet.isInstalled(); prtGet.isInstalled();
break; break;
case ArgParser::INSTALL: case ArgParser::INSTALL:
prtGet.install(); prtGet.install( argParser.depSort() );
break;
case ArgParser::DEPINST:
prtGet.install( false, true );
break; break;
case ArgParser::DEPENDS: case ArgParser::DEPENDS:
prtGet.printDepends(); prtGet.printDepends( argParser.quick() );
break; break;
case ArgParser::QUICKDEP: case ArgParser::DEPTREE:
prtGet.printDepends( true ); prtGet.printDepTree();
break;
case ArgParser::UPDATE:
prtGet.install( true );
break; break;
case ArgParser::DIFF: case ArgParser::DIFF:
prtGet.printDiff(); prtGet.printDiff( argParser.quick() );
break;
case ArgParser::QUICKDIFF:
prtGet.printQuickDiff();
break; break;
case ArgParser::CREATE_CACHE: case ArgParser::CREATE_CACHE:
prtGet.createCache(); prtGet.createCache();
@ -110,36 +97,36 @@ int main( int argc, char** argv )
case ArgParser::PATH: case ArgParser::PATH:
prtGet.printPath(); prtGet.printPath();
break; break;
case ArgParser::LISTINST:
prtGet.listInstalled();
break;
case ArgParser::PRINTF: case ArgParser::PRINTF:
prtGet.printf(); prtGet.printf();
break; break;
case ArgParser::README: case ArgParser::README:
prtGet.readme(); prtGet.readme();
break; break;
case ArgParser::DEPENDENT:
prtGet.printDependent();
break;
case ArgParser::SYSUP:
prtGet.sysup();
break;
case ArgParser::CURRENT: case ArgParser::CURRENT:
prtGet.current(); prtGet.current();
break; break;
case ArgParser::FSEARCH: case ArgParser::FSEARCH:
prtGet.fsearch(); prtGet.fsearch();
break; break;
case ArgParser::LIST:
prtGet.listPackages();
break;
case ArgParser::LISTINST:
prtGet.listInstalled();
break;
case ArgParser::LISTORPHANS:
prtGet.listOrphans();
break;
case ArgParser::LISTLOCKED:
prtGet.listLocked();
break;
case ArgParser::LOCK: case ArgParser::LOCK:
prtGet.setLock( true ); prtGet.setLock( true );
break; break;
case ArgParser::UNLOCK: case ArgParser::UNLOCK:
prtGet.setLock( false ); prtGet.setLock( false );
break; break;
case ArgParser::LISTLOCKED:
prtGet.listLocked();
break;
case ArgParser::CAT: case ArgParser::CAT:
prtGet.cat(); prtGet.cat();
break; break;
@ -152,15 +139,9 @@ int main( int argc, char** argv )
case ArgParser::REMOVE: case ArgParser::REMOVE:
prtGet.remove(); prtGet.remove();
break; break;
case ArgParser::DEPTREE:
prtGet.printDependTree();
break;
case ArgParser::DUMPCONFIG: case ArgParser::DUMPCONFIG:
prtGet.dumpConfig(); prtGet.dumpConfig();
break; break;
case ArgParser::LISTORPHANS:
prtGet.listOrphans();
break;
default: default:
cerr << "unknown command" << endl; cerr << "unknown command" << endl;
break; break;

View File

@ -222,6 +222,7 @@ void Package::load() const
StringHelper::replaceAll( depends, " ", "," ); StringHelper::replaceAll( depends, " ", "," );
StringHelper::replaceAll( depends, ",,", "," ); StringHelper::replaceAll( depends, ",,", "," );
m_data->depends = depends; m_data->depends = depends;
} }
} }

View File

@ -32,6 +32,7 @@ public:
bool useAlias = false, bool useAlias = false,
bool* isAlias = 0, bool* isAlias = 0,
string* aliasOrignalName = 0 ) const; string* aliasOrignalName = 0 ) const;
bool isOutdated( const std::string& name ) const;
std::string getPackageVersion( const std::string& name ) const; std::string getPackageVersion( const std::string& name ) const;

File diff suppressed because it is too large Load Diff

View File

@ -55,22 +55,25 @@ public:
void listPackages(); void listPackages();
void listShadowed(); void listShadowed();
void listInstalled(); void listInstalled();
void listOrphans();
void listLocked();
void setLock( bool lock );
void searchPackages( bool searchDesc=false ); void searchPackages( bool searchDesc=false );
void fsearch();
void printInfo(); void printInfo();
void isInstalled(); void isInstalled();
bool isOutdated();
void current();
void readme(); void readme();
void install( bool update=false, void install( bool dependencies=false );
bool dependencies=false ); void remove();
void sysup();
void current();
void printDepends( bool simpleListing=false ); void printDepends( bool simpleListing=false );
void printDependTree(); void printDiff( bool simpleListing=false );
void printDependent(); void printDepTree();
void printDiff();
void printQuickDiff();
void listOrphans();
void createCache(); void createCache();
@ -80,14 +83,6 @@ public:
void cat(); void cat();
void ls(); void ls();
void edit(); void edit();
void remove();
void setLock( bool lock );
void listLocked();
void fsearch();
void dumpConfig(); void dumpConfig();
int returnValue() const; int returnValue() const;
@ -96,14 +91,10 @@ public:
protected: protected:
void printDepsLevel(int indent, const Package* package, bool greedy); void printDepsLevel(int level, const Package* package, bool greedy);
void printDependent(const std::string& dep, int level); void executeTransaction( InstallTransaction& transaction );
void executeTransaction( InstallTransaction& transaction,
bool update );
void evaluateResult( InstallTransaction& transaction, void evaluateResult( InstallTransaction& transaction,
bool update,
bool interrupted=false ); bool interrupted=false );
void reportPrePost(const InstallTransaction::InstallInfo& info); void reportPrePost(const InstallTransaction::InstallInfo& info);
@ -122,7 +113,6 @@ protected:
const string& version2, const string& version2,
bool locked); bool locked);
Repository* m_repo; Repository* m_repo;
PkgDB* m_pkgDB; PkgDB* m_pkgDB;
Configuration* m_config; Configuration* m_config;

View File

@ -86,12 +86,26 @@ const Package* Repository::getPackage( const string& name ) const
return it->second; return it->second;
} }
/*!
\param name the package name to be matched
\return the version-release in the repository
*/
std::string Repository::getPackageVersion( const string& name ) const
{
map<string, Package*>::const_iterator it = m_packageMap.find( name );
if ( it == m_packageMap.end() ) {
return "0";
}
const Package* p = it->second;
string result = p->version()+"-"+p->release();
return result;
}
/*! /*!
Search packages for a match of \a pattern in name, and description of Search packages for a match of \a pattern in name, or in description if
\a searchDesc is true. \a searchDesc is true.
\note Name searches can often done without opening the Pkgfiles, but not \note Name searches can often be done without opening the Pkgfiles, but not
description search. Therefore, the later is much slower description search. Therefore, the latter is much slower
\param pattern the pattern to be found \param pattern the pattern to be found
\param searchDesc whether descriptions should be searched as well \param searchDesc whether descriptions should be searched as well
@ -188,11 +202,10 @@ void Repository::initFromFS( const list< pair<string, string> >& rootList,
// TODO: think about whether it would be faster (more // TODO: think about whether it would be faster (more efficient)
// efficient) to put all packages into a map, and the iterate // to put all packages into a map, and then iterate
// over the list of allowed packages and copy them // over the list of allowed packages and copy them over.
// over. depending in the efficiency of find(), this might be // Depending on the efficiency of find(), this might be faster.
// faster
d = opendir( path.c_str() ); d = opendir( path.c_str() );
while ( ( de = readdir( d ) ) != NULL ) { while ( ( de = readdir( d ) ) != NULL ) {
name = de->d_name; name = de->d_name;
@ -327,9 +340,20 @@ Repository::WriteResult Repository::writeCache( const string& cacheFile )
const Package* p = it->second; const Package* p = it->second;
// TODO: encode // TODO: encode
hasReadme = ( p->hasReadme() ) ? yesStr : noStr; hasReadme = noStr;
hasPreInstall = ( p->hasPreInstall() ) ? yesStr : noStr; if ( p->hasReadme() ) {
hasPostInstall = ( p->hasPostInstall() ) ? yesStr : noStr; hasReadme = yesStr;
}
hasPreInstall = noStr;
if ( p->hasPreInstall() ) {
hasPreInstall = yesStr;
}
hasPostInstall = noStr;
if ( p->hasPostInstall() ) {
hasPostInstall = yesStr;
}
fprintf( fp, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n\n", fprintf( fp, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n\n",
p->name().c_str(), p->name().c_str(),
@ -379,6 +403,37 @@ bool Repository::createOutputDir( const string& path )
return true; return true;
} }
/*
look for any port mentioning \a pattern as a dependency or soft dependency.
searchOptionals=false (the default) only searches the "Depends on:" line.
The output will need to be trimmed afterward, because in this namespace we
can't check whether the matching ports are installed.
*/
void Repository::getDependentPackages( const string& pattern,
list<Package*>& target,
bool searchOptionals ) const {
map<string, Package*>::const_iterator im = m_packageMap.begin();
for ( ; im != m_packageMap.end(); ++im ) {
Package* q = im->second; string s;
if (searchOptionals) {
s = toLowerCase(q->optionals());
} else {
s = toLowerCase(q->dependencies());
}
if ( s.find( pattern ) != string::npos ) {
list<string> tokens;
split( s, ',', tokens );
list<string>::iterator ik = find( tokens.begin(),
tokens.end(), pattern );
if ( ik != tokens.end() ) {
target.push_back( q );
}
}
}
}
/*! /*!
Search packages for a match of \a pattern in name. The name can Search packages for a match of \a pattern in name. The name can

View File

@ -19,6 +19,7 @@
using namespace std; using namespace std;
#include "package.h" #include "package.h"
#include "stringhelper.h"
/*! /*!
\class Repository \class Repository
@ -33,6 +34,7 @@ public:
~Repository(); ~Repository();
const Package* getPackage( const string& name ) const; const Package* getPackage( const string& name ) const;
std::string getPackageVersion( const string& name ) const;
const map<string, Package*>& packages() const; const map<string, Package*>& packages() const;
const list<pair<Package*, Package*> >& shadowedPackages() const; const list<pair<Package*, Package*> >& shadowedPackages() const;
@ -40,6 +42,10 @@ public:
list<Package*>& target, list<Package*>& target,
bool searchDesc ) const; bool searchDesc ) const;
void getDependentPackages( const string& pattern,
list<Package*>& target,
bool searchOptionals ) const;
void getMatchingPackages( const string& pattern, void getMatchingPackages( const string& pattern,
list<Package*>& target ) const; list<Package*>& target ) const;

View File

@ -155,5 +155,4 @@ string replaceAll( string& in,
return in; return in;
} }
}; // Namespace }; // Namespace