summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McQuah <jmcquah@disroot.org>2022-02-12 14:28:14 +0100
committerJuergen Daubert <jue@jue.li>2022-02-12 14:28:14 +0100
commit5db0bb84891807585d88ef630e3edcffce753025 (patch)
tree3928f95e7fb160677c464b81613f25e7b4a6a033
parent41dfcb6520f0a8459dbcef5e7d8feb45e04b49ee (diff)
downloadprt-utils-5db0bb84891807585d88ef630e3edcffce753025.tar.gz
prt-utils-5db0bb84891807585d88ef630e3edcffce753025.tar.xz
dllist: enable the download listing tool to recognize already-downloaded sources
-rwxr-xr-xdllist35
-rw-r--r--dllist.130
2 files changed, 43 insertions, 22 deletions
diff --git a/dllist b/dllist
index 8b1d5b8..4c4a040 100755
--- a/dllist
+++ b/dllist
@@ -1,11 +1,12 @@
#!/bin/bash
#
-# Print a list of files to download; allows to either download the
-# files required to install a package, all files (including those you
-# already have installed) to install a package, or all files required
-# to update your system
+# Print a list of files to download, formatted in one of three ways:
+# - the files required to install a specified package
+# - the files required to install a package and all its dependencies
+# (even dependencies that are already present on the system)
+# - all files required to update your system
#
-# Johannes Winkelmann <jw@tks6.net>
+# version 1.0 by Johannes Winkelmann, updated 2021-06 by John McQuah
version=1.1
@@ -32,14 +33,26 @@ fi
if [ "$DIFF" = "yes" ]; then
list=(`prt-get quickdiff`)
elif [ "$ALL" = "yes" ]; then
- list=(`prt-get quickdep $@`)
+ list=(`prt-get quickdep ${args[*]}`)
else
- list=(`prt-get depends ${args[*]}|grep "\[ "|awk '{print $3}'`)
+ wlist=(${args[*]} `prt-get depends ${args[*]} | grep "\[ "|awk '{print $3}'`)
+ list=(`echo "${wlist[*]}" | sort | uniq`)
fi
-for p in ${list[*]}; do
- . `prt-get path $p`/Pkgfile
- for s in ${source[*]}; do
- echo $s|grep tp:
+SRCGLOB=$(grep PKGMK_SOURCE_DIR /etc/pkgmk.conf | sed 's/^\s*#// ; s/.*=//; s/\"//g')
+
+for l in ${list[*]}; do
+ PORTDIR=`prt-get path $l`
+ . $PORTDIR/Pkgfile
+ SAVELOC=`eval printf '%s' "$SRCGLOB"`
+ for (( p=0; p<${#source[@]}; p++ )) ; do
+ if [[ ${source[$p]} =~ ^(http|ftp|https): ]]; then
+ if [ -n "${renames[$p]}" -a "${renames[$p]}" != "SKIP" ]; then
+ FILE=${renames[$p]}
+ else
+ FILE=$(echo "${source[$p]}" | sed 's,.*/,,')
+ fi
+ [ -e ${SAVELOC:-$PORTDIR}/$FILE ] || echo ${source[$p]}
+ fi
done
done
diff --git a/dllist.1 b/dllist.1
index 1f2ee11..9001696 100644
--- a/dllist.1
+++ b/dllist.1
@@ -1,5 +1,5 @@
." Text automatically generated by txt2man-1.4.7
-.TH dllist "October 20, 2004" "" ""
+.TH dllist "June 25, 2021" "" ""
.SH NAME
\fBdllist \fP- Show sources to be downloaded for compiling a port
\fB
@@ -12,21 +12,29 @@
.fi
.SH DESCRIPTION
\fBdllist\fP displays a list of URLs that have to be downloaded for compiling
-the given \fBport\fP(s).
+the given \fBport\fP(s), using \fBprt-get\fP(8) to collect information on
+ports and installation status.
.PP
-The script can operate in two modes: list files needed for sepcified
-ports or list files needed to update the system.
+The script can operate in two modes: list files needed for specified
+ports, or list files needed to update the system.
.PP
-Only files from ports not already installed are considered,
+The list is restricted to packages not currently installed,
unless the --all option is specified.
.PP
-\fBdllist\fP uses \fBprt-get\fP(8) to collect information on ports
-and installation status.
+\fBdllist\fP filters the list based on the contents of $PKGMK_SOURCE_DIR,
+reporting only those source files that are not found in the expected download
+location on the filesystem. It is the user's responsibility to ensure that
+$PKGMK_SOURCE_DIR is consistent for all invocations of \fBpkgmk\fB; otherwise
+\fBdllist\fP might exaggerate the number of downloads needed. For a similar reason,
+moving or renaming downloaded source files using a mechanism other
+than the \(oqrenames\(cq array of \fBPkgfile\fB(5) will cause \fBdllist\fP
+to report them as needing a fresh download.
.SH OPTIONS
.TP
.B
--all
-also display URLs that
+read the source array of each dependency (even those already installed)
+and print the URLs that have no corresponding file in $PKGMK_SOURCE_DIR
.TP
.B
--diff
@@ -46,9 +54,9 @@ needed to build apache
\fBdllist\fP --diff
list files to be downloaded for a system upgrade
.SH SEE ALSO
-\fBprt-get\fP(8), \fBports\fP(8)
-.SH AUTHOR
-Johannes Winkelmann <jw@tks6.net>
+\fBprt-get\fP(8), \fBports\fP(8), \fBPkgfile\fP(5)
+.SH AUTHORS
+Johannes Winkelmann <jw at tks6 dot net>, John McQuah <jmcquah at disroot dot org>
.RE
.PP

Generated by cgit