Project

General

Profile

Actions

Feature #14534

closed

diff could support -q

Added by Andy Fiddaman 7 months ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:
External Bug:

Description

I keep coming across software that checks for file differences using diff -q which is an unknown flag on illumos.

Actions #1

Updated by Andy Fiddaman 7 months ago

build:illumos:ig_14534_diff-q% ./diff -q /etc/passwd /etc/passwd
build:illumos:ig_14534_diff-q% echo $?
0

build:illumos:ig_14534_diff-q% ./diff -q /etc/passwd /etc/inet/hosts
Files /etc/passwd and /etc/inet/hosts differ
build:illumos:ig_14534_diff-q% echo $?
1

build:illumos:ig_14534_diff-q% ./diff -q /bin/ls /bin/ps
Binary files /bin/ls and /bin/ps differ
build:illumos:ig_14534_diff-q% echo $?
1

build:illumos:ig_14534_diff-q% ./diff /bin/ls /bin/ps
Binary files /bin/ls and /bin/ps differ
build:illumos:ig_14534_diff-q% echo $?
1
Actions #2

Updated by Electric Monk 7 months ago

  • Gerrit CR set to 2048
Actions #3

Updated by Andy Fiddaman 7 months ago

I did some further testing of a few scenarios:

build:illumos:ig_14534_diff-q% cp /etc/passwd .
build:illumos:ig_14534_diff-q% ./diff -q /etc/passwd passwd
build:illumos:ig_14534_diff-q% echo $?
0

build:illumos:ig_14534_diff-q% /usr/bin/diff /etc/passwd /etc/hosts > old
build:illumos:ig_14534_diff-q% ./diff /etc/passwd /etc/hosts > new
build:illumos:ig_14534_diff-q% diff old new

build:illumos:ig_14534_diff-q% /usr/bin/diff /etc/shadow /etc/passwd
diff: /etc/shadow: Permission denied
build:illumos:ig_14534_diff-q% ./diff /etc/shadow /etc/passwd
diff: /etc/shadow: Permission denied
build:illumos:ig_14534_diff-q% ./diff -q /etc/shadow /etc/passwd
diff: /etc/shadow: Permission denied

I also ran the util-tests having replaced /usr/bin/diff with this version. They don't directly test diff, but it's heavily used by the tests.

Actions #4

Updated by Electric Monk 7 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit d2b76ef70a19a09ea9aab5aaeb614dc7c9d195ed

commit  d2b76ef70a19a09ea9aab5aaeb614dc7c9d195ed
Author: Andy Fiddaman <omnios@citrus-it.co.uk>
Date:   2022-03-02T15:22:03.000Z

    14534 diff could support -q
    Reviewed by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Robert Mustacchi <rm@fingolfin.org>

Actions

Also available in: Atom PDF