This commit is contained in:
emmett1
2017-12-12 21:15:44 +08:00
parent 9da539ef2c
commit 4f6e01bdf4

25
scratch
View File

@@ -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"