Compare commits

..

No commits in common. "master" and "5.19" have entirely different histories.
master ... 5.19

45 changed files with 9763 additions and 1553 deletions

View File

@ -1,16 +1,3 @@
* 31.08.2023 John McQuah
- allow prt-get to remove build log when uninstalling a package (feature
requested by samsep10l)
* 31.03.2023 John McQuah
- respect the user's choice of --install-root when running pre- or
post-install scripts
* 10.03.2023 John McQuah
- make it possible to consider optional dependencies when updating
- bump version of the cache file format, to warn users about the
'Packager' field being replaced by 'Optional'
* 5.16 26.06.2008 Johannes Winkelmann
- don't loop forever when version= contains unsupported $() tokens
- gcc 4.3 fixes (thanks Fredrik)

View File

@ -1,7 +1,6 @@
Installing prt-get
------------------
Installing prt-get is just a matter of
meson setup bld --prefix=/usr
cd bld && meson compile
meson install
./configure
make
make install

7
Makefile.am Normal file
View File

@ -0,0 +1,7 @@
AUTOMAKE_OPTIONS = foreign
MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in stamp-h.in
SUBDIRS = src doc misc
EXTRA_DIST = CREDITS FAQ LICENSE

723
Makefile.in Normal file
View File

@ -0,0 +1,723 @@
# 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 = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(top_srcdir)/configure AUTHORS ChangeLog INSTALL TODO depcomp \
install-sh missing 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)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
cscope distdir dist dist-all distcheck
ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
if test -d "$(distdir)"; then \
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -rf "$(distdir)" \
|| { sleep 5 && rm -rf "$(distdir)"; }; \
else :; fi
am__post_remove_distdir = $(am__remove_distdir)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
DIST_TARGETS = dist-gzip
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
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@
AUTOMAKE_OPTIONS = foreign
MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in stamp-h.in
SUBDIRS = src doc misc
EXTRA_DIST = CREDITS FAQ LICENSE
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
am--refresh: Makefile
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
$(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
config.h: stamp-h1
@if test ! -f $@; then rm -f stamp-h1; else :; fi
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f config.h stamp-h1
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
cscopelist-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
done
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: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) config.h.in $(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: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) config.h.in $(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"
cscope: cscope.files
test ! -s cscope.files \
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
clean-cscope:
-rm -f cscope.files
cscope.files: clean-cscope cscopelist-recursive cscopelist
cscopelist: cscopelist-recursive $(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
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
distdir: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@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
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
-test -n "$(am__skip_mode_fix)" \
|| find "$(distdir)" -type d ! -perm -755 \
-exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
$(am__post_remove_distdir)
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__post_remove_distdir)
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__post_remove_distdir)
dist dist-all:
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
$(am__post_remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir); chmod u+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
&& cd "$$am__cwd" \
|| exit 1
$(am__post_remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@test -n '$(distuninstallcheck_dir)' || { \
echo 'ERROR: trying to run $@ with an empty' \
'$$(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
$(am__cd) '$(distuninstallcheck_dir)' || { \
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile config.h
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
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."
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-recursive
clean-am: clean-generic mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am:
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
cscopelist-recursive ctags-recursive install-am install-strip \
tags-recursive
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am am--refresh check check-am clean clean-cscope \
clean-generic cscope cscopelist cscopelist-recursive ctags \
ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-lzip \
dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \
distclean-generic distclean-hdr distclean-tags distcleancheck \
distdir distuninstallcheck 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 installcheck installcheck-am \
installdirs installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am tags tags-recursive uninstall uninstall-am
# 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:

15
README
View File

@ -11,8 +11,8 @@ process.
Installing:
-----------
Download an iso of the latest CRUX release for a precompiled package.
Otherwise, build from the sources in this repository.
Just install the crux port from
- http://www.hta-bi.bfh.ch/~winkj/files/crux/prt-get.prt.gz
prt-get has to know where to look for ports. You can specify those in
/etc/prt-get.conf, one directory per line. Note that the order
@ -20,16 +20,15 @@ matters, when the same port is in multiple direcories
(e.g. /usr/ports/contrib/mutt and /usr/ports/local/mutt), the one
found _first_ will be used.
Feel free to file a bug report on the Gitea issue tracker:
https://git.crux.nu:82/farkuhar/prt-get/issues/
Feel free to contact me in case of problems (jw@tks6.net)
more information
----------------
See the man pages for prt-get(8), prt-get.conf(5) and prt-cache for more
information. The CRUX homepage also offers a (somewhat dated) User Manual
and Quick Start guide:
https://crux.nu/doc/prt-get%20-%20User%20Manual.html
https://crux.nu/doc/prt-get%20-%20Quick%20start.html
information. There is also a user manual in the doc directory (as a
tex file). This document should also be available as PDF from
http://www.hta-bi.bfh.ch/~winkj/files/crux/manual.pdf
"it must be user error" (thinkgeek)
-----------------------------------

2
TODO
View File

@ -10,7 +10,7 @@
CONSIDER:
- default formats for printf and dup
- add update-footprint, update-signature commands
- add update-footprint, update-md5sum commands (patch in trac)
- sysup
- allow injecting of new (uninstalled) dependencies
- allow to prohibit recompilation of packages when a dependency failed

984
aclocal.m4 vendored Normal file
View File

@ -0,0 +1,984 @@
# generated automatically by aclocal 1.12.2 -*- Autoconf -*-
# Copyright (C) 1996-2012 Free Software Foundation, Inc.
# This file 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.
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
[m4_warning([this file was generated for autoconf 2.69.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
# Copyright (C) 2002-2012 Free Software Foundation, Inc.
#
# This file 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.
# serial 8
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.12'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.12.2], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
# _AM_AUTOCONF_VERSION(VERSION)
# -----------------------------
# aclocal traces this macro to find the Autoconf version.
# This is a private macro too. Using m4_define simplifies
# the logic in aclocal, which can simply ignore this definition.
m4_define([_AM_AUTOCONF_VERSION], [])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.12.2])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001-2012 Free Software Foundation, Inc.
#
# This file 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.
# serial 2
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
#
# Of course, Automake must honor this variable whenever it calls a
# tool from the auxiliary directory. The problem is that $srcdir (and
# therefore $ac_aux_dir as well) can be either absolute or relative,
# depending on how configure is run. This is pretty annoying, since
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
# source directory, any form will work fine, but in subdirectories a
# relative path needs to be adjusted first.
#
# $ac_aux_dir/missing
# fails when called from a subdirectory if $ac_aux_dir is relative
# $top_srcdir/$ac_aux_dir/missing
# fails if $ac_aux_dir is absolute,
# fails when called from a subdirectory in a VPATH build with
# a relative $ac_aux_dir
#
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
# are both prefixed by $srcdir. In an in-source build this is usually
# harmless because $srcdir is '.', but things will broke when you
# start a VPATH build or use an absolute $srcdir.
#
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
# and then we would define $MISSING as
# MISSING="\${SHELL} $am_aux_dir/missing"
# This will work as long as MISSING is not called from configure, because
# unfortunately $(top_srcdir) has no meaning in configure.
# However there are other variables, like CC, which are often used in
# configure, and could therefore not use this "fixed" $ac_aux_dir.
#
# Another solution, used here, is to always expand $ac_aux_dir to an
# absolute PATH. The drawback is that using absolute paths prevent a
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
[dnl Rely on autoconf to set up CDPATH properly.
AC_PREREQ([2.50])dnl
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
])
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997-2012 Free Software Foundation, Inc.
#
# This file 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.
# serial 10
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ([2.52])dnl
m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])dnl
AC_SUBST([$1_FALSE])dnl
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
m4_define([_AM_COND_VALUE_$1], [$2])dnl
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi
AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
AC_MSG_ERROR([[conditional "$1" was never defined.
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999-2012 Free Software Foundation, Inc.
#
# This file 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.
# serial 17
# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# will think it sees a *use*, and therefore will trigger all it's
# C support machinery. Also note that it means that autoscan, seeing
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
# We try a few techniques and use that to set a single cache variable.
#
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
# dependency, and given that the user is not expected to run this macro,
# just rely on AC_PROG_CC.
AC_DEFUN([_AM_DEPENDENCIES],
[AC_REQUIRE([AM_SET_DEPDIR])dnl
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
AC_REQUIRE([AM_DEP_TRACK])dnl
m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
[$1], [CXX], [depcc="$CXX" am_compiler_list=],
[$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
[$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
[$1], [UPC], [depcc="$UPC" am_compiler_list=],
[$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
[depcc="$$1" am_compiler_list=])
AC_CACHE_CHECK([dependency style of $depcc],
[am_cv_$1_dependencies_compiler_type],
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named 'D' -- because '-MD' means "put the output
# in D".
rm -rf conftest.dir
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
# We will build objects and dependencies in a subdirectory because
# it helps to detect inapplicable dependency modes. For instance
# both Tru64's cc and ICC support -MD to output dependencies as a
# side effect of compilation, but ICC will put the dependencies in
# the current directory while Tru64 will put them in the object
# directory.
mkdir sub
am_cv_$1_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
fi
am__universal=false
m4_case([$1], [CC],
[case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac],
[CXX],
[case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac])
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
# we should not choose a depcomp mode which is confused by this.
#
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
# Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
# Solaris 10 /bin/sh.
echo '/* dummy */' > sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
# We check with '-c' and '-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
# handle '-M -o', and we need to detect this. Also, some Intel
# versions had trouble with output in subdirs.
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
gcc)
# This depmode causes a compiler race in universal mode.
test "$am__universal" = false || continue
;;
nosideeffect)
# After this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested.
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
msvc7 | msvc7msys | msvisualcpp | msvcmsys)
# This compiler won't grok '-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
am__minus_obj=
;;
none) break ;;
esac
if depmode=$depmode \
source=sub/conftest.c object=$am__obj \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
# that says an option was ignored or not supported.
# When given -MP, icc 7.0 and 7.1 complain thusly:
# icc: Command line warning: ignoring option '-M'; no argument required
# The diagnosis changed in icc 8.0:
# icc: Command line remark: option '-MP' not supported
if (grep 'ignoring option' conftest.err ||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
am_cv_$1_dependencies_compiler_type=$depmode
break
fi
fi
done
cd ..
rm -rf conftest.dir
else
am_cv_$1_dependencies_compiler_type=none
fi
])
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
AM_CONDITIONAL([am__fastdep$1], [
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
])
# AM_SET_DEPDIR
# -------------
# Choose a directory name for dependency files.
# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
AC_DEFUN([AM_SET_DEPDIR],
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
])
# AM_DEP_TRACK
# ------------
AC_DEFUN([AM_DEP_TRACK],
[AC_ARG_ENABLE([dependency-tracking], [dnl
AS_HELP_STRING(
[--enable-dependency-tracking],
[do not reject slow dependency extractors])
AS_HELP_STRING(
[--disable-dependency-tracking],
[speeds up one-time build])])
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
am__nodep='_no'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
AC_SUBST([AMDEPBACKSLASH])dnl
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
AC_SUBST([am__nodep])dnl
_AM_SUBST_NOTMAKE([am__nodep])dnl
])
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999-2012 Free Software Foundation, Inc.
#
# This file 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.
# serial 6
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
[{
# Autoconf 2.62 quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
*\'*) eval set x "$CONFIG_FILES" ;;
*) set x $CONFIG_FILES ;;
esac
shift
for mf
do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named 'Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running 'make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
AS_MKDIR_P([$dirpart/$fdir])
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
done
}
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
# AM_OUTPUT_DEPENDENCY_COMMANDS
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
# This code is only required when automatic dependency tracking
# is enabled. FIXME. This creates each '.P' file that we will
# need in order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
# Copyright (C) 1996-2012 Free Software Foundation, Inc.
#
# This file 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.
# serial 8
# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996-2012 Free Software Foundation, Inc.
#
# This file 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.
# serial 19
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
# The call with PACKAGE and VERSION arguments is the old style
# call (pre autoconf-2.50), which is being phased out. PACKAGE
# and VERSION should now be passed to AC_INIT and removed from
# the call to AM_INIT_AUTOMAKE.
# We support both call styles for the transition. After
# the next Automake release, Autoconf can make the AC_INIT
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.62])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
if test "`cd $srcdir && pwd`" != "`pwd`"; then
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
# is not polluted with repeated "-I."
AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
# test to see if srcdir already configured
if test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
fi
# test whether we have cygpath
if test -z "$CYGPATH_W"; then
if (cygpath --version) >/dev/null 2>/dev/null; then
CYGPATH_W='cygpath -w'
else
CYGPATH_W=echo
fi
fi
AC_SUBST([CYGPATH_W])
# Define the identity of the package.
dnl Distinguish between old-style and new-style calls.
m4_ifval([$2],
[AC_DIAGNOSE([obsolete],
[$0: two- and three-arguments forms are deprecated. For more info, see:
http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation])
m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
m4_if(
m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
[ok:ok],,
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
_AM_IF_OPTION([no-define],,
[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_REQUIRE([AC_ARG_PROGRAM])dnl
AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
AM_MISSING_PROG([AUTOCONF], [autoconf])
AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
AM_MISSING_PROG([AUTOHEADER], [autoheader])
AM_MISSING_PROG([MAKEINFO], [makeinfo])
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
# For better backward compatibility. To be removed once Automake 1.9.x
# dies out for good. For more background, see:
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
[_AM_PROG_TAR([v7])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
[_AM_DEPENDENCIES([CC])],
[m4_define([AC_PROG_CC],
m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
AC_PROVIDE_IFELSE([AC_PROG_CXX],
[_AM_DEPENDENCIES([CXX])],
[m4_define([AC_PROG_CXX],
m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
[_AM_DEPENDENCIES([OBJC])],
[m4_define([AC_PROG_OBJC],
m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
dnl Support for Objective C++ was only introduced in Autoconf 2.65,
dnl but we still cater to Autoconf 2.62.
m4_ifdef([AC_PROG_OBJCXX],
[AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
[_AM_DEPENDENCIES([OBJCXX])],
[m4_define([AC_PROG_OBJCXX],
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl
])
_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
AC_CONFIG_COMMANDS_PRE(dnl
[m4_provide_if([_AM_COMPILER_EXEEXT],
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
])
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
dnl mangled by Autoconf and run in a shell conditional statement.
m4_define([_AC_COMPILER_EXEEXT],
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. The stamp files are numbered to have different names.
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
# loop where config.status creates the headers, so we can generate
# our stamp files there.
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
[# Compute $1's index in $config_headers.
_am_arg=$1
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
$_am_arg | $_am_arg:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001-2012 Free Software Foundation, Inc.
#
# This file 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.
# serial 8
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
if test x"${install_sh}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
*)
install_sh="\${SHELL} $am_aux_dir/install-sh"
esac
fi
AC_SUBST([install_sh])])
# Copyright (C) 2003-2012 Free Software Foundation, Inc.
#
# This file 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.
# serial 2
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
[rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
am__leading_dot=.
else
am__leading_dot=_
fi
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001-2012 Free Software Foundation, Inc.
#
# This file 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.
# serial 5
# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
@echo this is the am__doit target
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
AC_MSG_CHECKING([for style of include used by $am_make])
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# Ignore all kinds of additional output from 'make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=include
am__quote=
_am_result=GNU
;;
esac
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=.include
am__quote="\""
_am_result=BSD
;;
esac
fi
AC_SUBST([am__include])
AC_SUBST([am__quote])
AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997-2012 Free Software Foundation, Inc.
#
# This file 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.
# serial 7
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
[AC_REQUIRE([AM_MISSING_HAS_RUN])
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])
# AM_MISSING_HAS_RUN
# ------------------
# Define MISSING if not defined so far and test if it supports --run.
# If it does, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
if test x"${MISSING+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
*)
MISSING="\${SHELL} $am_aux_dir/missing" ;;
esac
fi
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
AC_MSG_WARN(['missing' script is too old or missing])
fi
])
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001-2012 Free Software Foundation, Inc.
#
# This file 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.
# serial 6
# _AM_MANGLE_OPTION(NAME)
# -----------------------
AC_DEFUN([_AM_MANGLE_OPTION],
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
# _AM_SET_OPTION(NAME)
# --------------------
# Set option NAME. Presently that only means defining a flag for this option.
AC_DEFUN([_AM_SET_OPTION],
[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
# _AM_SET_OPTIONS(OPTIONS)
# ------------------------
# OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS],
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
# -------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996-2012 Free Software Foundation, Inc.
#
# This file 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.
# serial 9
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
'
case `pwd` in
*[[\\\"\#\$\&\'\`$am_lf]]*)
AC_MSG_ERROR([unsafe absolute working directory name]);;
esac
case $srcdir in
*[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
esac
# Do 'set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
am_has_slept=no
for am_try in 1 2; do
echo "timestamp, slept: $am_has_slept" > conftest.file
set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
if test "$[*]" = "X"; then
# -L didn't work.
set X `ls -t "$srcdir/configure" conftest.file`
fi
if test "$[*]" != "X $srcdir/configure conftest.file" \
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
if test "$[2]" = conftest.file || test $am_try -eq 2; then
break
fi
# Just in case.
sleep 1
am_has_slept=yes
done
test "$[2]" = conftest.file
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
AC_MSG_RESULT([yes])
# If we didn't sleep, we still need to ensure time stamps of config.status and
# generated files are strictly newer.
am_sleep_pid=
if grep 'slept: no' conftest.file >/dev/null 2>&1; then
( sleep 1 ) &
am_sleep_pid=$!
fi
AC_CONFIG_COMMANDS_PRE(
[AC_MSG_CHECKING([that generated files are newer than configure])
if test -n "$am_sleep_pid"; then
# Hide warnings about reused PIDs.
wait $am_sleep_pid 2>/dev/null
fi
AC_MSG_RESULT([done])])
rm -f conftest.file
])
# Copyright (C) 2001-2012 Free Software Foundation, Inc.
#
# This file 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.
# serial 2
# AM_PROG_INSTALL_STRIP
# ---------------------
# One issue with vendor 'install' (even GNU) is that you can't
# specify the program used to strip binaries. This is especially
# annoying in cross-compiling environments, where the build's strip
# is unlikely to handle the host's binaries.
# Fortunately install-sh will honor a STRIPPROG variable, so we
# always use install-sh in "make install-strip", and initialize
# STRIPPROG with the value of the STRIP variable (set by the user).
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
# Installed binaries are usually stripped using 'strip' when the user
# run "make install-strip". However 'strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
# will honor the 'STRIP' environment variable to overrule this program.
dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006-2012 Free Software Foundation, Inc.
#
# This file 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.
# serial 3
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
# This macro is traced by Automake.
AC_DEFUN([_AM_SUBST_NOTMAKE])
# AM_SUBST_NOTMAKE(VARIABLE)
# --------------------------
# Public sister of _AM_SUBST_NOTMAKE.
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004-2012 Free Software Foundation, Inc.
#
# This file 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.
# serial 3
# _AM_PROG_TAR(FORMAT)
# --------------------
# Check how to create a tarball in format FORMAT.
# FORMAT should be one of 'v7', 'ustar', or 'pax'.
#
# Substitute a variable $(am__tar) that is a command
# writing to stdout a FORMAT-tarball containing the directory
# $tardir.
# tardir=directory && $(am__tar) > result.tar
#
# Substitute a variable $(am__untar) that extract such
# a tarball read from stdin.
# $(am__untar) < result.tar
AC_DEFUN([_AM_PROG_TAR],
[# Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AC_SUBST([AMTAR], ['$${TAR-tar}'])
m4_if([$1], [v7],
[am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
[m4_case([$1], [ustar],, [pax],,
[m4_fatal([Unknown tar format])])
AC_MSG_CHECKING([how to create a $1 tar archive])
# Loop over all known methods to create a tar archive until one works.
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
# Do not fold the above two line into one, because Tru64 sh and
# Solaris sh will not grok spaces in the rhs of '-'.
for _am_tool in $_am_tools
do
case $_am_tool in
gnutar)
for _am_tar in tar gnutar gtar;
do
AM_RUN_LOG([$_am_tar --version]) && break
done
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
am__untar="$_am_tar -xf -"
;;
plaintar)
# Must skip GNU tar: if it does not support --format= it doesn't create
# ustar tarball either.
(tar --version) >/dev/null 2>&1 && continue
am__tar='tar chf - "$$tardir"'
am__tar_='tar chf - "$tardir"'
am__untar='tar xf -'
;;
pax)
am__tar='pax -L -x $1 -w "$$tardir"'
am__tar_='pax -L -x $1 -w "$tardir"'
am__untar='pax -r'
;;
cpio)
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
am__untar='cpio -i -H $1 -d'
;;
none)
am__tar=false
am__tar_=false
am__untar=false
;;
esac
# If the value was cached, stop now. We just wanted to have am__tar
# and am__untar set.
test -n "${am_cv_prog_tar_$1}" && break
# tar/untar a dummy directory, and stop if the command works
rm -rf conftest.dir
mkdir conftest.dir
echo GrepMe > conftest.dir/file
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
rm -rf conftest.dir
if test -s conftest.tar; then
AM_RUN_LOG([$am__untar <conftest.tar])
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
fi
done
rm -rf conftest.dir
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR

87
config.h.in Normal file
View File

@ -0,0 +1,87 @@
/* config.h.in. Generated from configure.in by autoheader. */
/* Define to 1 if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the <fnmatch.h> header file. */
#undef HAVE_FNMATCH_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
#undef HAVE_NDIR_H
/* Define to 1 if you have the <regex.h> header file. */
#undef HAVE_REGEX_H
/* Define to 1 if you have the <signal.h> header file. */
#undef HAVE_SIGNAL_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdio.h> header file. */
#undef HAVE_STDIO_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_DIR_H
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_NDIR_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
/* Define to empty if `const' does not conform to ANSI C. */
#undef const

6139
configure vendored Executable file

File diff suppressed because it is too large Load Diff

42
configure.in Normal file
View File

@ -0,0 +1,42 @@
# Process this file with autoconf to produce a configure script.
AC_INIT
AC_CONFIG_SRCDIR([src/prtget.cpp])
AM_INIT_AUTOMAKE(prt-get,5.19.1)
dnl Determine default prefix
test x$prefix = "xNONE" && prefix="$ac_default_prefix"
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL
AC_PREFIX_DEFAULT(/usr)
# Checks for libraries.
# Checks for header files.
AC_HEADER_DIRENT
AC_CHECK_HEADERS(unistd.h stdio.h sys/types.h sys/stat.h fnmatch.h \
dirent.h fcntl.h signal.h regex.h)
CFLAGS="$CFLAGS $X_CFLAGS"
CXXFLAGS="$CXXFLAGS $X_CFLAGS"
LIBS="$LIBS $X_LIBS"
LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
# I hate you autotools
sysconfdir="/etc"
localstatedir="/var"
# Checks for library functions.
AM_CONFIG_HEADER(config.h)
AC_CONFIG_FILES([Makefile
src/Makefile
doc/Makefile
misc/Makefile])
AC_OUTPUT

423
depcomp Executable file
View File

@ -0,0 +1,423 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
# Copyright 1999, 2000 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# `libtool' can also be set to `yes' or `no'.
if test -z "$depfile"; then
base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'`
dir=`echo "$object" | sed 's,/.*$,/,'`
if test "$dir" = "$object"; then
dir=
fi
# FIXME: should be _deps on DOS.
depfile="$dir.deps/$base"
fi
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like `#:fec' to the end of the
# dependency line.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> $depfile
echo >> $depfile
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> $depfile
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. This file always lives in the current directory.
# Also, the AIX compiler puts `$object:' at the start of each line;
# $object doesn't have directory information.
stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
tmpdepfile="$stripped.u"
outname="$stripped.o"
if test "$libtool" = yes; then
"$@" -Wc,-M
else
"$@" -M
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
if test -f "$tmpdepfile"; then
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1="$dir.libs/$base.lo.d"
tmpdepfile2="$dir.libs/$base.d"
"$@" -Wc,-MD
else
tmpdepfile1="$dir$base.o.d"
tmpdepfile2="$dir$base.d"
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
if test -f "$tmpdepfile1"; then
tmpdepfile="$tmpdepfile1"
else
tmpdepfile="$tmpdepfile2"
fi
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a space and a tab in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'. We will use -o /dev/null later,
# however we can't do the remplacement now because
# `-o $object' might simply not be used
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
"$@" -o /dev/null $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# X makedepend
shift
cleared=no
for arg in "$@"; do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
-*)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix="`echo $object | sed 's/^.*\././'`"
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
"$@" || exit $?
IFS=" "
for arg
do
case "$arg" in
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0

View File

@ -1 +0,0 @@
install_man(['prt-cache.8', 'prt-get.8', 'prt-get.conf.5'])

View File

@ -14,7 +14,7 @@ prt\-cache is a synonym for
.B prt\-get --cache.
It's perfectly the same as calling prt\-get --cache, just shorter. See
.B man prt-get(8)
for details on how to use prt-get.
for details on how to use prt-get
.PP
Even though there are almost restrictions on using prt-cache over prt-get,
@ -38,11 +38,7 @@ ports tree),
and
.B prt-cache update
will use the version from the ports tree anyway, so there's no real
risk. On the other hand,
.B prt-cache depinst
will use the outdated cache for dependency resolution, which might be a problem
if the maintainer of your desired port has added dependencies since the last
time you generated the cache.
risk.
.PP
If you're using prt-cache, make sure to regenerate the cache by calling
@ -52,39 +48,9 @@ each time you make changes to the ports tree!
.PP
To create a cache, just invoke
.B prt-get cache.
Make sure you have the right permissions to do this.
.SH "CACHE FORMAT"
.PP
The cache is a flat-text file, typically found at /var/lib/pkg/prt-get.cache.
The first line records the cache format identifier, to prevent prt-cache from
performing an operation using an incompatible cache format. The rest of the
file consists of 13 lines per port: name, absolute path to the repository,
version, release, description, dependencies, URL, optional dependencies,
maintainer, readme, pre-install, post-install, and a blank (separator) line. If
multiple ports with the same name appear among the active collections (as
reported by \fBprt\-get dup\fP), only the first port will be listed in the
cache.
.PP
Suppose you want to create a dependency map, like the one used by the setup
program when installing from a CRUX ISO. One way to do so is to run \fBprt\-get
cache\fP, and then process the resulting file with \fBawk(1)\fP:
.B
tail -n +2 /var/lib/pkg/prt-get.cache | awk '((NR-1) % 13 < 2) { printf("%s : ",$0) } (NR %13 == 6) { gsub(/,/," ",$0); printf("%s\\n",$0) }' | awk -F: '/ \\/usr\\/ports\\/(core|opt|xorg) / { printf("%-25s : %s\\n",$1,$3) }' | tee -a setup.dependencies
.PP
A slight variation will also extract all the optional dependencies of each
port, in case you want to mimic Gentoo USE flags by editing the resulting file
and referring to it in a wrapper script, as illustrated by the ffmpeg example
in the \fBprt\-get\fP(8) man-page.
.B
tail -n +2 /var/lib/pkg/prt-get.cache | awk '((NR-1) % 13 == 0) { printf("%s : ",$0) } (NR %13 == 8) { gsub(/,/," ",$0); printf("%s\\n",$0) }' | sudo tee -a /etc/prt-get.softdeps
Make sure you have the right permissions to do this
.SH "AUTHORS"
Johannes Winkelmann <jw@tks6.net>, John McQuah <jmcquah@disroot.org>
Johannes Winkelmann <jw@tks6.net>
.SH "SEE ALSO"
prt-get(8), pkgmk(8) pkgadd(8), ports(8)

View File

@ -1,8 +1,7 @@
.\" man page for prt-get
.\" original work by Johannes Winkelmann, jw at tks6 dot net
.\" Johannes Winkelmann, jw@tks6.net
.\"
.\" extended in 2013 by Alan Mizrahi, alan at mizrahi dot com dot ve
.\" and in 2023 by John McQuah, jmcquah at disroot dot org
.\" my first man page, so forgive me for the errors :-)
.\"
.\" .PU
.TH "prt-get" "8" "" "" ""
@ -15,9 +14,9 @@ pkgutils from CRUX (see http://www.crux.nu)
.br
.SH "DESCRIPTION"
prt\-get is a package management tool which provides additional
functionality to the CRUX package management system. It works with the
functionality to crux' package management system. It works with the
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). It offers the following features:
.PP
.TP
@ -42,8 +41,8 @@ search within the ports
.PP
What prt\-get basically does is build, install/upgrade, and remove packages, using
pkgmk, pkgadd, and pkgrm. Additionally, you don't have be in the port's
What prt\-get basically does is installing and upgrading packages, using
pkgmk and pkgadd. Additionally, you don't have be in the port's
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
allows you to just install or update a package, without caring where
@ -51,24 +50,26 @@ it actually is located on your file system.
.PP
prt\-get also lets you search for ports by name,
find information about ports (without installing them of course),
or print the dependencies of a port (as a space- or newline-separated list,
or a formatted tree). Note that dependencies are no
requirement for crux packages and therefore not always accurate.
prt\-get also offers some features like searching ports by name,
showing information about ports (without installing them of course)
and can list the dependencies listed in the Pkgfile, and provide a
complete dependency list for a port. Note that dependencies are no
requirement for crux packages and therefore not always accurate. There's
a possiblity to use an external dependency map to get dependency
listings for ports which don't provide them in their Pkgfile.
.PP
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
the \fBOPTIONS\fP section below).
operation would have. Use the \-\-test switch for this (see also:
OPTIONS)
.SH "RETURN VALUE"
prt\-get returns 0 on success and a non-zero value otherwise (exact
value -> meaning mapping to be determined...)
.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
.B cvs(1).
[command] can be one of the following:
@ -76,58 +77,33 @@ non-option argument passed. This is very similar to
.TP
.B install [\-\-margs] [\-\-aargs] [\-\-log] <package1> [<package2> ...]
Install all packages in the listed order. Note that you can do this
from any directory.
install all packages in the listed order. Note that you can do this
from any directory
.TP
.B depinst [\-\-margs] [\-\-aargs] [\-\-log] [\-\-softdeps] <package1> [<package2> ...]
Install all packages given on the command line, including their dependencies.
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.
.B depinst [\-\-margs] [\-\-aargs] [\-\-log] <package1> [<package2> ...]
install all packages in the listed order including their dependencies.
Note that outdated packages won't be updated.
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
.B grpinst [\-\-margs] [\-\-aargs] [\-\-log] <package1> [<package2> ...]
install all packages in the listed order, but stop if installation of
one package fails. This can be used to install packages where package2
depends on package1
.TP
.B update [\-\-margs] [\-\-aargs] [\-\-log] <package1> [<package2> ...]
Update all packages listed in this order. Note: if the latest version of a
package has acquired dependencies that were not needed by the
currently-installed version and are not present on the system, the update
command will not attempt to resolve this omission. prt-get update behaves
this way because pkgadd invocations inherit the flag -u for every package in
the transaction, causing an error if the package is not already installed.
You can follow the CRUX mailing list or the IRC channels to stay informed of
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.
update all packages listed in this order
.TP
.B remove <package1> [<package2> ...]
Remove packages listed in this order
remove packages listed in this order
.TP
.B sysup [\-\-softdeps] [\-\-nodeps]
Update all installed packages which are outdated. Sorts by hard dependencies
by default. Passing the --softdeps switch tells \fBprt\-get\fP to also consider
optional dependencies when sorting. Passing the --nodeps switch tells prt-get
not to sort by dependencies at all, for approximately the same effect as
.B prt\-get update $(prt\-get quickdiff).
As with an \fBupdate\fP command, the child \fBpkgadd\fP processes will
inherit the \-u flag, so if a port has acquired new dependencies since
its last successful build, those new dependencies will be omitted from
the transaction (unless they happen to be installed for some other reason and
are also in need of an update). See the \fBEXAMPLES\fP section for a way to
automate the resolution of such omissions. Also see the
.B sysup [\-\-nodeps]
Update all installed packages which are outdated. Sorts by dependencies
by default. If you don't want prt-get to resolve the dependencies, use
the --nodeps switch. Also see the
.B lock
and
.B unlock
@ -157,11 +133,11 @@ also includes the description from the Pkgfile. Note that the
switch will slow down the operation remarkably.
.TP
.B diff [\-\-all] [\-\-prefer\-higher] [<package1> <package2> ...]
Show differences between installed packages and ports in the ports
.B diff [--all] [<package1> <package2> ...]
show differences between installed packages and ports in the ports
tree. If arguments are given, shows only differences for these
packages, otherwise all differences are shown. It's also possible to use
shell-like
shell like
.B wildcards
for the diff command. Make sure you escape where needed. Locked
packages are only displayed if you use the --all switch. If you want
@ -170,44 +146,38 @@ the ports tree, use the --prefer-higher option.
.TP
.B quickdiff
Print a simple list of packages which have a different version in the
ports tree than what is installed. The output is sorted alphabetically,
but you can generate a (larger) list sorted by dependencies using
.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
prints a simple list of packages which have a different version in the
ports tree than what is installed. This is meant as an input for
.B prt\-get update,
so you can update all ports on your system with one simple command. If you want
to see only diffs which have a lower version installed than the one in
the ports tree, use the --prefer-higher option.
.TP
.B search [\-v|\-vv] [\-\-path] [\-\-regex] <expr>
.B search [\-v|\-vv] [--path] [--regex]<expr>
Search the ports tree for
.B expr
in their name
.TP
.B dsearch [\-v|\-vv] [\-\-path] [\-\-regex] <expr>
Search the ports tree (both name and description) for the pattern
.B dsearch [\-v|\-vv] [--path] [--regex]<expr>
Search the ports tree for
.B expr
(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
to read every Pkgfile, which makes it rather slow. If you like searching by
description, consider using the cache functionality, so you only have to
read all the Pkgfiles after each update of the ports tree.
in both name and description. The search in the description is not case
sensitive. Note that this requires prt\-get to read every Pkgfile, which
makes it rather slow; if you like this, consider using the cache
functionality, so you only have to spend this time once after updating
the ports tree has been updated.
.TP
.B fsearch [\-\-full] [\-\-regex] <pattern>
.B fsearch [--full] [--regex] <pattern>
Search the ports tree for
.B pattern
as file name in their footprint. When called without '--full', strips
the directories from the file names before matching.
Pattern can be a shell-like wildcard pattern (e.g. prt-get fsearch "*.h")
or a regular expression (e.g. prt-get fsearch --regex 'liblz(o2|ma).*')
the directories from the file names before matching; this behaviour
will change in prt-get 0.6, where full path search will be
default. Pattern can be a shell-like wildcard pattern (e.g prt-get
fsearch "*.h") or regexps.
.TP
@ -223,149 +193,110 @@ Print the path of a port
Print the port's README file if it exists; if set, uses $PAGER
.TP
.B depends [\-\-softdeps] <package1> [<package2> ...]
Print a recursive list of dependencies needed to install the packages
passed as argument. It shows a list of the dependencies that were found in
the ports tree, plus a list of the dependencies that could not be found.
Pass the --softdeps flag if you want the sorting algorithm to consider
optional dependencies too.
.B depends <package1> [<package2> ...]
print a recursive list of dependencies to install the packages passed
as argument. It shows a list with ports which are found, plus a list
of ports which are missing
.TP
.B quickdep [\-\-softdeps] <package1> [<package2> ...]
Same output as \fBdepends\fP, but separated by spaces rather than newlines,
and 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,
or if you don't want to filter out manually the ports that are invalid
targets for installation. For example, instead of
.B prt\-get depinst xorg-server
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
which ensures that the latest version of each dependency is built.
Note: It might be useful to run
.B prt\-get depends <package1> | grep \(dq\-\- missing packages\(dq
as a first step, in order to ensure that your ports tree has everything needed
for successful builds.
.B quickdep <package1> [<package2> ...]
print a simple list of recursive dependencies for all the ports passed
as argument in a simple format to be used by
.B prt\-get install
to make an install including dependencies
.B Does not display dependencies which are not in the ports tree
.TP
.B deptree [\-\-softdeps] <package>
Print a tree of the dependencies of the package
.B <package>.
Pass the --softdeps flag to also show the installed packages that might
have been eagerly linked, if they were present when
.B <package>
(or its dependencies) were built.
Subtrees already shown are marked with '-->' to save some space. In
order to show them all, add the --all switch.
.B dependent <package>
print a list of package which depend on
.B package.
.SH ""
Usually shows dependent packages which are installed. To see all dependencies,
add the --all switch; use --recursive to get a recursive list (without
duplication), and --tree to get a nicely indented one
.TP
.B dependent [\-\-recursive] [\-\-softdeps] [\-\-all] [\-\-tree] <package>
Print a list of ports whose "Depends on:" line contains
.B <package>
(or its dependents, if --recursive was passed). Use the --softdeps flag to
also search the "Optional:" lines for \fB<package>\fP.
By default, output is restricted to ports that are installed. To see all
the dependencies, use the --all switch. Use --tree to get a nicely indented
list.
.B deptree <package>
print a tree of the dependencies of the package
.B package.
Subtrees already shown are marked with '-->' to save some space, in
order to show them all, add the --all switch
.TP
.B dup [-v] [format]
List ports which can be found in multiple directories configured in
.B /etc/prt-get.conf
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
full path and version info). The verbose switch is basically an alias for a
particular combination of the recognized format symbols, namely
.B '* %n\en %p1 %v1 precedes over\en %p2 %v2\en'.
You can customize the output by passing a different format string, whose
symbols will be replaced as follows.
Use the verbose switch to simulate the output of version 5.12 and older (likely
to go away in the future). The format string can be used to create user
specified formats. The following symbols are currently replaced:
.TP
\ \ \ \(bu
%n -> name of the port
%n \-> name of the port
.TP
\ \ \ \(bu
%p1 -> Full path (including name) to port taking precedence
%p1 \-> Full path (including name) to port taking precendence
.TP
\ \ \ \(bu
%p2 -> Full path (including name) to port being hidden
%p2 \-> Full path (including name) to port being hidden
.TP
\ \ \ \(bu
%v1 -> Version of port taking precedence
%v1 \-> Version of port taking precendence
.TP
\ \ \ \(bu
%v2 -> Version of port being hidden
%v2 \-> Version of port being hidden
.TP
\ \ \ \(bu
%M1 -> maintainer of port taking precedence
.TP
\ \ \ \(bu
%M2 -> maintainer of port being hidden
.TP
\ \ \ \(bu
%u1 -> URL of port taking precedence
.TP
\ \ \ \(bu
%u2 -> URL of port being hidden
.TP
.B list [\-v|\-vv] [\-\-path] [\-\-regex] [filter]
.B list [\-v|\-vv] [filter] [--path] [--regex]
List ports available in the ports tree. It's basically the same as
.B ports \-l
but looks in all directories specified in
.B /etc/prt\-get.conf.
It's also possible to use shell-like
It's also possible to use
shell like
.B wildcards
for the list command. Make sure you escape where needed
.TP
.B printf <format string1> [\-\-sort=<format string2>] [\-\-filter=<filter>]
Print formatted port list format string can contain variables, which
Print formated port list format string can contain variables, which
are replaced like this:
.TP
\ \ \ \(bu
%n -> name
%n \-> name
.TP
\ \ \ \(bu
%p -> path
%p \-> path
.TP
\ \ \ \(bu
%v -> version
%v \-> version
.TP
\ \ \ \(bu
%r -> release
%r \-> release
.TP
\ \ \ \(bu
%d -> description
%d \-> description
.TP
\ \ \ \(bu
%e -> dependencies
%e \-> dependencies
.TP
\ \ \ \(bu
%P -> optional dependencies
%u \-> URL
.TP
\ \ \ \(bu
%u -> URL
%P -> Packager
.TP
\ \ \ \(bu
@ -389,11 +320,11 @@ are replaced like this:
.TP
\ \ \ \(bu
%i -> "no" if not installed, "yes" if it's installed and
%i \-> "no" if not installed, "yes" if it's installed and
up to date and "diff" if it's installed and a new version is in the
ports tree.
Use "\\n" and "\\t" to format your output (no additional format symbols
Use "\\n" and "\\t" to format your output (no additional format specified
suported). The optional format string2 can contain the same variables
as format string1 and is used to sort the output. You can specify a
.B wildcard filter
@ -401,69 +332,55 @@ to filter by package name.
.TP
.B listinst [\-v|\-vv] [\-\-regex] [\-\-depsort] [filter]
.B listinst [\-v|\-vv] [filter] [--regex] [--depsort]
List installed ports. It's basically the same as
.B pkginfo \-i,
but omits version when called without verbose (-v, -vv) switch. Plus
it is notably faster in my tests. -v adds version information, -vv
but omits version when called without verbose (\-v, \-vv) switch. Plus
it is notably faster in my tests. \-v adds version information, \-vv
adds version and description.
.B Warning:
-vv will slow down the process because it requires prt-get to scan
\-vv will slow down the process because it requires prt\-get to scan
both the ports database and the ports tree.
It's also possible to use shell-like
It's also possible to use shell like
.B wildcards
for the listinst command. Make sure you escape where needed. By default
it's sorted alphabetically; use the --depsort switch to sort by
dependencies.
for the listinst command. Make sure you escape where needed. Finally, by
default it's sorted alphabetically; use the \-\-depsort switch to sort by
dependencies
.TP
.B listorphans [\-v|\-vv|\-\-softdeps]
List installed ports which do not appear in the "Depends on:" line of
any other port currently installed. Pass the --softdeps flag to also exclude
ports that are listed as optional dependencies of currently-installed ports.
Output appears alphabetically separated by newlines, making it suitable for
process substitution as shown in the
.B EXAMPLES
section below. Note that some core ports might be runtime
dependencies despite their absence in the "Depends on:" line; see \fBPkgfile(5)\fP
for an explanation of this practice.
.B listorphans [\-v|\-vv]
List installed ports which have no dependent packages
.TP
.B isinst <package1> [<package2> ...]
Check whether each package given on the command line is installed. Output in
the case of multiple arguments is separated by newlines, suitable for
processing by awk or grep. Similar to
.B pkginfo \-i|grep \-E '^(package1|package2|...)'
but does not print the version information. This command has a return value of
0 if all packages given as argument are installed, otherwise a return value
greater than 0.
.B isinst <package>
Check whether a package is installed. The same as
.B pkginfo \-i|grep ^package
.TP
.TP
.B current <package>
Show the currently-installed version of <package>, or a message
that <package> is not installed. Unlike
.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.
Prints out the version of the currently installed package
.TP
.B ls [\-\-path] <package>
List the contents of the port's directory
.B ls [--path] <package>
Prints out a listing of the port's directory
.TP
.B cat <package> [<file>]
Print the file to stdout. If <file> is not specified, 'Pkgfile' is used. If set, uses $PAGER.
Prints out the file to stdout. If <file> is not specified, 'Pkgfile' is used. If set, uses $PAGER
.TP
.B edit <package> [<file>]
.B edit <package> <file>
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
.B help
Show a help screen
Shows a help screen
.TP
.B dumpconfig
@ -471,85 +388,60 @@ Dump the configuration to the current terminal
.TP
.B version
Show the current version of prt-get
Shows the current version of prt\-get
.TP
.B cache
Create a cache file from the ports tree to be used by prt-get using the
--cache option. Remember to run prt-get cache each time you update the
ports tree.
create a cache file from the ports tree to be used by prt\-get using the
\-\-cache option. Remember to run prt\-get cache each time you update the
ports tree
.SH "OPTIONS"
The following options are primarily useful for install/update transactions.
.TP
.B \-g, \-\-group
Stop install or update operation if one package fails (patch by Alan Mizrahi)
.TP
.B \-f, \-fi
.B -f, -i
Force install; Implies 'pkgadd -f'; same as --aargs=-f
.TP
.B \-fr
.B -fr
Force rebuild, Implies 'pkgmk -f'; same as --margs=-f
.TP
.B \-um
.B -um
Update md5sum, implies 'pkgmk -um'; same as --margs=-um
.TP
.B \-im
.B -im
Ignore md5sum, implies 'pkgmk -im'; same as --margs=-im
.TP
.B \-us
.B -us
Update signature, implies 'pkgmk -us'; same as --margs=-us
.TP
.B \-is
.B -is
Ignore signature, implies 'pkgmk -is'; same as --margs=-is
.TP
.B \-uf
.B -uf
Update footprint, implies 'pkgmk -uf'; same as --margs=-uf
.TP
.B \-if
.B -if
Ignore footprint, implies 'pkgmk -if'; same as --margs=-if
.TP
.B \-ns
.B -ns
No stripping, implies 'pkgmk -ns'; same as --margs=-ns
.TP
.B \-kw
.B -kw
Keep working directory, implies 'pkgmk -kw'; same as --margs=-kw
.TP
.B \-\-margs="...", e.g. \-\-margs="\-im"
additional arguments to be passed to pkgmk;
note that \-d is already passed to pkgmk anyway
.B --ignore=<package1,package2,...>
Don't install those packages, even if they're listed as dependency
.TP
.B \-\-aargs="...", e.g. \-\-aargs="\-f"
additional arguments to be passed to pkgadd
.TP
.B \-\-rargs="..."
arguments to be passed to pkgrm; currently not used, implemented for
future uses and consistency reasons
.TP
.B \-\-ignore=<package1,package2,...>
Don't install these packages, even if they're listed as dependencies
.TP
.B \-\-softdeps
Consider optional dependencies when determining the order in which to build
the packages passed as arguments (in a \fBdepinst\fP or \fBsysup\fP operation).
Also affects the output of \fBdeptree\fP, \fBdependent\fP, and \fBlistorphans\fP.
.TP
.B \-\-cache
@ -558,7 +450,7 @@ Use cache file for this command
.TP
.B \-\-test
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 grpinst, prt\-get update, prt\-get sysup
.TP
.B \-\-pre-install
@ -572,57 +464,6 @@ Execute post-install script if it's there
.B \-\-install-scripts
Execute pre-install and post-install script if they're there
The options --pre-install, --post-install, and --install-scripts offer a
convenient way to temporarily override the prt-get.conf directive 'runscripts
no', which was the historical default. Starting with CRUX 3.7, prt-get.conf is
being shipped with 'runscripts yes'. To override this default at the command
line, you have to pass the more cumbersome option --config-set=\(dqrunscripts
no\(dq, or point prt-get to an alternative configuration file using
--config=<file>. (see below for the documentation of these options)
.TP
.B \-\-install-root=<dir>
Use <dir> as root directory for your installation; allows you to install
the requested packages onto a different directory than '/'. In daily usage,
this option is not required; it's primarily interesting if you're developing
an independent installation.
Pre- and post-install scripts will not be executed if the target root directory
lacks a copy of the ports tree. So if you're maintaining an installation on a
volume mounted somewhere other than '/', it's not enough to have the
line 'runscripts yes' in your prt-get.conf; you also have to ensure that
the pre- and post-install scripts can be found in the same location
relative to <dir>.
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
archives get unpacked, but the relevant prt-get.conf and ports tree are those
on the parent filesystem. Therefore it is not necessary for <dir> to contain
its own copy of the ports tree (unless 'runscripts yes' is desired, as
explained above). But each \fBpkgmk(8)\fP process will take place on the parent
filesystem, inspecting \fIthe parent filesystem\fP's environment for
information about installed ports and available shared libraries. The
\fBpkgmk(8)\fP process might therefore draw the wrong conclusions about what
functionality should be enabled for an installation to <dir>. If the parent
filesystem is more richly populated than <dir>, with respect to installed
packages, then the built package might exhibit breakage when \fBpkgadd\fP
unpacks it into <dir>.
When setting --install-root=<dir>, install or update commands might behave
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
the host system, append the option --aargs='-c /etc/pkgadd.conf' to your
\fBprt-get install\fP command, or just copy the desired directives into
<dir>/etc/pkgadd.conf .
.TP
.B \-\-log
Write build output to log file. Basically a convenient alias for
\fB\-\-config\-set=\(dqwritelog enabled\(dq\fP. Note that there is no similar
alias allowing you to temporarily override the one configuration directive
\(dqwritelog enabled\(dq; you have to resort to \fB\-\-config\-set=\(dqwritelog
disabled\(dq\fP if that is your intention.
.TP
.B \-\-no-std-config
Don't parse the default configuration file
@ -639,41 +480,62 @@ Append <string> to configuration
.B \-\-config-set=<string>
Set <string> in configuration, overriding configuration file
.TP
.B \-\-config=<file>
Use <file> to read configuration directives, rather than /etc/prt-get.conf.
.SH ""
The following options are primarily useful for non-install (information-seeking)
transactions, although some of them affect the behaviour of install/upgrade
transactions as well.
.TP
.B \-v, \-vv
(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.
verbose and more verbose, relevant for
.B prt\-get search, prt\-get list
verbose shows version of a port, more verbose shows version and
description (if available)
.TP
.B \-\-path
Show path info for the ports found by a search or a dependency calculation
Show path info; used in 'search', 'dsearch', 'list' and 'depends'
.TP
.B \-\-regex
Interpret filter and search pattern as regular expression
.TP
.B \-\-prefer\-higher, \-ph
Make prt-get parse the version strings and prefer the higher version,
even if the one found in the ports tree is lower. Also used during
a sysup operation.
.B \-\-margs="...", e.g. \-\-margs="\-im"
arguments to be passed to pkgmk, relevant for
.B prt\-get install, prt\-get grpinst, prt\-get update
note that \-d is already passed to pkgmk anyway
.TP
.B \-\-strict\-diff, \-sd
Override the 'preferhigher' configuration option. Equivalent to
.B \-\-config\-set=\(dqpreferhigher no\(dq
.B \-\-aargs="...", e.g. \-\-aargs="\-f"
arguments to be passed to pkgadd, relevant for
.B prt\-get install, prt\-get grpinst, prt\-get update
.TP
.B \-\-rargs="..."
arguments to be passed to pkgrm; currently not used, implemented for
future uses and consistency reasons
.TP
.B \-\-prefer-higher, -ph
Make prt-get parse the version strings and prefer the higher version,
even if the one found in the ports tree is lower. Will influence diff,
quickdiff and sysup.
.TP
.B \-\-strict-diff, -sd
Override the 'preferhigher' configuration option
.TP
.B \-\-config=<file>
Use alternative configuration file to read ports directories from
.TP
.B \-\-install-root=<dir>
Use <dir> as root directory for your installation; allows to install to
a different directory than '/'. In daily usage, this option is not
required; helpful if you're developing an independent installation.
.TP
.B \-\-log
Write build output to log file
.SH "CONFIGURATION"
.TP
@ -682,142 +544,36 @@ See man prt\-get.conf(5)
.SH "EXAMPLES"
.TP
.B prt\-get install irssi
Download, build and install irssi, with one simple command
download, build and install irssi, with one simple command
.TP
.B prt\-get install paper yasm
Install paper and yasm. Abort with an informative error message if either
package is already installed, allowing you to issue a revised command.
.B prt\-get install indent mplayer
install indent and mplayer
.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 version change in one of its dependencies, and \fBrevdep openssh\fP
indicates a broken package. :\-)
.B prt\-get update openssh
update your current version of openssh :\-)
.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
(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.
.B prt\-get info kdelibs
show info about kdelibs
.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}'
Show all the optional dependencies of ffmpeg that are not currently installed.
.B prt\-get search icq
Search all ports containing 'icq' in their name
.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}' | xargs prt\-get depinst \-\-group \-\-softdeps ffmpeg
Extension of the above. Installs ffmpeg and all its optional dependencies, in
the order that guarantees a maximal feature set. The --group flag tells
\fBprt\-get\fP to abort the operation if any port fails to build, so as not to
spend any resources on ffmpeg until all of its optional dependencies are in
place.
.B prt\-get grpinst \-\-test `prt\-get quickdep kdenetwork`
Show what would happen if you installed all packages needed for
kdenetwork (test mode). Remove \-\-test to install kdenetwork and all
it's dependencies. Remember that grpinst stops installing when one
installing of one package fails
.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
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
.B ffmpeg: x264 x265
and then the above command will perform a depinst --group operation to ensure that
at least x264 and x265 (but not necessarily any of the other optional
dependencies) are present before trying to build ffmpeg. In the absence of such
a .softdeps config, the operation reverts to the behaviour of the preceding
example (maximal feature set). Implementing Gentoo USE flags with such an
awkward one-liner might draw criticism from advocates of the KISS principle.
.TP
.B prt\-get search \-\-regex '^(m|n|p)c.*'
Return a list of all ports whose names start with "mc", "nc", or "pc"
.TP
.B prt\-get dsearch irc
Return a list of all ports having "irc" in their name or description
.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;}'
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
shells (like bash) that support process substitution
.TP
.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
and \fBpkgfoster\fP, but without the safeguard of interactivity. \fBDo not try this on a
mission-critical system.\fP
.TP
.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
that were not needed the last time you built your 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.
.TP
.B prt\-get isinst $(prt\-get quickdep $(prt\-get quickdiff)) | awk '/is installed/ {print $2}'
Same as above, but only print the dependencies that are already installed. The output of this
command is suitable for piping to \fBxargs prt\-get update\fP.
.TP
.B prt\-get isinst $(prt\-get quickdep i3) | awk '/not installed/ { print $2 }' | xargs prt\-get depinst \-\-softdeps \-\-test
(inspired by a troubleshooting session with hestia) Assemble a set of install
targets needed to build the i3 window manager; sort the list, respecting both
hard and soft dependencies; then print how the installation would proceed. The
awk filter in the middle is needed to prevent the command from failing with the
error message "already installed".
.TP
.B comm \-3 <(prt\-get printf \(dq%i:%n %v\-%r\en\(dq | grep \-v ^no | cut \-d: \-f2 | sort) <(pkginfo \-i | sort)
(inspired by a bug report from teodor) an alternative to \fBprt\-get diff\fP.
In the output, left-justified lines show the version available in the
repositories, while indented lines show the version installed. On a
reasonably up-to-date system, the two processes in the above command will
return many identical lines; these are suppressed by the -3 flag to
\fBcomm(1)\fP.
.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
(based on a feature request by samsep10l) a command you can put into a script
called by root's crontab, in order to mimic Slackware's tidy directory listings
(the main logdir only contains build logs of the latest installed packages;
other logs are moved to a separate directory). This particular command relies
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
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
.B prt\-get listinst \-\-depsort | xargs prt\-get install \-\-install\-root=/mnt
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
pkgadd.conf that you want applied to this operation, either copy it to
/mnt/etc where pkgadd will be looking for it, or pass the additional option \-\-aargs=\(dq\-c
/etc/pkgadd.conf\(dq to the install command.
.TP
.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.
(At the time of writing, this command returned at least two font ports.)
.B prt\-get update `prt\-get quickdiff`
Update all packages where a different version is in the ports tree
.SH "AUTHORS"
Johannes Winkelmann <jw@tks6.net>, and others cited inline
Johannes Winkelmann <jw@tks6.net>
.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), pkgmk(8) pkgadd(8), ports(8)

View File

@ -20,7 +20,7 @@ It might look like this:
# prt-get.conf
# root directories
prtdir /usr/ports/core
prtdir /usr/ports/base
prtdir /usr/ports/opt
prtdir /usr/ports/contrib
@ -39,11 +39,20 @@ logfile /tmp/log/%n.log
# show compact readme information
readme compact
# execute pre- and post-installs scripts (default no)
runscripts yes
# don't prefer higher versions (default no)
preferhigher yes
# use regexps for searching (default no)
useregex yes
.fi
.LP
This example configures a few values: the location where to look
for the ports, the location of the cache file, some log options, and
There are a few values to be configured: the location where to look
for the ports, the location of the cache file, some log options and
how to notify the user about README files.
If you don't specify the
@ -51,25 +60,22 @@ cache file, the default location is
.B /var/lib/pkg/prt-get.cache
.LP
Every line can contain one configuration option. The format of each line
Every line can contain one configuration option. The format of the lines
is
.B <key> <value>.
The keys that accept arbitrary strings as their value are
.B prtdir,
.B cachefile,
.B logfile,
and the
.B *command
keys (see below). Every other key must be given a value from a predetermined
set (e.g., yes|no).
The valid keys are
.B prtdir
and
.B cachefile.
The value for
.B prtdir
is a directory; the value for
is a directory, the value for
.B cachefile
is the file to be used as cache.
is a file to be used as cache
.SH Boolean keys
.nf
<portname1>:<dependency1> <dependency2>
<portname2>:<dependency1>
.B runscripts
if set to yes, execute pre- and post-install scripts
@ -82,88 +88,55 @@ influence diff, quickdiff and sysup
.B useregex
if set to yes, prt-get will interpret search and filter patterns in
list, listinst, printf, search, dsearch and fsearch as regular
expressions.
expressions. This will be the default in prt-get 0.6.
.B softdeps
if set to yes, during an update operation prt-get will perform a greedy search
of the dependency graph, visiting any \fBinstalled\fP optional dependency of
the ports specified on the command line and recursing until either a leaf
node is found (port that doesn't depend on anything else) or a cycle is
created. If a cycle is \fBnot\fP created by following a soft dependency,
then this dependency relationship is added to the list of edges, and
topological sort of the resulting graph can proceed as usual. The default is
\fBsoftdeps no\fP, which means prt-get will only consider hard dependencies
when walking the directed graph.
.SH Overriding default commands
.B makecommand,
.B addcommand,
.B removecommand,
and
.LP
.B makecommand
.B addcommand
.B removecommand
.B runscriptcommand
can be given to override the defaults ('pkgmk' for the makecommand, 'pkgadd'
for the addcommand, 'pkgrm' for the removecommand and 'sh' for the
interpreter of pre- and post-install scripts). These are expert options
which should not be used in general; when used the wrong way, they can
completely break prt-get's original functionality.
can be used to use an alternate command instead of 'pkgmk' for the
makecommand,'pkgadd' for the addcommand, 'pkgrm' for the
removecommand and 'sh' for the command which is used to run the pre- and
post-install scripts. These are expert options which shouldn't be used
in general; when used the wrong way, they can completely break prt-get's
original functionality.
.SH Keys that control logging
.LP
The log options are
.B writelog
which can be set to 'enabled' or 'disabled'
.B logmode
which can be set to 'append' or 'overwrite'
.B rmlog_on_success
which can be set to 'yes' or 'no'; when set to yes, log files of
successful builds will be removed
.B logfile
a template for the path where logs get saved. All occurences of %n in
logfile are replaced with the port name and all occurences of %p are
replaced with the port's path, e.g. for port gcc in core, %p would be
.B /usr/ports/core
and %n would be
which represent the file path. All occurances of %n in logfile are
replaced with the port name and all occurances of %p are
replaced with the port's path, e.g. for port gcc in base, %p would be
.B /usr/base
and %n
.B gcc.
This allows you to have separate log files per port.
Separate log files for each version and release can be achieved
using the placeholders %v and %r, respectively. But if you want to
enable \fBrmlog_on_uninst\fP, it is best to avoid %p, %v, and %r
when specifying \fBlogfile\fP (as explained below).
.B rmlog_on_uninst
which can be set to 'yes' or 'no'; when set to yes, uninstalling a
package 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
of installed packages, and from the active repositories. If log files exist
with different values of %p, %v, or %r than what the database and repositories
provide, then the pattern substitutions will fail to match the names of those
logs, and this feature will be a no-op. For example, suppose you specify
the logfile pattern \(dq%p/.buildlogs/%n-%v-%r.log\(dq, and you have a package
installed on your system through many versions, or after it has been
moved from opt to contrib. Uninstalling that package would leave behind all the
build logs except the latest. This pattern is also fragile with respect to
repository purges; if one of your installed ports is dropped from the official
repos, then either \(dq%p\(dq will expand to the path of your personal overlay
(you did make a copy, right?), or it will not expand at all! See the EXAMPLES
section of \fBprt\-get(8)\fP for an alternative way to tidy up your directory
of build logs.
.B readme
can be set to 'disabled', to suppress the notification after
installing a port with a README file; 'compact', to collect all the READMEs
into one post-transaction output; or 'verbose', to print separate
information about each port with a README file. See
.B prt-get(8)
and especially the readme command how to read those README files using
prt-get.
.LP
The order of the prtdir options is important: if a port is in multiple
If the readme option is set to something different than 'disabled',
prt-get will notify the user if she/he installs a port with a README
file. The option to configure this is called
.B readme
which can be set to 'verbose' (print separate information about README
files), 'compact' (integrate in result output) or 'disabled' (no information about README files). See
.B prt-get(8)
and especially the readme command how to read those README files using
prt-get
.LP
The order of the prtdir options is important, as if a port is in multiple
directories, prt-get will use the one found first (directories listed
first have precedence).
first have precedence)
.LP
If you want to restrict the ports used from one prtdir, you can
@ -171,17 +144,17 @@ append a comma separated list of ports to be used after the path,
using a colon (':') character to separate the two components
.B path:package1, package2,...
Note that this slows down prt-get a lot if you list a lot of packages.
If you become aware of speed problems due to this feature, create a separate
ports directory instead and fill it with symlinks to the ports you want.
If you become aware of speed problems due to this, create a separate
ports directory instead and use symlinks for the ports you want to use
.LP
You can write comments after a '#' character. If you have '#'
characters in your paths, there's no way to escape them (likewise there is
no way to escape ':' characters). Complain to the author if this is a
characters in you pathes, there's no way to escape them (as there is no
way to escape ':' characters). Complain to the author if this is a
problem :-)
.SH "AUTHORS"
Johannes Winkelmann <jw@tks6.net>, John McQuah <jmcquah at disroot dot org>
Johannes Winkelmann <jw@tks6.net>
.SH "SEE ALSO"
prt-get(8), pkgmk(8) pkgadd(8), ports(8)

276
install-sh Executable file
View File

@ -0,0 +1,276 @@
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd=$cpprog
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd=$stripprog
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "$0: no input file specified" >&2
exit 1
else
:
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d "$dst" ]; then
instcmd=:
chmodcmd=""
else
instcmd=$mkdirprog
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f "$src" ] || [ -d "$src" ]
then
:
else
echo "$0: $src does not exist" >&2
exit 1
fi
if [ x"$dst" = x ]
then
echo "$0: no destination specified" >&2
exit 1
else
:
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d "$dst" ]
then
dst=$dst/`basename "$src"`
else
:
fi
fi
## this sed command emulates the dirname command
dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-$defaultIFS}"
oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS=$oIFS
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp=$pathcomp$1
shift
if [ ! -d "$pathcomp" ] ;
then
$mkdirprog "$pathcomp"
else
:
fi
pathcomp=$pathcomp/
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd "$dst" &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename "$dst"`
else
dstfile=`basename "$dst" $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename "$dst"`
else
:
fi
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/#inst.$$#
rmtmp=$dstdir/#rm.$$#
# Trap to clean up temp files at exit.
trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
# Move or copy the file name to the temp name
$doit $instcmd "$src" "$dsttmp" &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&
# Now remove or move aside any old file at destination location. We try this
# two ways since rm can't unlink itself on some systems and the destination
# file might be busy for other reasons. In this case, the final cleanup
# might fail but the new file should still install successfully.
{
if [ -f "$dstdir/$dstfile" ]
then
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null ||
$doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null ||
{
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
(exit 1); exit
}
else
:
fi
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
fi &&
# The final little trick to "correctly" pass the exit status to the exit trap.
{
(exit 0); exit
}

View File

@ -1,14 +0,0 @@
project('prt-get', 'cpp',
version : '5.19.7',
default_options : ['warning_level=3', 'cpp_std=c++14'])
myconf = configuration_data()
myconf.set_quoted('VERSION', meson.project_version())
myconf.set_quoted('SYSCONFDIR','/etc')
myconf.set_quoted('LOCALSTATEDIR','/var')
configure_file(output : 'config.h',
configuration : myconf)
myconf_dir = include_directories('.')
subdir('src')
subdir('doc')

View File

@ -1,9 +0,0 @@
install_data(['prt-get.conf', 'prt-get.aliases'],
install_dir : '/etc',
install_mode : 'rw-r--r--')
install_data(['prt-get_complete','prt-get_complete_zsh'],
install_dir : get_option('prefix') / 'share',
install_mode : 'rw-r--r--',
rename : ['bash_completion/completions/prt-get',
'zsh/site-functions/_prt-get'])

View File

@ -1,3 +1,6 @@
j2sdk: j2re
lesstif: openmotif
postfix: sendmail
exim: sendmail
rust-bin: rust
qmail: sendmail
masqmail: sendmail

View File

@ -17,8 +17,7 @@ prtdir /usr/ports/opt
### log options:
# writelog enabled # (enabled|disabled)
# logmode overwrite # (append|overwrite)
# rmlog_on_success no # (yes|no)
# rmlog_on_uninst no # (yes|no)
# rm_on_success no # (yes|no)
logfile /var/log/pkgbuild/%n.log
# path, %p=path to port dir, %n=port name
# %v=version, %r=release
@ -42,6 +41,3 @@ logfile /var/log/pkgbuild/%n.log
### use regexp search
# useregex no # (yes|no)
### consider optional dependencies when sorting the update/sysup targets
# softdeps no # (yes|no)

View File

@ -1,8 +1,6 @@
# prt-get(8), prt-cache(8) completion by Johannes Winkelmann, jw@tks6.net
# problems: options ending on = should not add a space afterwards
#
# 12.03.2023: add the flag --softdeps
# 28.08.2013: use 'install --group' instead of 'grpinst' (patch by Alan)
# 07.07.2002: use prt-get listinst (from 0.3.1pre1) instead of pkginfo
# 06.07.2002: first version
@ -16,7 +14,7 @@ _prt-get()
if [ $COMP_CWORD -eq 1 ]; then
COMPREPLY=( $( compgen -W ' \
install depinst update help \
install depinst update grpinst help \
version readme list info path \
search dsearch fsearch printf cache \
dependent sysup current lock unlock \
@ -29,7 +27,7 @@ _prt-get()
if [ $COMP_CWORD '>' 1 ]; then
if [[ "$cur" != -* ]]; then
case ${COMP_WORDS[1]} in
"install" | "depinst" | "path" | "dependent" | \
"install" | "depinst" | "grpinst" | "path" | "dependent" | \
"depends" | "quickdep" | "info" | "readme" | \
"ls" | "isinst" | "deptree" )
if [ -f /var/lib/pkg/prt-get.cache ]; then
@ -67,12 +65,12 @@ _prt-get()
esac
else
case ${COMP_WORDS[1]} in
"install" | "update" | "depinst" )
"install" | "update" | "groupinst")
COMPREPLY=( $( compgen -W '--config= --cache \
--pre-install \
--post-install \
--install-scripts \
--log --test --group \
--log --test \
--config \
--config-append= \
--config-prepend= \
@ -80,15 +78,7 @@ _prt-get()
--aargs= --margs= \
--rargs= \
--install-root=' \
-- $cur ) )
;;
"depends" | "quickdep" | "deptree" | "listorphans" )
COMPREPLY=( $( compgen -W '--softdeps' -- $cur ) )
;;
"dependent" )
COMPREPLY=( $( compgen -W '--softdeps \
--recursive \
--tree' -- $cur ) )
-- $cur ) )
;;
"list" | "search" | "dsearch" )
COMPREPLY=( $( compgen -W '-v -vv --cache \

View File

@ -1,300 +0,0 @@
#compdef prt-get prt-cache
_commands=(
help:'show this help'
version:'show the current version'
list:'show a list of available ports'
printf:'print formatted list of available ports'
listinst:'show a list of installed ports'
listorphans:'list of ports with no packages depending on them'
info:'show info about a port'
path:'show path of a port'
readme:'show a port'"'"'s readme file (if it exists)'
dup:'find duplicate ports'
isinst:'print whether ports are installed'
current:'print installed version of port'
diff:'list outdated packages (or check args for change)'
quickdiff:'same as diff but simple format'
depends:'show dependencies for these ports'
quickdep:'same as depends but simple format'
deptree:'show dependencies tree for <port>'
dependent:'show installed packages which depend on '"'"'port'"'"''
search:'show port names containing '"'"'expr'"'"''
dsearch:'show ports containing '"'"'expr'"'"' in the name or description'
fsearch:'show file names in footprints matching '"'"'pattern'"'"''
install:'install ports'
update:'update ports'
depinst:'install ports and their dependencies'
remove:'remove ports'
sysup:'update all outdated ports'
lock:'lock current version of packages'
unlock:'unlock packages'
listlocked:'list locked packages'
ls:'print a listing of the port'"'"'s directory'
cat:'print out '"'"'port/file'"'"''
edit:'edit '"'"'port/file'"'"''
)
# Options Information
_infooptions=(
"--depsort[Sort by dependencies]"
)
# Options for Differences / Check for updates
_diffoptions=(
"--all[display locked ports too]"
"--prefer-higher[prefer higher installed versions over lower ports]"
"--strict-diff[override prefer higher configuration setting]"
)
# Options for Dependencies
_depoptions=(
"--all[list all dependent packages, not only installed]"
"--recursive[print recursive listing]"
"--tree[print recursive tree listing]"
"--softdeps[consider optional dependencies too]"
)
# Options for Install, Update and Removal
_installoptions=(
"-f[force installation]"
"-fi[force installation]"
"-fr[force rebuild]"
"-uf[update footprint]"
"-if[ignore footprint]"
"-um[update md5sum]"
"-im[ignore md5sum]"
"-us[update signature]"
"-is[ignore signature]"
"--margs=[pass 'string' to pkgmk]"
"--aargs=[pass 'string' to pkgadd]"
"--rargs=[pass 'string' to pkgrm]"
"--group[stop if any package fails to build]"
"--test[test mode]"
"--log[write log file]"
"--ignore=[Don't install/update those packages]:ignored packages:_allports"
"--pre-install[execute pre-install script]"
"--post-install[execute post-install script]"
"--install-scripts[execute pre-install and post-install script]"
)
# Options for System Update
_sysupoptions=(
"--nodeps[don't sort by dependencies]"
"--softdeps[consider optional dependencies when sorting]"
"--group[stop if any package fails to build]"
"--test[test mode]"
"--log[write log file]"
"--prefer-higher[prefer higher installed versions over lower ones in ports tree]"
"--strict-diff[override prefer higher configuration setting]"
)
_printfoptions=(
'%n[name]'
'%p[path]'
'%v[version]'
'%r[release]'
'%d[description]'
'%e[dependencies]'
'%P[optional dependencies]'
'%u[URL]'
'%M[Maintainer]'
'%R[Readme]'
'%E[pre-install script]'
'%O[post-install script]'
'%l[is locked]'
'%i[installed]'
)
# Options for General Options
_options=(
"-v[Show version in listing]"
"-vv[Show version and decription in listing]"
"--path[Print path to port if appropriate (search, list, depends)]"
"--cache[Use a cache file]"
"--config=[Use alternative configuration file]:file:_files"
"--install-root=[Use alternative install root directory]:directory:_directories"
"--no-std-config[Don't parse default configuration file]"
"--config-prepend=[Prepend '..' to configuration]:directory:_directories"
"--config-append=[Append '..' to configuration]:directory:_directories"
"--config-set=[Set configuration data '..', overriding config file]:data"
)
# Port list generators
_allports() {
local -a list
list=(${(f)"$(prt-get list 2>/dev/null)"})
_describe 'ports' list
}
_installedports() {
local -a list
list=(${(f)"$(prt-get listinst 2>/dev/null)"})
_describe 'installedports' list
}
_notinstalledports() {
local -a installed_ports all_ports not_installed_ports
installed_ports=(${(f)"$(prt-cache listinst 2>/dev/null)"})
all_ports=(${(f)"$(prt-cache list 2>/dev/null)"})
not_installed_ports=(${all_ports:|installed_ports})
_describe 'notinstalledports' not_installed_ports
}
_lockedports() {
local -a list
list=(${(f)"$(prt-cache listlocked 2>/dev/null)"})
_describe 'lockedports' list
}
_unlockedports() {
local -a installed locked list
installed=("${(f)$(prt-cache listinst)}")
locked=("${(f)$(prt-cache listlocked)}")
list=("${(f)$(echo ${installed[@]} ${locked[@]} | tr ' ' '\n' | sort | uniq -u)}")
_describe 'unlockedports' list
}
_outdatedports() {
local -a list
list=(${(f)"$(prt-cache quickdiff | tr ' ' '\n' | sort)"})
_describe 'outdatedports' list
}
# TODO: print files from <port> that exist inside the directory
# valid file for cat and edit
_validfiles() {
local -a list
list=(
"Pkgfile"
".signature"
".footprint"
"README"
"README.md"
)
_describe 'validfiles' list
}
# Main completion function
_arguments \
"${_options[@]}" \
":command:->command" \
"*::options:->options"
# Command completion
case $state in
command)
_describe 'commands' _commands
;;
options)
case $words[1] in
help | version | listorphans)
# No options for help | version command
;;
list)
_description list list '<filter>, e.g. *xorg*'
;;
listinst)
# TODO [<filter>]
_arguments -C \
"${_infooptions[@]}"
;;
printf)
# TODO <format>
# TODO [--sort=<format string2>] [--filter=<filter>]
local msg=(
'format string'
'[--sort=format_string2] [--filter=filter_string]'
''
'Supported format specifiers:'
'%n - name'
'%p - path'
'%v - version'
'%r - release'
'%d - description'
'%e - dependencies'
'%P - optional dependencies'
'%u - URL'
'%M - Maintainer'
'%R - Readme (yes/no)'
'%E - pre-install script (yes/no)'
'%O - post-install script (yes/no)'
'%l - is locked (yes/no)'
'%i - installed (no/yes/diff)'
)
;;
info | path | readme | ls)
_arguments \
":port:_allports"
;;
current)
_arguments -S \
":installedports:_installedports"
;;
cat | edit)
_arguments -C \
":port:_allports" \
":validfiles:_validfiles" \
;;
diff)
_arguments -S \
"*:outdatedports:_outdatedports" \
"${_diffoptions[@]}"
;;
quickdiff)
# No Options for quickdiff
;;
depends | quickdep | isinst)
_arguments -S \
":port:_allports" \
;;
dependent)
_arguments \
":port:_allports" \
"${_depoptions[@]}"
;;
deptree)
_arguments \
":port:_allports"
;;
dup | listlocked)
# No arguments for dup and listlocked commands
;;
search | dsearch)
# TODO <expr>
;;
fsearch)
# TODO <pattern>
;;
update | remove)
# TODO: highlight ports that have an update available?
# TODO: this completes only outdated once, if available,
# then show installedports..
_arguments -S \
":outdatedports:_outdatedports" \
"*:installedports:_installedports" \
"${_installoptions[@]}"
;;
install | depinst)
_arguments -S \
"*:notinstalledports:_notinstalledports" \
"${_installoptions[@]}"
;;
sysup)
_arguments -S \
"${_sysupoptions[@]}"
;;
lock)
_arguments -S \
"*:unlockedports:_unlockedports"
;;
unlock)
_arguments -S \
"*:lockedports:_lockedports"
;;
*)
;;
esac
;;
esac

336
missing Executable file
View File

@ -0,0 +1,336 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
# Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
case "$1" in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case "$1" in
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing 0.4 - GNU automake"
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
aclocal*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case "$f" in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is needed, and you do not seem to have it handy on your
system. You might have modified some files without having the
proper tools for further handling them.
You can get \`$1Help2man' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if [ ! -f y.tab.h ]; then
echo >y.tab.h
fi
if [ ! -f y.tab.c ]; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex|flex)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if [ ! -f lex.yy.c ]; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
fi
if [ -f "$file" ]; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit 1
fi
;;
makeinfo)
if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
# We have makeinfo, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
fi
touch $file
;;
tar)
shift
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
fi
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
case "$firstarg" in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case "$firstarg" in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and you do not seem to have it handy on your
system. You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequirements for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0

111
mkinstalldirs Executable file
View File

@ -0,0 +1,111 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
errstatus=0
dirmode=""
usage="\
Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
# process command line arguments
while test $# -gt 0 ; do
case $1 in
-h | --help | --h*) # -h for help
echo "$usage" 1>&2
exit 0
;;
-m) # -m PERM arg
shift
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
dirmode=$1
shift
;;
--) # stop option processing
shift
break
;;
-*) # unknown option
echo "$usage" 1>&2
exit 1
;;
*) # first non-opt arg
break
;;
esac
done
for file
do
if test -d "$file"; then
shift
else
break
fi
done
case $# in
0) exit 0 ;;
esac
case $dirmode in
'')
if mkdir -p -- . 2>/dev/null; then
echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
fi
;;
*)
if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
echo "mkdir -m $dirmode -p -- $*"
exec mkdir -m "$dirmode" -p -- "$@"
fi
;;
esac
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case $pathcomp in
-*) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
else
if test ! -z "$dirmode"; then
echo "chmod $dirmode $pathcomp"
lasterr=""
chmod "$dirmode" "$pathcomp" || lasterr=$?
if test ! -z "$lasterr"; then
errstatus=$lasterr
fi
fi
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# End:
# mkinstalldirs ends here

View File

@ -20,41 +20,35 @@ using namespace std;
*/
ArgParser::ArgParser( int argc, char** argv )
: m_isCommandGiven( false ),
m_isForced( false ),
m_isTest( false ),
m_isAlternateConfigGiven( false ),
m_useCache( false ),
m_calledAsPrtCache( false ),
m_alternateConfigFile( "" ),
m_pkgmkArgs( "" ),
m_pkgaddArgs( "" ),
m_pkgrmArgs( "" ),
m_installRoot( "" ),
m_ignore( "" ),
m_argc( argc ),
m_argv( argv ),
m_verbose( 0 ),
m_writeLog( false ),
m_hasFilter( false ),
m_noStdConfig( false ),
m_writeLog( false ),
m_nodeps( false ),
m_softdeps( false ),
m_all( false ),
m_printPath( false ),
m_execPreInstall( false ),
m_execPostInstall( false ),
m_preferHigher( false ),
m_strictDiff( false ),
m_group( false ),
m_useRegex(false),
m_fullPath(false),
m_recursive(false),
m_printTree(false),
m_depSort(false),
m_alternateConfigFile( "" ),
m_pkgmkArgs( "" ),
m_pkgaddArgs( "" ),
m_pkgrmArgs( "" ),
m_sortArgs( "" ),
m_filter( "" ),
m_commandName( "" ),
m_unknownOption( "" ),
m_installRoot( "" ),
m_ignore( "" ),
m_commandType(HELP),
m_argc( argc ),
m_argv( argv ),
m_verbose( 0 )
m_depSort(false)
{
}
@ -128,12 +122,13 @@ const string& ArgParser::alternateConfigFile() const
*/
bool ArgParser::parse()
{
const int commandCount = 34;
const int commandCount = 35;
string commands[commandCount] = { "list", "search", "dsearch",
"info", "version", "cache",
"info",
"depends", "install", "depinst",
"help", "isinst", "dup", "update",
"quickdep", "diff", "quickdiff",
"grpinst", "version", "cache",
"path", "listinst", "printf", "readme",
"dependent", "sysup", "current",
"fsearch", "lock", "unlock",
@ -142,10 +137,10 @@ bool ArgParser::parse()
"listorphans" };
Type commandID[commandCount] = { LIST, SEARCH, DSEARCH, INFO,
SHOW_VERSION, CREATE_CACHE,
DEPENDS, INSTALL, DEPINST,
HELP, ISINST, DUP, UPDATE,
QUICKDEP, DIFF, QUICKDIFF,
GRPINST, SHOW_VERSION, CREATE_CACHE,
PATH, LISTINST, PRINTF, README,
DEPENDENT, SYSUP, CURRENT,
FSEARCH, LOCK, UNLOCK, LISTLOCKED,
@ -174,14 +169,14 @@ bool ArgParser::parse()
m_verbose += 1;
} else if ( s == "-vv" ) {
m_verbose += 2;
} else if ( s == "--force" ) {
m_isForced = true;
} else if ( s == "--test" ) {
m_isTest = true;
} else if ( s == "--cache" ) {
m_useCache = true;
} else if ( s == "--nodeps" ) {
m_nodeps = true;
} else if ( s == "--softdeps" ) {
m_softdeps = true;
} else if ( s == "--all" ) {
m_all = true;
} else if ( s == "--path" ) {
@ -201,8 +196,6 @@ bool ArgParser::parse()
m_preferHigher = true;
} else if ( s == "--strict-diff" || s == "-sd" ) {
m_strictDiff = true;
} else if ( s == "--group" || s == "-g" ) {
m_group = true;
} else if ( s == "--regex" ) {
m_useRegex = true;
} else if ( s == "--full" ) {
@ -213,6 +206,7 @@ bool ArgParser::parse()
m_printTree = true;
} else if ( s == "--depsort" ) {
m_depSort = true;
} else if ( s == "-f" ) {
m_pkgaddArgs += " " + s;
} else if ( s == "-fr" ) {
@ -272,19 +266,11 @@ bool ArgParser::parse()
if (!m_isCommandGiven) {
string s = m_argv[i];
m_commandName = s;
if ( s == "grpinst" ) {
m_isCommandGiven = true;
m_commandType = commandID[7];
m_group = true;
cout << "Warning: grpinst is obsolescent";
cout << "; using install --group" << endl;
} else {
for ( int i = 0; i < commandCount; ++i ) {
if ( s == commands[i] ) {
m_isCommandGiven = true;
m_commandType = commandID[i];
break;
}
for ( int i = 0; i < commandCount; ++i ) {
if ( s == commands[i] ) {
m_isCommandGiven = true;
m_commandType = commandID[i];
break;
}
}
// first argument must be command
@ -303,6 +289,15 @@ bool ArgParser::parse()
}
/*!
\return true whether --force has been specified
*/
bool ArgParser::isForced() const
{
return m_isForced;
}
/*!
\return true whether --test has been specified
*/
@ -388,14 +383,6 @@ bool ArgParser::nodeps() const
return m_nodeps;
}
/*!
\return whether there was a --softdeps argument
*/
bool ArgParser::followSoftdeps() const
{
return m_softdeps;
}
/*!
\return whether there was a --all argument
*/
@ -470,11 +457,6 @@ bool ArgParser::strictDiff() const
return m_strictDiff;
}
bool ArgParser::group() const
{
return m_group;
}
bool ArgParser::useRegex() const
{
return m_useRegex;

View File

@ -14,7 +14,6 @@
#include <list>
#include <string>
#include <iostream>
using namespace std;
/*!
@ -33,7 +32,7 @@ public:
/*! Command type */
enum Type { HELP, LIST, SEARCH, DSEARCH, INSTALL, DEPINST,
INFO, DEPENDS, ISINST, DUP, UPDATE,
QUICKDEP, DIFF,
QUICKDEP, DIFF, GRPINST, GRPUPDATE,
QUICKDIFF, SHOW_VERSION, CREATE_CACHE, PATH,
LISTINST, PRINTF, README, DEPENDENT, SYSUP,
CURRENT, FSEARCH, LOCK, UNLOCK, LISTLOCKED,
@ -41,6 +40,7 @@ public:
DEPTREE, DUMPCONFIG, LISTORPHANS };
bool isCommandGiven() const;
bool isForced() const;
bool isTest() const;
bool isAlternateConfigGiven() const;
bool useCache() const;
@ -55,13 +55,11 @@ public:
bool execPostInstall() const;
bool preferHigher() const;
bool strictDiff() const;
bool group() const;
bool useRegex() const;
bool fullPath() const;
bool recursive() const;
bool printTree() const;
bool depSort() const;
bool followSoftdeps() const;
const string& alternateConfigFile() const;
const string& pkgmkArgs() const;
@ -90,6 +88,7 @@ public:
private:
bool m_isCommandGiven;
bool m_isForced;
bool m_isTest;
bool m_isAlternateConfigGiven;
bool m_useCache;
@ -100,7 +99,6 @@ private:
bool m_writeLog;
bool m_nodeps;
bool m_softdeps;
bool m_all;
bool m_printPath;
@ -109,7 +107,6 @@ private:
bool m_execPostInstall;
bool m_preferHigher;
bool m_strictDiff;
bool m_group;
bool m_useRegex;
bool m_fullPath;

View File

@ -24,18 +24,15 @@ Configuration::Configuration( const std::string& configFile,
const ArgParser* parser )
: m_configFile( configFile ),
m_parser( parser ),
m_cacheFile( "" ),
m_rootList(),
m_logFilePattern( "" ),
m_writeLog( false ),
m_appendLog( false ),
m_removeLogOnSuccess( false ),
m_removeLogOnUninst( false ),
m_logFilePattern( "" ),
m_cacheFile( "" ),
m_readmeMode( VERBOSE_README ),
m_runScripts( false ),
m_preferHigher( false ),
m_useRegex( false ),
m_followSoftdeps( false ),
m_makeCommand( "" ), m_addCommand( "" ),
m_removeCommand( "" ), m_runscriptCommand( "" )
{
@ -85,11 +82,6 @@ bool Configuration::removeLogOnSuccess() const
return m_removeLogOnSuccess;
}
bool Configuration::removeLogOnUninst() const
{
return m_removeLogOnUninst;
}
string Configuration::logFilePattern() const
{
return m_logFilePattern;
@ -159,9 +151,7 @@ void Configuration::parseLine(const string& line, bool prepend)
// it's already set to false, so we can just enable it.
// like this, the command line switch works as well
m_writeLog = true;
} else if ( s == "disabled" ) {
m_writeLog = false;
}
}
} else if ( startsWithNoCase( s, "logfile" ) ) {
s = stripWhiteSpace( s.replace( 0, 7, "" ) );
m_logFilePattern = s;
@ -174,16 +164,7 @@ void Configuration::parseLine(const string& line, bool prepend)
s = stripWhiteSpace( s.replace( 0, 16, "" ) );
if ( s == "yes" ) {
m_removeLogOnSuccess = true;
} else if ( s == "no" ) {
m_removeLogOnSuccess = false;
}
} else if ( startsWithNoCase( s, "rmlog_on_uninst" ) ) {
s = stripWhiteSpace( s.replace( 0, 15, "" ) );
if ( s == "yes" ) {
m_removeLogOnUninst = true;
} else if ( s == "no" ) {
m_removeLogOnUninst = false;
}
}
} else if ( startsWithNoCase( s, "readme" ) ) {
s = stripWhiteSpace( s.replace( 0, 6, "" ) );
if ( s == "compact" ) {
@ -195,28 +176,17 @@ void Configuration::parseLine(const string& line, bool prepend)
s = stripWhiteSpace( s.replace( 0, 10, "" ) );
if ( s == "yes" ) {
m_runScripts = true;
} else if ( s == "no" ) {
m_runScripts = false;
}
}
} else if ( startsWithNoCase( s, "preferhigher" ) ) {
s = stripWhiteSpace( s.replace( 0, 12, "" ) );
if ( s == "yes" ) {
m_preferHigher = true;
} else if ( s == "no" ) {
m_preferHigher = false;
}
}
} else if ( startsWithNoCase( s, "useregex" ) ) {
s = stripWhiteSpace( s.replace( 0, 8, "" ) );
if ( s == "yes" ) {
m_useRegex = true;
}
} else if ( startsWithNoCase( s, "softdeps" ) ) {
s = stripWhiteSpace( s.replace( 0, 8, "" ) );
if ( s == "yes" ) {
m_followSoftdeps = true;
} else if ( s == "no" ) {
m_followSoftdeps = false;
}
} else if ( startsWithNoCase( s, "makecommand" ) ) {
m_makeCommand = stripWhiteSpace( s.replace( 0, 11, "" ) );
} else if ( startsWithNoCase( s, "addcommand" ) ) {
@ -263,8 +233,4 @@ bool Configuration::useRegex() const
return m_useRegex;
}
bool Configuration::followSoftdeps() const
{
return ( m_followSoftdeps || m_parser->followSoftdeps() );
}

View File

@ -30,7 +30,6 @@ public:
bool writeLog() const;
bool appendLog() const;
bool removeLogOnSuccess() const;
bool removeLogOnUninst() const;
std::string logFilePattern() const;
const std::list< std::pair<std::string, std::string> >& rootList() const;
@ -44,7 +43,6 @@ public:
bool runScripts() const;
bool preferHigher() const;
bool useRegex() const;
bool followSoftdeps() const;
void addConfig(const std::string& line,
bool configSet,
@ -68,14 +66,12 @@ private:
bool m_writeLog;
bool m_appendLog;
bool m_removeLogOnSuccess;
bool m_removeLogOnUninst;
ReadmeMode m_readmeMode;
bool m_runScripts;
bool m_preferHigher;
bool m_useRegex;
bool m_followSoftdeps;
std::string m_makeCommand;
std::string m_addCommand;

View File

@ -51,17 +51,9 @@ InstallTransaction::InstallTransaction( const list<string>& names,
const Repository* repo,
PkgDB* pkgDB,
const Configuration* config )
: m_pkgDB( pkgDB ),
m_resolver(),
m_repo( repo ),
: m_repo( repo ),
m_pkgDB( pkgDB ),
m_depCalced( false ),
m_installedPackages(),
m_alreadyInstalledPackages(),
m_ignoredPackages(),
m_depNameList(),
m_depList(),
m_missingPackages(),
m_installErrors(),
m_config( config )
{
list<string>::const_iterator it = names.begin();
@ -81,17 +73,9 @@ InstallTransaction::InstallTransaction( const list<char*>& names,
const Repository* repo,
PkgDB* pkgDB,
const Configuration* config )
: m_pkgDB( pkgDB ),
m_resolver(),
m_repo( repo ),
: m_repo( repo ),
m_pkgDB( pkgDB ),
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();
@ -113,17 +97,9 @@ InstallTransaction::InstallTransaction( const string& name,
const Repository* repo,
PkgDB* pkgDB,
const Configuration* config )
: m_pkgDB( pkgDB ),
m_resolver(),
m_repo( repo ),
: m_repo( repo ),
m_pkgDB( pkgDB ),
m_depCalced( false ),
m_installedPackages(),
m_alreadyInstalledPackages(),
m_ignoredPackages(),
m_depNameList(),
m_depList(),
m_missingPackages(),
m_installErrors(),
m_config( config )
{
m_packages.push_back( make_pair( name, m_repo->getPackage( name ) ) );
@ -143,11 +119,12 @@ InstallTransaction::installError() const
install (commit) a transaction
\param parser the argument parser
\param update whether this is an update operation
\param group whether this is a group transaction (stops transaction on error)
\return returns an InstallResult telling whether installation worked
*/
InstallTransaction::InstallResult
InstallTransaction::install( const ArgParser* parser,
bool update )
bool update, bool group )
{
if ( m_packages.empty() ) {
return NO_PACKAGE_GIVEN;
@ -169,7 +146,7 @@ InstallTransaction::install( const ArgParser* parser,
if ( package == NULL ) {
m_missingPackages.push_back( make_pair( it->first, string("") ) );
if ( parser->group() ) {
if ( group ) {
return PACKAGE_NOT_FOUND;
}
continue;
@ -184,22 +161,10 @@ InstallTransaction::install( const ArgParser* parser,
InstallTransaction::InstallResult result;
InstallInfo info( package->hasReadme() );
if ( parser->isTest() ) {
info.preState = ( package->hasPreInstall() &&
(parser->execPreInstall() || m_config->runScripts())
) ? DEFERRED : NONEXISTENT;
info.postState = ( package->hasPostInstall() &&
(parser->execPostInstall() || m_config->runScripts())
) ? DEFERRED : NONEXISTENT;
m_installedPackages.push_back( make_pair( package->path()
+ "/" + package->name(), info));
continue;
}
if ( parser->isTest() ||
(result = installPackage( package, parser, update, info )) == SUCCESS) {
if ((result = installPackage( package, parser, update, info )) == SUCCESS) {
m_installedPackages.push_back( make_pair( package->path()
+ "/" + package->name(), info));
m_installedPackages.push_back( make_pair( package->name(), info));
} else {
// log failures are critical
@ -214,7 +179,7 @@ InstallTransaction::install( const ArgParser* parser,
}
m_installErrors.push_back( make_pair(package->name(), info) );
if ( parser->group() ) {
if ( group ) {
return PKGMK_FAILURE;
}
}
@ -317,14 +282,11 @@ InstallTransaction::installPackage( const Package* package,
if (m_config->runscriptCommand() != "") {
runscriptCommand = m_config->runscriptCommand();
}
if (parser->installRoot() != "") {
runscriptCommand = "chroot " + parser->installRoot() + runscriptCommand;
}
// -- pre-install
struct stat statData;
if ((parser->execPreInstall() || m_config->runScripts()) &&
stat((parser->installRoot() + pkgdir + "/" + "pre-install").c_str(), &statData) == 0) {
stat((pkgdir + "/" + "pre-install").c_str(), &statData) == 0) {
Process preProc( runscriptCommand,
pkgdir + "/" + "pre-install",
fdlog );
@ -432,9 +394,9 @@ InstallTransaction::installPackage( const Package* package,
} else {
// exec post install
if ((parser->execPostInstall() || m_config->runScripts() ) &&
stat((parser->installRoot() + package->path()
+ "/" + package->name() + "/" + "post-install").c_str(),
&statData) == 0) {
stat((package->path() + "/" + package->name() +
"/" + "post-install").c_str(), &statData)
== 0) {
// Work around the pkgdir variable change
Process postProc( runscriptCommand,
package->path() + "/" + package->name()+
@ -486,7 +448,7 @@ bool InstallTransaction::calculateDependencies()
for ( ; it != m_packages.end(); ++it ) {
const Package* package = it->second;
if ( package ) {
checkDependencies( false, package );
checkDependecies( package );
}
}
list<int> indexList;
@ -505,17 +467,14 @@ bool InstallTransaction::calculateDependencies()
/*!
recursive method to calculate dependencies
\param greedy (=true if any soft dependencies took us to the current node)
\param package, package for which we want to calculate dependencies
\param depends, index of the package \a package depends on (-1 for none)
\param package package for which we want to calculate dependencies
\param depends index if the package \a package depends on (-1 for none)
*/
void InstallTransaction::checkDependencies( bool greedy,
const Package* package,
void InstallTransaction::checkDependecies( const Package* package,
int depends )
{
int index = -1;
bool newPackage = true;
for ( unsigned int i = 0; i < m_depList.size(); ++i ){
if ( m_depList[i] == package->name() ) {
index = i;
@ -524,28 +483,17 @@ void InstallTransaction::checkDependencies( bool greedy,
}
}
if ( index == -1 ) {
index = m_depList.size();
if ( (!greedy) or isRequired( package->name() ) ) {
m_depList.push_back( package->name() );
}
m_depList.push_back( package->name() );
}
// did we already visit the current node when walking the tree?
// return to the caller if such a cycle is detected
for ( unsigned int i = 0; i < treeWalk.size(); ++i) {
if ( treeWalk[i] == package->name() ) {
return;
}
}
treeWalk.push_back(package->name());
if ( depends == -1 ) {
if ( depends != -1 ) {
m_resolver.addDependency( index, depends );
} else {
// this just adds index to the dependency resolver
m_resolver.addDependency( index, index );
} else {
m_resolver.addDependency( index, depends );
}
if ( newPackage ) {
@ -555,51 +503,24 @@ void InstallTransaction::checkDependencies( bool greedy,
list<string>::iterator it = deps.begin();
for ( ; it != deps.end(); ++it ) {
string dep = *it;
if ( dep.empty() ) { continue; }
const Package* p = m_repo->getPackage( dep );
if ( p ) {
checkDependencies( greedy, p, index );
} else {
m_missingPackages.
push_back( make_pair( dep, package->name() ) );
}
}
}
if ( (m_config->followSoftdeps()) and (!package->optionals().empty()) ) {
list<string> optionals;
split( package->optionals(), ',', optionals );
list<string>::iterator it = optionals.begin();
for ( ; it != optionals.end(); ++it ) {
string softdep = *it;
if ( softdep.empty() ) { continue; }
if ( isRequired(softdep) ) {
const Package* p = m_repo->getPackage( softdep );
if ( !dep.empty() ) {
string::size_type pos = dep.find_last_of( '/' );
if ( pos != string::npos && (pos+1) < dep.length() ) {
dep = dep.substr( pos + 1 );
}
const Package* p = m_repo->getPackage( dep );
if ( p ) {
checkDependencies( true, p, index );
checkDependecies( p, index );
} else {
m_missingPackages.
push_back( make_pair( softdep, package->name() ) );
push_back( make_pair( dep, package->name() ) );
}
}
}
}
}
// reset the tree traversal history
treeWalk.pop_back();
}
/*!
Method to determine whether a soft dependency should be part of the transaction
*/
bool InstallTransaction::isRequired(const string &pname) {
if ( m_pkgDB->isInstalled(pname,false) ) { return true; }
list< pair<string, const Package*> >::iterator it = m_packages.begin();
for ( ; it != m_packages.end(); ++it ) {
if ( pname == it->first ) { return true; }
}
return false;
}
/*!
This method returns a list of packages which should be installed to
@ -718,7 +639,7 @@ string InstallTransaction::getPkgmkSettingFromFile(const string& setting, const
if (p) {
fgets(line, 256, p);
value = StringHelper::stripWhiteSpace(line);
pclose(p);
fclose(p);
}
}

View File

@ -56,7 +56,9 @@ public:
SUCCESS, /*!< yeah, success */
NO_PACKAGE_GIVEN, /*!< no package give to install */
PACKAGE_NOT_FOUND, /*!< package not found */
PKGMK_EXEC_ERROR, /*!< can't execute pkgmk */
PKGMK_FAILURE, /*!< error while pkgmk */
PKGADD_EXEC_ERROR, /*!< can't execute pkgadd */
PKGDEST_ERROR, /*!< can't change to PKGDEST */
PKGADD_FAILURE, /*!< error while pkgadd */
CYCLIC_DEPEND, /*!< cyclic dependencies found */
@ -69,7 +71,6 @@ public:
enum State {
EXEC_SUCCESS,
FAILED,
DEFERRED,
NONEXISTENT
};
struct InstallInfo {
@ -84,7 +85,8 @@ public:
};
InstallResult install( const ArgParser* parser,
bool update );
bool update,
bool group );
InstallResult calcDependencies();
const list< pair<string, InstallInfo> >& installedPackages() const;
@ -101,13 +103,12 @@ public:
private:
bool calculateDependencies();
void checkDependencies( bool greedy, const Package* package, int depends=-1 );
void checkDependecies( const Package* package, int depends=-1 );
InstallResult installPackage( const Package* package,
const ArgParser* parser,
bool update,
InstallInfo& info ) const;
bool isRequired(const string &pname);
static string getPkgmkSetting(const string& setting);
static string getPkgmkSettingFromFile(const string& setting,
@ -135,7 +136,6 @@ private:
list<string> m_depNameList;
vector<string> m_depList;
vector<string> treeWalk;
// packages requested to be installed not found in the ports tree
list< pair<string, string> > m_missingPackages;

View File

@ -87,8 +87,11 @@ int main( int argc, char** argv )
prtGet.install();
break;
case ArgParser::DEPINST:
prtGet.install(false, true, true);
break;
case ArgParser::GRPINST:
prtGet.install( false, true );
break;
break;
case ArgParser::DEPENDS:
prtGet.printDepends();
break;

View File

@ -1,25 +0,0 @@
executable('prt-get',
'argparser.cpp',
'lockfile.cpp',
'process.cpp',
'pkgdb.cpp',
'installtransaction.cpp',
'package.cpp',
'versioncomparator.cpp',
'main.cpp',
'locker.cpp',
'repository.cpp',
'configuration.cpp',
'datafileparser.cpp',
'depresolver.cpp',
'pg_regex.cpp',
'stringhelper.cpp',
'prtget.cpp',
'file.cpp',
'signaldispatcher.cpp',
include_directories : myconf_dir,
install : true)
install_symlink('prt-cache',
install_dir : get_option('prefix') / 'bin',
pointing_to : 'prt-get')

View File

@ -44,7 +44,7 @@ Package::Package( const string& name,
const string& description,
const string& dependencies,
const string& url,
const string& optionals,
const string& packager,
const string& maintainer,
const string& hasReadme,
const string& hasPreInstall,
@ -53,7 +53,7 @@ Package::Package( const string& name,
{
m_data = new PackageData( name, path, version, release,
description, dependencies, url,
optionals, maintainer, hasReadme,
packager, maintainer, hasReadme,
hasPreInstall, hasPostInstall );
}
@ -110,11 +110,11 @@ const string& Package::url() const
return m_data->url;
}
/*! \return the optional dependencies of this package */
const string& Package::optionals() const
/*! \return the packager of this package */
const string& Package::packager() const
{
load();
return m_data->optionals;
return m_data->packager;
}
/*! \return the maintainer of this package */
const string& Package::maintainer() const
@ -124,7 +124,7 @@ const string& Package::maintainer() const
}
/*! \return whether or not this package has a readme file */
bool Package::hasReadme() const
const bool Package::hasReadme() const
{
load();
return m_data->hasReadme;
@ -137,12 +137,12 @@ string Package::versionReleaseString() const
return m_data->versionReleaseString;
}
bool Package::hasPreInstall() const
const bool Package::hasPreInstall() const
{
return m_data->hasPreInstall;
}
bool Package::hasPostInstall() const
const bool Package::hasPostInstall() const
{
return m_data->hasPostInstall;
}
@ -202,27 +202,40 @@ void Package::load() const
if ( startsWithNoCase( line, "desc" ) ) {
m_data->description =
stripWhiteSpace( getValue( line, ':' ) );
} else if ( startsWithNoCase( line, "pack" ) ) {
m_data->packager =
stripWhiteSpace( getValue( line, ':' ) );
} else if ( startsWithNoCase( line, "maint" ) ) {
m_data->maintainer =
stripWhiteSpace( getValue( line, ':' ) );
} else if ( startsWithNoCase( line, "url" ) ) {
m_data->url = stripWhiteSpace( getValue( line, ':' ) );
} else if ( startsWithNoCase( line, "optional" ) or
startsWithNoCase( line, "nice to have" ) ) {
string softdeps = stripWhiteSpace( getValue( line, ':' ) );
StringHelper::replaceAll( softdeps, " ", "," );
StringHelper::replaceAll( softdeps, ",,", "," );
StringHelper::replaceAll( softdeps, "(", "" );
StringHelper::replaceAll( softdeps, ")", "" );
m_data->optionals = softdeps;
} else if ( startsWithNoCase( line, "dep" ) ) {
string depends = stripWhiteSpace( getValue( line, ':' ) );
StringHelper::replaceAll( depends, " ", "," );
StringHelper::replaceAll( depends, ",,", "," );
// TODO: decide which one to use
#if 0
// remove commented out packages
list<string> deps = StringHelper::split( depends, ',' );
list<string>::iterator it = deps.begin();
for ( ; it != deps.end(); ++it ) {
if ( (*it)[0] == '#' ) {
cerr << "Commented dep: " << *it << endl;
} else {
if ( it != deps.begin() ) {
m_data->depends += ",";
}
m_data->depends += *it;
}
}
#else
m_data->depends = depends;
#endif
}
}
}
@ -252,11 +265,6 @@ void Package::setDependencies( const std::string& dependencies )
m_data->depends = dependencies;
}
void Package::setOptionals( const std::string& optionals )
{
m_data->optionals = optionals;
}
PackageData::PackageData( const string& name_,
@ -266,7 +274,7 @@ PackageData::PackageData( const string& name_,
const string& description_,
const string& dependencies_,
const string& url_,
const string& optionals_,
const string& packager_,
const string& maintainer_,
const string& hasReadme_,
const string& hasPreInstall_,
@ -278,7 +286,7 @@ PackageData::PackageData( const string& name_,
description( description_ ),
depends( dependencies_ ),
url( url_ ),
optionals( optionals_ ),
packager( packager_ ),
maintainer( maintainer_ )
{
@ -308,12 +316,16 @@ void Package::expandShellCommands(std::string& input,
for (int i = 0; i < TAG_COUNT; ++i) {
string::size_type pos, dpos = 0;
int len;
pos = 0;
while ((pos = input.find(startTag[i], pos)) != string::npos) {
len = input.length();
input = replaceAll(input,
startTag[i] + "uname -r" + endTag[i],
unameBuf.release);
if (unameBuf.release) {
input = replaceAll(input,
startTag[i] + "uname -r" + endTag[i],
unameBuf.release);
}
dpos = input.find(startTag[i] + "date");
if (dpos != string::npos) {

View File

@ -35,7 +35,7 @@ public:
const std::string& description,
const std::string& dependencies,
const std::string& url,
const std::string& optionals,
const std::string& packager,
const std::string& maintainer,
const std::string& hasReadme,
const std::string& hasPreInstall,
@ -50,16 +50,15 @@ public:
const std::string& description() const;
const std::string& dependencies() const;
const std::string& url() const;
const std::string& optionals() const;
const std::string& packager() const;
const std::string& maintainer() const;
bool hasReadme() const;
bool hasPreInstall() const;
bool hasPostInstall() const;
const bool hasReadme() const;
const bool hasPreInstall() const;
const bool hasPostInstall() const;
std::string versionReleaseString() const;
void setDependencies( const std::string& dependencies );
void setOptionals( const std::string& optionals );
private:
@ -83,7 +82,7 @@ struct PackageData
const std::string& description_="",
const std::string& dependencies_="",
const std::string& url_="",
const std::string& optionals_="",
const std::string& packager="",
const std::string& maintainer="",
const std::string& hasReadme_="",
const std::string& hasPreInstall_="",
@ -96,7 +95,7 @@ struct PackageData
std::string description;
std::string depends;
std::string url;
std::string optionals;
std::string packager;
std::string maintainer;
std::string versionReleaseString;

View File

@ -20,7 +20,6 @@ using namespace std;
#include <fnmatch.h>
#include "config.h"
#include "pkgdb.h"
#include "datafileparser.h"
#include "stringhelper.h"
@ -28,7 +27,7 @@ using namespace std;
const string PkgDB::PKGDB = "/var/lib/pkg/db";
const string PkgDB::ALIAS_STORE = SYSCONFDIR"/prt-get.aliases";
const string PkgDB::ALIAS_STORE = LOCALSTATEDIR"/lib/pkg/prt-get.aliases";
/*!
Create a PkgDB object

View File

@ -68,9 +68,9 @@ int Process::execute()
int status = 0;
if ( m_fdlog > 0 ) {
status = execLog(argv);
status = execLog(argc, argv);
} else {
status = exec(argv);
status = exec(argc, argv);
}
delete [] argv;
@ -78,7 +78,7 @@ int Process::execute()
}
int Process::execLog(char** argv)
int Process::execLog(const int argc, char** argv)
{
int status = 0;
int fdpipe[2];
@ -123,7 +123,7 @@ int Process::execLog(char** argv)
}
int Process::exec(char** argv)
int Process::exec(const int argc, char** argv)
{
int status = 0;
pid_t pid = fork();

View File

@ -32,8 +32,8 @@ public:
private:
int exec(char** argv);
int execLog(char** argv);
int exec(const int argc, char** argv);
int execLog(const int argc, char** argv);
int execShell(const char* shell);
int execShellLog(const char* shell);

View File

@ -9,7 +9,9 @@
// (at your option) any later version.
////////////////////////////////////////////////////////////////////////
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <iostream>
#include <algorithm>
@ -54,11 +56,10 @@ const string PrtGet::DEFAULT_CACHE_FILE = LOCALSTATEDIR"/lib/pkg/prt-get.cache";
PrtGet::PrtGet( const ArgParser* parser )
: m_repo( 0 ),
m_config( 0 ),
m_currentTransaction( 0 ),
m_locker(),
m_parser( parser ),
m_cacheFile( DEFAULT_CACHE_FILE ),
m_returnValue( PG_OK )
m_returnValue( PG_OK ),
m_currentTransaction( 0 )
{
if ( m_parser->wasCalledAsPrtCached() ) {
m_appName = "prt-cache";
@ -70,8 +71,7 @@ PrtGet::PrtGet( const ArgParser* parser )
m_pkgDB = new PkgDB(m_parser->installRoot());
readConfig();
m_useRegex = ( m_config->useRegex() || m_parser->useRegex() );
m_followSoftdeps = ( m_config->followSoftdeps() || m_parser->followSoftdeps() );
m_useRegex = m_config->useRegex() || m_parser->useRegex();
}
/*! destruct PrtGet object */
@ -141,7 +141,7 @@ void PrtGet::printUsage()
<< endl;
cout << "\nDEPENDENCIES" << endl;
cout << " depends <port1 port2...> calculate dependencies of the given ports"
cout << " depends <port1 port2...> show dependencies for these ports"
<< endl;
cout << " quickdep <port1 port2...> same as 'depends' but simple format"
<< endl;
@ -151,8 +151,6 @@ void PrtGet::printUsage()
<< "depend on 'port'"
<< endl;
cout << " where opt can be:" << endl;
cout << " --softdeps consider optional dependencies too"
<< endl;
cout << " --all list all dependent packages, not "
<< "only installed" << endl;
cout << " --recursive print recursive listing" << endl;
@ -169,12 +167,13 @@ void PrtGet::printUsage()
cout << "\nINSTALL, UPDATE and REMOVAL" << endl;
cout << " install [opt] <port1 port2...> install ports" << endl;
cout << " update [opt] <port1 port2...> update ports" << endl;
cout << " grpinst [opt] <port1 port2...> install ports, stop on error"
<< endl;
cout << " depinst [opt] <port1 port2...> install ports and their dependencies"
<< endl;
cout << " remove [opt] <port1 port2...> remove ports"
<< endl;
cout << " where opt can be:" << endl;
cout << " -g, --group stop if one package fails" << endl;
cout << " -f, -fi force installation" << endl;
cout << " -fr force rebuild" << endl;
cout << " -uf update footprint" << endl;
@ -205,12 +204,16 @@ void PrtGet::printUsage()
cout << " sysup [opt] update all outdated ports"
<< endl;
cout << " where opt can be:" << endl;
cout << " --nodeps don't sort by dependencies"
cout << " --nodeps don't sort by dependencies"
<< endl;
cout << " --softdeps consider optional dependencies when sorting"
cout << " --test test mode" << endl;
cout << " --log write log file"<< endl;
cout << " --prefer-higher prefer higher installed "
<< "versions over lower ones in ports tree"
<< endl;
cout << " --strict-diff override prefer higher "
<< "configuration setting"
<< endl;
cout << " --test test mode" << endl;
cout << " --log write log file"<< endl;
cout << " lock <port1 port2...> lock current version "
<< "of packages"
@ -271,7 +274,7 @@ void PrtGet::listShadowed()
if (m_parser->otherArgs().size() > 0)
format = *(m_parser->otherArgs().begin());
else if (m_parser->verbose() > 0)
format = "* %n\n %p1 %v1 precedes over \n %p2 %v2\n";
format = "* %n\n %p1 %v1 preceeds over \n %p2 %v2\n";
string output;
Package* p1;
@ -289,13 +292,8 @@ void PrtGet::listShadowed()
StringHelper::replaceAll(output, "%p2", p2->path() + "/" + p2->name());
StringHelper::replaceAll(output, "%v1", p1->versionReleaseString());
StringHelper::replaceAll(output, "%v2", p2->versionReleaseString());
StringHelper::replaceAll(output, "%M1", p1->maintainer());
StringHelper::replaceAll(output, "%M2", p2->maintainer());
StringHelper::replaceAll(output, "%u1", p1->url());
StringHelper::replaceAll(output, "%u2", p2->url());
StringHelper::replaceAll(output, "\\n", "\n");
StringHelper::replaceAll(output, "\\t", "\t");
cout << output;
}
}
@ -396,15 +394,16 @@ void PrtGet::printInfo()
if ( !p->url().empty() ) {
cout << "URL: " << p->url() << endl;
}
if ( !p->packager().empty() ) {
cout << "Packager: " << p->packager() << endl;
}
if ( !p->maintainer().empty() ) {
cout << "Maintainer: " << p->maintainer() << endl;
}
if ( !p->dependencies().empty() ) {
cout << "Dependencies: " << p->dependencies() << endl;
}
if ( !p->optionals().empty() ) {
cout << "Optional: " << p->optionals() << endl;
}
// TODO: don't hardcode file names
string filesString = "";
@ -524,8 +523,7 @@ void PrtGet::listInstalled()
{
assertMaxArgCount(1);
string arg = m_useRegex ? ".*" : "*";
string arg = "*";
if ( m_parser->otherArgs().size() == 1 ) {
arg = *(m_parser->otherArgs().begin());
}
@ -554,7 +552,7 @@ void PrtGet::listInstalled()
l.erase(mit);
InstallTransaction trans( name, m_repo, m_pkgDB, m_config );
InstallTransaction::InstallResult result __attribute__((unused)) = trans.calcDependencies();
InstallTransaction::InstallResult result = trans.calcDependencies();
const list<string>& depRef = trans.dependencies();
list<string>::const_iterator it = depRef.begin();
@ -592,47 +590,32 @@ void PrtGet::listInstalled()
/*!
install package
\param update, whether this is an update operation
\param dependencies, whether to consider dependencies
\param update whether this is an update operation
\param group whether it's a group install (stop on error)
*/
void PrtGet::install( bool update, bool dependencies )
void PrtGet::install( bool update, bool group, bool dependencies )
{
assertMinArgCount(1);
// this can be done without initRepo()
const list<char*>& args = m_parser->otherArgs();
list<string> invalidArgs;
list<char*>::const_iterator it = args.begin();
if ( update ) {
if ( args.size() == 1 ) {
for ( ; it != args.end(); ++it ) {
string s = *it;
if ( !m_pkgDB->isInstalled( s ) ) {
// can't upgrade what isn't installed
invalidArgs.push_back( s );
if ( !update && m_pkgDB->isInstalled( s ) ) {
cout << "package " << s << " is installed" << endl;
m_returnValue = PG_GENERAL_ERROR;
return;
} else if ( update && !m_pkgDB->isInstalled( s ) ) {
// can't upgrade
cout << "package " << s << " is not installed" << endl;
m_returnValue = PG_GENERAL_ERROR;
return;
}
}
} else {
for ( ; it != args.end(); ++it ) {
string s = *it;
if ( m_pkgDB->isInstalled( s ) ) {
// pkgadd will fail on these, since it won't be given the -u flag
invalidArgs.push_back( s );
}
}
}
if ( invalidArgs.size() > 0 ) {
string attemptedOp = ( update ) ? "update" : "install";
attemptedOp += " the following packages ";
attemptedOp += ( update ) ? "(not yet installed)" : "(already installed)";
cout << "cannot "<< attemptedOp <<endl;
list<string>::const_iterator it = invalidArgs.begin();
for ( ; it != invalidArgs.end(); ++it ) {
cout << *it << endl;
}
m_returnValue = PG_GENERAL_ERROR ;
return;
}
initRepo();
@ -665,16 +648,16 @@ void PrtGet::install( bool update, bool dependencies )
}
InstallTransaction transaction( deps, m_repo, m_pkgDB, m_config );
executeTransaction( transaction, update );
executeTransaction( transaction, update, group );
} else {
InstallTransaction transaction( m_parser->otherArgs(),
m_repo, m_pkgDB, m_config );
executeTransaction( transaction, update );
executeTransaction( transaction, update, group );
}
}
void PrtGet::executeTransaction( InstallTransaction& transaction,
bool update )
bool update, bool group )
{
m_currentTransaction = &transaction;
@ -689,55 +672,49 @@ void PrtGet::executeTransaction( InstallTransaction& transaction,
}
InstallTransaction::InstallResult result =
transaction.install( m_parser, update );
transaction.install( m_parser, update, group );
bool failed = false;
switch (result) {
case InstallTransaction::SUCCESS:
break;
case InstallTransaction::PACKAGE_NOT_FOUND:
cout << m_appName << ": package(s) not found" << endl;
break;
case InstallTransaction::PKGMK_FAILURE:
cout << m_appName << ": error while " << command[0] << endl;
break;
case InstallTransaction::NO_PACKAGE_GIVEN:
cout << m_appName << ": no package specified for "
<< command[0] << endl;
break;
case InstallTransaction::PKGDEST_ERROR:
cout << m_appName << ": error changing to PKGDEST directory "
<< transaction.getPkgmkPackageDir() << endl;
failed = true;
break;
case InstallTransaction::PKGADD_FAILURE:
cout << m_appName << ": error while pkgadding " << endl;
break;
case InstallTransaction::LOG_DIR_FAILURE:
cout << m_appName << ": can't create log file directory "
<< endl;
break;
case InstallTransaction::LOG_FILE_FAILURE:
cout << m_appName << ": can't create log file" << endl;
failed = true;
break;
case InstallTransaction::NO_LOG_FILE:
cout << m_appName << ": no log file specified, but logging enabled"
<< endl;
failed = true;
break;
case InstallTransaction::CANT_LOCK_LOG_FILE:
cout << m_appName
<< ": can't create lock file for the log file. "
<< "\nMaybe there's another instance of prt-get "
<< "using the same file."
<< "\nIf this is a stale log, please remove "
// TODO: file name of lock file
<< endl;
failed = true;
break;
default:
cout << m_appName << ": Unknown error " << result << endl;
failed = true;
// TODO: use switch
if ( result == InstallTransaction::PACKAGE_NOT_FOUND ) {
cout << m_appName << ": package(s) not found" << endl;
} else if ( result == InstallTransaction::PKGMK_EXEC_ERROR ) {
cout << m_appName << " couldn't excecute pkgmk "
<< "(or alternative command). "
<< "Make sure it's installed properly" << endl;
} else if ( result == InstallTransaction::PKGMK_FAILURE ) {
cout << m_appName << ": error while " << command[0] << endl;
} else if ( result == InstallTransaction::NO_PACKAGE_GIVEN ) {
cout << m_appName << ": no package specified for "
<< command[0] << endl;
} else if ( result == InstallTransaction::PKGADD_EXEC_ERROR ) {
cout << m_appName << " couldn't excecute pkgadd. "
<< "Make sure it's installed properly" << endl;
} else if ( result == InstallTransaction::PKGDEST_ERROR ) {
cout << m_appName << ": error changing to PKGDEST directory "
<< transaction.getPkgmkPackageDir() << endl;
failed = true;
} else if ( result == InstallTransaction::PKGADD_FAILURE ) {
cout << m_appName << ": error while pkgadding " << endl;
} else if ( result == InstallTransaction::LOG_DIR_FAILURE ) {
cout << m_appName << ": can't create log file directory " << endl;
} else if ( result == InstallTransaction::LOG_FILE_FAILURE ) {
cout << m_appName << ": can't create log file" << endl;
failed = true;
} else if ( result == InstallTransaction::NO_LOG_FILE ) {
cout << m_appName << ": no log file specified, but logging enabled"
<< endl;
failed = true;
} else if ( result == InstallTransaction::CANT_LOCK_LOG_FILE ) {
cout << m_appName << ": can't create lock file for the log file. "
<< "\nMaybe there's another instance of prt-get using the same "
<< "file."
<< "\nIf this is a stale not, please remove "
// TODO: file name of lock file
<< endl;
failed = true;
} else if ( result != InstallTransaction::SUCCESS ) {
cout << m_appName << ": Unknown error " << result << endl;
failed = true;
}
if ( !failed ) {
@ -786,11 +763,7 @@ void PrtGet::printDepends( bool simpleListing )
}
} else {
if ( deps.size() > 0 ) {
cout << "-- dependency list for the requested ports (";
if ( m_followSoftdeps ) {
cout << "including optionals, ";
}
cout << "[i] = installed)" << endl;
cout << "-- dependencies ([i] = installed)" << endl;
list<string>::const_iterator it = deps.begin();
bool isAlias;
@ -898,19 +871,20 @@ void PrtGet::printFormattedDiffLine(const string& name,
const string& versionPortsTree,
bool isLocked)
{
unsigned int minWidth=20;
cout.setf( ios::left, ios::adjustfield );
cout.width( minWidth );
cout.width( 20 );
cout.fill( ' ' );
( name.size() < minWidth ) ? cout << name : cout << name + " ";
cout << name;
cout.width( minWidth );
cout.width( 20 );
cout.fill( ' ' );
( versionInstalled.size() < minWidth ) ? cout << versionInstalled :
cout << versionInstalled + " ";
cout << versionInstalled;
string locked = ( isLocked ) ? "locked" : "";
cout.width( minWidth );
string locked = "";
if ( isLocked ) {
locked = "locked";
}
cout.width( 20 );
cout.fill( ' ' );
cout << versionPortsTree << locked << endl;
}
@ -949,7 +923,7 @@ void PrtGet::printDiff()
const map<string, string>& installed = m_pkgDB->installedPackages();
map<string, string>::const_iterator it = installed.begin();
const Package* p = 0;
size_t count = 0;
int count = 0;
COMP_RESULT result;
for ( ; it != installed.end(); ++it ) {
@ -1120,13 +1094,15 @@ void PrtGet::evaluateResult( InstallTransaction& transaction,
bool atLeastOnePackageHasReadme = false;
for ( ; iit != inst.end(); ++iit ) {
size_t pos = (iit->first).find_last_of('/');
if ( m_parser->printPath() || (pos == string::npos)
|| (pos+2 > (iit->first).length()) ) {
cout << iit->first;
} else {
cout << (iit->first).substr(pos+1);
if (m_parser->printPath()) {
// TODO: avoid lookup by tuning
// InstallTransaction::installedPackages()
const Package* p = m_repo->getPackage(iit->first);
if (p) {
cout << p->path() << "/";
}
}
cout << iit->first;
if ( iit->second.hasReadme ) {
if ( m_config->readmeMode() ==
Configuration::COMPACT_README ) {
@ -1182,19 +1158,20 @@ void PrtGet::evaluateResult( InstallTransaction& transaction,
void PrtGet::reportPrePost(const InstallTransaction::InstallInfo& info) {
if (info.preState != InstallTransaction::NONEXISTENT) {
string preString = (info.preState == InstallTransaction::FAILED) ? "failed" : "ok";
if (info.preState == InstallTransaction::DEFERRED){
preString = "deferred";
string preString = "failed";
if (info.preState == InstallTransaction::EXEC_SUCCESS) {
preString = "ok";
}
cout << " [pre: " << preString << "]";
}
if ( info.postState != InstallTransaction::NONEXISTENT) {
string postString = (info.postState == InstallTransaction::FAILED) ? "failed" : "ok";
if (info.postState == InstallTransaction::DEFERRED){
postString = "deferred";
string postString = "failed";
if (info.postState == InstallTransaction::EXEC_SUCCESS){
postString = "ok";
}
cout << " [post: " << postString << "]";
}
}
/*! create a cache */
@ -1263,7 +1240,7 @@ void PrtGet::printf()
assertExactArgCount(1);
initRepo();
string filter = m_useRegex ? ".*" : "*";
string filter = m_parser->useRegex() ? "." : "*";
if ( m_parser->hasFilter() ) {
filter = m_parser->filter();
}
@ -1289,7 +1266,7 @@ void PrtGet::printf()
StringHelper::replaceAll( output, "%r", p->release() );
StringHelper::replaceAll( output, "%d", p->description() );
StringHelper::replaceAll( output, "%e", p->dependencies() );
StringHelper::replaceAll( output, "%P", p->optionals() );
StringHelper::replaceAll( output, "%P", p->packager() );
StringHelper::replaceAll( output, "%M", p->maintainer() );
StringHelper::replaceAll( output, "\\t", "\t" );
@ -1302,7 +1279,7 @@ void PrtGet::printf()
StringHelper::replaceAll( sortkey, "%r", p->release() );
StringHelper::replaceAll( sortkey, "%d", p->description() );
StringHelper::replaceAll( sortkey, "%e", p->dependencies() );
StringHelper::replaceAll( sortkey, "%P", p->optionals() );
StringHelper::replaceAll( sortkey, "%P", p->packager() );
StringHelper::replaceAll( sortkey, "%M", p->maintainer() );
string isInst = "no";
@ -1392,7 +1369,6 @@ void PrtGet::printDependent()
initRepo();
string arg = *(m_parser->otherArgs().begin());
vector<string> treeWalk;
if (m_parser->printTree()) {
cout << arg << endl;
@ -1407,14 +1383,6 @@ void PrtGet::printDependent(const string& dep, int level)
map<string, Package*>::const_iterator it = m_repo->packages().begin();
static map<string, bool> shownMap;
/* cycle detection --- code duplicated from checkDependencies */
for ( unsigned int i=0; i != treeWalk.size() ; ++i ) {
if ( treeWalk[i] == dep ) {
return;
}
}
treeWalk.push_back(dep);
set<const Package*> dependent;
for ( ; it != m_repo->packages().end(); ++it ) {
@ -1430,18 +1398,6 @@ void PrtGet::printDependent(const string& dep, int level)
dependent.insert( p );
}
}
if ( p && m_followSoftdeps &&
( m_parser->all() || m_pkgDB->isInstalled( p->name() ) )
&& p->optionals().find( dep ) != string::npos ) {
list<string> tokens;
StringHelper::split( p->optionals(), ',', tokens );
list<string>::iterator it = find( tokens.begin(),
tokens.end(),
dep );
if ( it != tokens.end() ) {
dependent.insert( p );
}
}
}
// - there are two modes, tree and non-tree recursive mode; in
@ -1488,8 +1444,6 @@ void PrtGet::printDependent(const string& dep, int level)
}
}
}
treeWalk.pop_back();
}
void PrtGet::listOrphans()
@ -1508,15 +1462,6 @@ void PrtGet::listOrphans()
for (; lit != tokens.end(); ++lit) {
required[*lit] = true;
}
if (m_followSoftdeps) {
StringHelper::split( p->optionals(), ',', tokens );
lit = tokens.begin();
for (; lit != tokens.end(); ++lit) {
if ( m_pkgDB->isInstalled(*lit,false) ) {
required[*lit] = true;
}
}
}
}
}
@ -1619,7 +1564,7 @@ void PrtGet::sysup()
InstallTransaction transaction( *target,
m_repo, m_pkgDB, m_config );
executeTransaction( transaction, true );
executeTransaction( transaction, true, false );
}
@ -1671,7 +1616,7 @@ void PrtGet::current()
m_returnValue = 1;
}
SignalHandler::HandlerResult PrtGet::handleSignal()
SignalHandler::HandlerResult PrtGet::handleSignal( int signal )
{
// TODO: second argument could also be true:
// TODO: kill installtransaction
@ -1680,8 +1625,6 @@ SignalHandler::HandlerResult PrtGet::handleSignal()
if ( m_currentTransaction ) {
evaluateResult( *m_currentTransaction, false, true );
}
return EXIT;
}
/*!
@ -1859,14 +1802,9 @@ void PrtGet::ls()
if ( p ) {
string dirname = p->path() + "/" + p->name();
DIR* dir = opendir(dirname.c_str());
if (dir == NULL) {
cerr << "Directory " << dirname << " not found" << endl;
m_returnValue = PG_GENERAL_ERROR;
return;
}
struct dirent* entry;
vector<string> files;
while ((entry = readdir(dir))) {
while (entry = readdir(dir)) {
string dName = entry->d_name;
if (dName != "." && dName != "..") {
files.push_back(dName);
@ -1906,7 +1844,7 @@ void PrtGet::cat()
}
string file = p->path() + "/" + p->name() + "/" + fileName;
if (!printFile(file)) {
cerr << "File '" << fileName << "' not found" << endl;
cerr << "File '" << *it << "' not found" << endl;
m_returnValue = PG_GENERAL_ERROR;
return;
}
@ -1921,17 +1859,12 @@ void PrtGet::remove()
{
assertMinArgCount(1);
bool needRepo = false;
list<string> removed;
list<string> failed;
list<string> notInstalled;
if ( m_parser->isTest() ) {
cout << "*** " << m_appName << ": test mode" << endl;
} else if ( m_config->removeLogOnUninst()
&& m_config->logFilePattern().find("%p") != string::npos ) {
needRepo = true;
initRepo();
}
string command = InstallTransaction::PKGRM_DEFAULT_COMMAND;
@ -1943,46 +1876,20 @@ void PrtGet::remove()
list<char*>::const_iterator it = args.begin();
for ( ; it != args.end(); ++it ) {
if (m_pkgDB->isInstalled(*it)) {
string rm_args = (m_parser->installRoot() == "") ? "" :
"-r " + m_parser->installRoot() + " ";
rm_args += (m_parser->pkgrmArgs() + " " + *it);
// TODO: prettify
string args = "";
if (m_parser->installRoot() != "") {
args = "-r " + m_parser->installRoot() + " ";
}
args += (m_parser->pkgrmArgs() + " " + *it);
Process proc(command, rm_args);
Process proc(command, args);
if (m_parser->isTest() || proc.executeShell() == 0) {
removed.push_back(*it);
if (m_locker.isLocked(*it)) {
m_locker.unlock(*it);
m_locker.store();
}
if (m_config->removeLogOnUninst() && !m_parser->isTest()) {
string rm_logFile = m_config->logFilePattern();
bool doneSubs=false;
const string pkgname = *it;
StringHelper::replaceAll( rm_logFile, "%n", pkgname );
const string rm_ver = m_pkgDB->getPackageVersion( pkgname );
size_t pos = rm_ver.find_last_of('-');
if (pos != string::npos) {
const string rm_v = rm_ver.substr(0,pos);
const string rm_r = rm_ver.substr(pos+1);
StringHelper::replaceAll( rm_logFile, "%v", rm_v );
StringHelper::replaceAll( rm_logFile, "%r", rm_r );
}
if (! needRepo) {
doneSubs=true;
} else if (m_repo->getPackage( pkgname )) {
StringHelper::replaceAll( rm_logFile, "%p",
m_repo->getPackage( pkgname )->path() );
doneSubs=true;
} else {
cout << "Warning: unable to determine the logfile for "
+ pkgname + "; log removal aborted." << endl;
}
struct stat slF;
if ( doneSubs && stat(rm_logFile.c_str(), &slF)==0
&& (slF.st_mode & S_IFMT)==S_IFREG ) {
unlink( rm_logFile.c_str() );
}
}
} else {
failed.push_back(*it);
}
@ -2029,28 +1936,28 @@ void PrtGet::remove()
}
void PrtGet::assertMaxArgCount(size_t count)
void PrtGet::assertMaxArgCount(int count)
{
if ( m_parser->otherArgs().size() > count ) {
argCountFailure(count, "at most");
}
}
void PrtGet::assertExactArgCount(size_t count)
void PrtGet::assertExactArgCount(int count)
{
if ( m_parser->otherArgs().size() != count ) {
argCountFailure(count, "exactly");
}
}
void PrtGet::assertMinArgCount(size_t count)
void PrtGet::assertMinArgCount(int count)
{
if ( m_parser->otherArgs().size() < count ) {
argCountFailure(count, "at least");
}
}
void PrtGet::argCountFailure(size_t count, const string& specifier)
void PrtGet::argCountFailure(int count, const string& specifier)
{
cerr << m_appName << " "
<< m_parser->commandName() << " takes " << specifier << " "
@ -2074,96 +1981,67 @@ void PrtGet::printDependTree()
return;
}
if ( (p->dependencies().length() > 0) or
(m_followSoftdeps && p->optionals().length() > 0) ) {
cout << "-- dependencies ([i] installed";
if ( m_followSoftdeps ) {
cout << ", [s] installed softdeps";
} else {
cout << ", [ ] not installed";
}
if (p->dependencies().length() > 0) {
cout << "-- dependencies ([i] = installed";
if (!m_parser->all()) {
cout << ", '-->' already shown";
cout << ", '-->' = seen before";
}
cout << ")" << endl;
printDepsLevel(2, p, false);
if ( m_pkgDB->isInstalled( *it ) ) {
cout << "[i] ";
} else {
cout << "[ ] ";
}
cout << p->name() << endl;
printDepsLevel(2, p);
}
}
void PrtGet::printDepsLevel(int indent, const Package* package, bool greedy)
void PrtGet::printDepsLevel(int indent, const Package* package)
{
static map<string, bool> shownMap;
string installStatus;
bool isAlias = false;
string aliasName = "";
/* cycle detection -- code duplicated from checkDependencies */
for (unsigned int i=0; i<treeWalk.size(); ++i) {
if (treeWalk[i] == package->name()) {
return;
}
}
treeWalk.push_back(package->name());
if ( m_pkgDB->isInstalled( package->name(), true, &isAlias, &aliasName ) ) {
installStatus = ( greedy ) ? "[s] " : "[i] ";
cout << installStatus;
} else {
cout << "[ ] ";
}
for (int i = 0; i < indent; ++i) {
cout << " ";
}
cout << package->name();
if (isAlias) {
cout << " (provided by " << aliasName << ")";
}
map<string, bool>::iterator shownIt = shownMap.find(package->name());
if (shownIt != shownMap.end()) {
cout << " -->" << endl;
treeWalk.pop_back();
return;
} else {
cout << endl;
}
list<string> deps;
StringHelper::split(package->dependencies(), ',', deps);
list<string>::iterator it = deps.begin();
bool isAlias = false;
string aliasName = "";
for (; it != deps.end(); ++it) {
if ( m_pkgDB->isInstalled( *it, true, &isAlias, &aliasName ) ) {
cout << "[i] ";
} else {
cout << "[ ] ";
}
for (int i = 0; i < indent; ++i) {
cout << " ";
}
cout << *it;
if (isAlias) {
cout << " (provided by " << aliasName << ")";
}
const Package* p = m_repo->getPackage( *it );
if (p) {
printDepsLevel(indent+2, p, greedy);
if (!m_parser->all()) {
shownMap[*it] = true;
}
if (p->dependencies().length() > 0) {
map<string, bool>::iterator shownIt = shownMap.find(*it);
if (shownIt != shownMap.end()) {
cout << " -->" << endl;;
} else {
cout << endl;
printDepsLevel(indent+2, p);
if (!m_parser->all()) {
shownMap[*it] = true;
}
}
} else {
cout << endl;
}
} else {
cout << " (not found in ports tree)" << endl;
}
}
}
if ( m_followSoftdeps ) {
list<string> softDeps;
StringHelper::split(package->optionals(), ',', softDeps);
list<string>::iterator it = softDeps.begin();
for (; it != softDeps.end(); ++it) {
if ( m_pkgDB->isInstalled(*it, true) ) {
const Package* p = m_repo->getPackage( *it );
if (p) {
printDepsLevel(indent+2,p,true);
if (!m_parser->all()) {
shownMap[*it] = true;
}
} else {
cout << " (not found in ports tree)" << endl;
}
}
}
}
// reset the tree traversal history
treeWalk.pop_back();
}
void PrtGet::dumpConfig()

View File

@ -62,6 +62,7 @@ public:
void readme();
void install( bool update=false,
bool group=false,
bool dependencies=false );
void sysup();
void current();
@ -92,16 +93,16 @@ public:
int returnValue() const;
SignalHandler::HandlerResult handleSignal();
SignalHandler::HandlerResult handleSignal( int signal );
protected:
void printDepsLevel(int indent, const Package* package, bool greedy);
void printDepsLevel(int indent, const Package* package);
void printDependent(const std::string& dep, int level);
void executeTransaction( InstallTransaction& transaction,
bool update );
bool update, bool group );
void evaluateResult( InstallTransaction& transaction,
bool update,
bool interrupted=false );
@ -137,8 +138,6 @@ protected:
int m_returnValue;
bool m_useRegex;
bool m_followSoftdeps;
vector<string> treeWalk;
/*! Name of default configuration file */
static const string CONF_FILE;
@ -147,10 +146,10 @@ protected:
static const string DEFAULT_CACHE_FILE;
void assertMinArgCount(size_t count);
void assertMaxArgCount(size_t count);
void assertExactArgCount(size_t count);
void argCountFailure(size_t count, const string& specifier);
void assertMinArgCount(int count);
void assertMaxArgCount(int count);
void assertExactArgCount(int count);
void argCountFailure(int count, const string& specifier);
VersionComparator::COMP_RESULT
compareVersions( const string& v1, const string& v2 );

View File

@ -30,7 +30,7 @@ using namespace std;
using namespace StringHelper;
const string Repository::CACHE_VERSION = "V5.1";
const string Repository::CACHE_VERSION = "V5";
/*!
Create a repository
@ -256,7 +256,6 @@ Repository::initFromCache( const string& cacheFile )
if ( fgets( input, length, fp ) ) {
line = stripWhiteSpace( input );
if ( line != CACHE_VERSION ) {
fclose( fp );
return FORMAT_ERR;
}
}
@ -264,7 +263,7 @@ Repository::initFromCache( const string& cacheFile )
// FIELDS:
// name, path, version, release,
// description, dependencies, url,
// optionals, maintainer, hasReadme;
// packager, maintainer, hasReadme;
// hasPreInstall, hasPostInstall
const int fieldCount = 12;
string fields[fieldCount];
@ -327,9 +326,20 @@ Repository::WriteResult Repository::writeCache( const string& cacheFile )
const Package* p = it->second;
// TODO: encode
hasReadme = ( p->hasReadme() ) ? yesStr : noStr;
hasPreInstall = ( p->hasPreInstall() ) ? yesStr : noStr;
hasPostInstall = ( p->hasPostInstall() ) ? yesStr : noStr;
hasReadme = noStr;
if ( p->hasReadme() ) {
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",
p->name().c_str(),
@ -340,7 +350,7 @@ Repository::WriteResult Repository::writeCache( const string& cacheFile )
p->description().c_str(),
p->dependencies().c_str(),
p->url().c_str(),
p->optionals().c_str(),
p->packager().c_str(),
p->maintainer().c_str(),
hasReadme, hasPreInstall, hasPostInstall );
}

View File

@ -36,7 +36,7 @@ void SignalDispatcher::dispatch( int signalNumber )
map<int, SignalHandler*>::iterator it =
SignalDispatcher::instance()->m_signalHandlers.find( signalNumber );
if ( it != SignalDispatcher::instance()->m_signalHandlers.end() ) {
it->second->handleSignal();
it->second->handleSignal( signalNumber );
} else {
cerr << "prt-get: caught signal " << signalNumber << endl;
}

View File

@ -28,7 +28,7 @@ public:
EXIT, /*!< signal handled, exit now */
CONTINUE /*!< signal handled, don't exit */
};
virtual HandlerResult handleSignal() = 0;
virtual HandlerResult handleSignal( int signalNumber ) = 0;
};
/*!

View File

@ -58,18 +58,18 @@ string stripWhiteSpace( const string& s )
return s;
}
size_t pos = 0;
int pos = 0;
string line = s;
size_t len = line.length();
string::size_type len = line.length();
while ( pos < len && isspace( line[pos] ) ) {
++pos;
}
line.erase( 0, pos );
pos = line.length()-1;
while ( pos != (size_t) -1 && isspace( line[pos] ) ) {
while ( pos > -1 && isspace( line[pos] ) ) {
--pos;
}
if ( pos != (size_t) -1 ) {
if ( pos != -1 ) {
line.erase( pos+1 );
}
return line;

View File

@ -39,16 +39,16 @@ COMP_RESULT compareVersions(const string& v1, const string& v2)
tokenizeIntoBlocks(v1, blocks1);
tokenizeIntoBlocks(v2, blocks2);
size_t blockLen = normalizeVectors(blocks1, blocks2);
int blockLen = normalizeVectors(blocks1, blocks2);
for (size_t i = 0; i < blockLen; ++i) {
for (int i = 0; i < blockLen; ++i) {
vector<string> tokens1;
vector<string> tokens2;
split(blocks1[i], '.', tokens1);
split(blocks2[i], '.', tokens2);
size_t tokLen = normalizeVectors(tokens1, tokens2);
int tokLen = normalizeVectors(tokens1, tokens2);
for (size_t j = 0; j < tokLen; ++j) {
for (int j = 0; j < tokLen; ++j) {
if (tokens1[j] == tokens2[j]) {
continue;
}
@ -67,8 +67,8 @@ COMP_RESULT compareVersions(const string& v1, const string& v2)
tokenizeMixed(tokens1[j], subtokens1);
tokenizeMixed(tokens2[j], subtokens2);
size_t subTokLen = normalizeVectors(subtokens1, subtokens2);
for (size_t k = 0; k < subTokLen; ++k) {
int subTokLen = normalizeVectors(subtokens1, subtokens2);
for (int k = 0; k < subTokLen; ++k) {
long sl1 = strtol(subtokens1[k].c_str(), &error1, 10);
long sl2 = strtol(subtokens2[k].c_str(), &error2, 10);
if (*error1 == 0 && *error2 == 0) {
@ -123,9 +123,9 @@ COMP_RESULT compareVersions(const string& v1, const string& v2)
return EQUAL;
}
size_t normalizeVectors(vector<string>& v1, vector<string>& v2)
int normalizeVectors(vector<string>& v1, vector<string>& v2)
{
size_t length = max(v1.size(), v2.size());
int length = max(v1.size(), v2.size());
while (v1.size() < length) {
v1.push_back("-1");
@ -140,14 +140,14 @@ size_t normalizeVectors(vector<string>& v1, vector<string>& v2)
void tokenizeMixed(const string& s, vector<string>& tokens)
{
vector<bool> digitMask;
for (size_t i = 0; i < s.length(); ++i) {
for (int i = 0; i < s.length(); ++i) {
digitMask.push_back(isdigit(s[i]));
}
bool state = digitMask[0];
string tok;
tok = s[0];
for (size_t i = 1; i < digitMask.size(); ++i) {
for (int i = 1; i < digitMask.size(); ++i) {
if (digitMask[i] != state) {
tokens.push_back(tok);
tok = s[i];

View File

@ -19,7 +19,7 @@ enum COMP_RESULT { LESS, GREATER, EQUAL, UNDEFINED };
COMP_RESULT compareVersions(const string& v1, const string& v2) ;
void tokenizeIntoBlocks(const string& version, vector<string>& blocks);
size_t normalizeVectors(vector<string>& v1, vector<string>& v2);
int normalizeVectors(vector<string>& v1, vector<string>& v2);
void tokenizeMixed(const string& s, vector<string>& tokens);
}