Bug 221079 - freebsd-update: sort before uniq at fetch_make_patchlist ()
Summary: freebsd-update: sort before uniq at fetch_make_patchlist ()
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Ed Maste
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2017-07-29 01:46 UTC by Masachika ISHIZUKA
Modified: 2017-11-30 02:13 UTC (History)
3 users (show)

See Also:
emaste: mfc-stable11+
emaste: mfc-stable10+
emaste: mfc-stable9-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Masachika ISHIZUKA 2017-07-29 01:46:02 UTC
The fetch_make_patchlist () in freebsd-update is not sort before uniq.
Please sort before uniq.

===== start of patch =====
--- freebsd-update.org  2017-07-03 23:39:55.857074000 +0900
+++ freebsd-update      2017-07-29 10:41:51.403160000 +0900
@@ -1047,7 +1047,7 @@
                                continue
                        fi
                        echo "${X}|${Y}"
-               done | uniq
+               done | sort | uniq
 }
 
 # Print user-friendly progress statistics
===== end of patch =====
Comment 1 ota 2017-07-29 03:23:56 UTC
Then, "sort -u" is better than "sort | uniq"
Comment 2 Ed Maste freebsd_committer freebsd_triage 2017-08-01 08:16:11 UTC
Did you encounter a case with a duplicate, unsorted entries? I think this is reasonable, but am curious about how you came to this change.
Comment 3 Masachika ISHIZUKA 2017-08-03 00:27:33 UTC
(In reply to Ed Maste from comment #2)
Yes, I'd like to update 10.3-RELEASE-p20 to 11.1-RELEASE on i386 machine, but some files have been fetched more than once.
This machine (socket 370 Celeron 1400 MHz) is very slow to fetch files. I want to shorten transfer time.
Comment 4 commit-hook freebsd_committer freebsd_triage 2017-11-22 01:51:18 UTC
A commit references this bug:

Author: emaste
Date: Wed Nov 22 01:50:23 UTC 2017
New revision: 326082
URL: https://svnweb.freebsd.org/changeset/base/326082

Log:
  freebsd-update: do not duplicate patchlist entries

  PR:		221079
  Submitted by:	Masachika ISHIZUKA
  Submitted by:	ota@j.email.ne.jp
  Reviewed by:	cperciva
  MFC after:	1 week

Changes:
  head/usr.sbin/freebsd-update/freebsd-update.sh
Comment 5 commit-hook freebsd_committer freebsd_triage 2017-11-29 20:39:12 UTC
A commit references this bug:

Author: emaste
Date: Wed Nov 29 20:38:21 UTC 2017
New revision: 326373
URL: https://svnweb.freebsd.org/changeset/base/326373

Log:
  MFC r326082: freebsd-update: do not duplicate patchlist entries

  PR:		221079
  Submitted by:	Masachika ISHIZUKA
  Submitted by:	ota@j.email.ne.jp
  Reviewed by:	cperciva

Changes:
_U  stable/11/
  stable/11/usr.sbin/freebsd-update/freebsd-update.sh
Comment 6 commit-hook freebsd_committer freebsd_triage 2017-11-29 20:45:20 UTC
A commit references this bug:

Author: emaste
Date: Wed Nov 29 20:44:41 UTC 2017
New revision: 326374
URL: https://svnweb.freebsd.org/changeset/base/326374

Log:
  MFC r326082: freebsd-update: do not duplicate patchlist entries

  PR:		221079
  Submitted by:	Masachika ISHIZUKA
  Submitted by:	ota@j.email.ne.jp
  Reviewed by:	cperciva

Changes:
_U  stable/10/
  stable/10/usr.sbin/freebsd-update/freebsd-update.sh
Comment 7 Masachika ISHIZUKA 2017-11-30 01:29:39 UTC
Thank you for commit.
Comment 8 Ed Maste freebsd_committer freebsd_triage 2017-11-30 02:13:52 UTC
Thank you for the submission!