cpt

[ARCHIVED] Carbs Packaging Tools
git clone git://git.ckyln.com/~cem/cpt.git
Log | Files | Refs | README | LICENSE

commit c19dd3b75d889d5e1953008e4f99a47aa2935d13
parent ad89d327f936dffa28711c87286a97d412ee976c
Author: Dylan Araps <dylan.araps@gmail.com>
Date:   Thu, 20 Feb 2020 01:21:37 +0200

kiss: simplify depends finder file handling.

Removes the use of multiple temporary files and the
number of times they're shuffled around. POSIX sort
is neat.

This should bring minor speedups to the dependency
finder on top of installing GNU grep. I'm sure this
can be further simplified.

I'll be tackling the reduction of checked files
next. Wish me luck.

Diffstat:
Mkiss | 14+++++---------
1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/kiss b/kiss @@ -389,7 +389,7 @@ pkg_fixdeps() { # Make a copy of the depends file if it exists to have a # reference to 'diff' against. - [ -f depends ] && cp -f depends depends-copy + [ -f depends ] && cp -f depends "$mak_dir/d" # Generate a list of all installed manifests. pkg_name=$1 @@ -426,20 +426,16 @@ pkg_fixdeps() { *) printf '%s\n' "$dep" ;; esac done ||: - done >> depends-copy + done | # Remove duplicate entries from the new depends file. # This remove duplicate lines looking *only* at the # first column. - sort -u -k1,1 depends-copy > depends-new + sort -uk1,1 -o depends depends - - # Display a 'diff' of the new dependencies agaisnt + # Display a 'diff' of the new dependencies against # the old ones. '-N' treats non-existent files as blank. - diff -N depends depends-new ||: - - # Do some clean up as this required a few temporary files. - mv -f depends-new depends - rm -f depends-copy + diff -N "$mak_dir/d" depends ||: } pkg_manifest() (