Skip to content

Commit

Permalink
Faster conflict detection
Browse files Browse the repository at this point in the history
Replace the use of grep to determine the unique dependencies with
sort/uniq.
  • Loading branch information
TAAPArthur authored and Dilyn Corner committed Jun 27, 2021
1 parent 3d4734c commit adf7818
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kiss
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ pkg_conflicts() {
# Store the list of found conflicts in a file as we'll be using the
# information multiple times. Storing things in the cache dir allows
# us to be lazy as they'll be automatically removed on script end.
grep -Fxf "$mak_dir/$pid-m" -- "$@" 2>/dev/null > "$mak_dir/$pid-c" ||:
sed '/\/$/d' "$@" | sort "$mak_dir/$pid-m" - | uniq -d > "$mak_dir/$pid-c" ||:

# Enable alternatives automatically if it is safe to do so.
# This checks to see that the package that is about to be installed
Expand Down Expand Up @@ -899,7 +899,7 @@ pkg_conflicts() {
# this work.
#
# Pretty nifty huh?
while IFS=: read -r _ con; do
while read -r con; do
printf '%s\n' "Found conflict $con"

# Create the "choices" directory inside of the tarball.
Expand Down

3 comments on commit adf7818

@dylanaraps
Copy link

@dylanaraps dylanaraps commented on adf7818 Jun 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes breakage on my machine (false positive matches when some packages use /bin and some use /usr/bin for example). Will open a bug report once I have time to look into this further.

-> /home/dylan/junk/kiss/kiss i zlib                                                                                                                     
-> Using '/usr/bin/ssu' (to become root) 
-> zlib Checking that manifest is valid
-> zlib Checking that all dependencies are installed
-> zlib Checking for package conflicts
Found conflict /bin/find
-> File must be in /bin and not a symlink to it 
-> This usually occurs when a binary is installed to 
-> /sbin instead of /usr/bin (example) 
-> Before this package can be used as an alternative, 
-> this must be fixed in zlib. Contact the maintainer 
!> by finding their details via 'kiss-maintainer' 

@dylanaraps
Copy link

@dylanaraps dylanaraps commented on adf7818 Jun 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also encounter this error in a clean chroot (unrelated to above issue):

-> libpciaccess Checking for package conflicts
/usr/bin/kiss: line 848: can't create /home/dylan/.cache/kiss/proc/673/build/673-m: nonexistent directory
/usr/bin/kiss: line 886: can't create /home/dylan/.cache/kiss/proc/673/build/673-c: nonexistent directory
sort: /home/dylan/.cache/kiss/proc/673/build/673-m: No such file or directory
grep: /home/dylan/.cache/kiss/proc/673/build/673-c: No such file or directory
-> libpciaccess Installing package

(The package manager happily continues along)

@dilyn-corner
Copy link
Member

@dilyn-corner dilyn-corner commented on adf7818 Jun 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have sometimes seen the error you've encountered, but I have never found a way to reliably reproduce it.

Should add, that extra error is probably unrelated to this commit, if only because I am not using master. :)

Please sign in to comment.