From c0c320617f580e1bfa5aebca72ec5aeed3276fcf Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sat, 16 Jan 2016 15:10:05 -0500 Subject: profile_detect(): New function --- (limited to 'src/profile.sh') diff --git a/src/profile.sh b/src/profile.sh index 9bbd9ce..44e3022 100644 --- a/src/profile.sh +++ b/src/profile.sh @@ -50,6 +50,20 @@ profile_set() return 0 } +profile_detect() +{ + local root="${1}" + + for prof in ${profiles}; do + if "prof_${prof}_detect_root" "${root}"; then + profile="${prof}" + return 0 + fi + done + + error 1 "$(get_msg 'profile_not_detected')" "${root}" +} + profile_normalize_suite() { local suite="${1}" -- cgit v0.9.1