From 4f6e01bdf482106612d2fe3b0da48e28477b233c Mon Sep 17 00:00:00 2001 From: emmett1 Date: Tue, 12 Dec 2017 21:15:44 +0800 Subject: [PATCH] updated --- scratch | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/scratch b/scratch index 103aea6..43ce56f 100755 --- a/scratch +++ b/scratch @@ -454,6 +454,23 @@ updports() { } +duplicateports() { + + dup=$(find ${PORT_REPO[@]} -type d | rev | cut -d '/' -f1 | rev | sort | uniq -d) + + if [ "$dup" ]; then + for dp in $dup; do + for repo in ${PORT_REPO[@]}; do + reponame=$(basename $repo) + [ -d $repo/$dp ] && echo "$repo/$dp" + done + done + else + msg "No duplicate ports found." + fi + +} + interrupted() { exit 1 } @@ -541,6 +558,9 @@ parse_options() { --no-backup) NO_BACKUP=yes ;; + -dup|--duplicate-ports) + DUPLICATE_PORTS=yes + ;; -l|--list-installed) LIST_INSTALLED=yes ;; @@ -696,6 +716,11 @@ main() { showinfo exit 0 fi + ### SHOW SCRATCHPKG INFO ### + if [ "$DUPLICATE_PORTS" ]; then + duplicateports + exit 0 + fi checkdirexist "$INDEX_DIR"