From 9eb57210dca480ed851e7f6a988e04438c15e604 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Fri, 19 Apr 2019 13:57:17 -0400 Subject: profile: Generate abstraction layer at run time --- diff --git a/src/profile.sh b/src/profile.sh index 5cfe5c4..b5e760e 100644 --- a/src/profile.sh +++ b/src/profile.sh @@ -68,144 +68,10 @@ profile_detect() return 1 } -profile_normalize_suite() -{ - local suite="${1}" - - "prof_${profile}_normalize_suite" "${suite}" -} - -profile_detect_arch() -{ - "prof_${profile}_detect_arch" -} - -profile_default_plat() -{ - "prof_${profile}_default_plat" -} - -profile_select_mirror() -{ - "prof_${profile}_select_mirror" -} - -profile_validate_archplat() -{ - local mirror="${1}" - local arch="${2}" - local plat="${3}" - local suite="${4}" - - "prof_${profile}_validate_archplat" "${mirror}" "${arch}" "${plat}" \ - "${suite}" -} - -profile_feeds() -{ - local mirror="${1}" - local arch="${2}" - local plat="${3}" - local suite="${4}" - - "prof_${profile}_feeds" "${mirror}" "${arch}" "${plat}" "${suite}" -} - -profile_get_cert_url() -{ - local mirror="${1}" - - "prof_${profile}_get_cert_url" "${mirror}" -} - -profile_get_root_key() -{ - "prof_${profile}_get_root_key" -} - -profile_dep_fields() -{ - "prof_${profile}_dep_fields" -} - -profile_include_pkg() -{ - local name="${1}" - local value="${2}" - - "prof_${profile}_include_pkg" "${name}" "${value}" -} - -profile_get_fstab() -{ - local arch="${1}" - local plat="${2}" - - "prof_${profile}_get_fstab" "${arch}" "${plat}" -} - -profile_file_systems_mounted() -{ - local root="${1}" - local arch="${1}" - local plat="${2}" - - "prof_${profile}_file_systems_mounted" "${root}" "${arch}" "${plat}" -} - -profile_bind_mount() -{ - local arch="${1}" - local plat="${2}" - local olddir="${3}" - local newdir="${4}" - - "prof_${profile}_bind_mount" "${arch}" "${plat}" \ - "${olddir}" "${newdir}" -} - -profile_bind_umount() -{ - local arch="${1}" - local plat="${2}" - local olddir="${3}" - local newdir="${4}" - - "prof_${profile}_bind_umount" "${arch}" "${plat}" \ - "${olddir}" "${newdir}" -} - -profile_configure_system_native() -{ - local root="${1}" - local arch="${2}" - local plat="${3}" - - "prof_${profile}_configure_system_native" "${root}" "${arch}" "${plat}" -} - -profile_configure_system_foreign() -{ - local root="${1}" - local arch="${2}" - local plat="${3}" - - "prof_${profile}_configure_system_foreign" "${root}" "${arch}" "${plat}" -} - -profile_find_kernel() -{ - local root="${1}" - local arch="${2}" - local plat="${3}" - - "prof_${profile}_find_kernel" "${root}" "${arch}" "${plat}" -} - -profile_make_initramfs() -{ - local arch="${1}" - local plat="${2}" - - "prof_${profile}_make_initramfs" "${arch}" "${plat}" -} +for func in normalize_suite detect_arch default_plat select_mirror \ + validate_archplat feeds get_cert_url get_root_key dep_fields \ + include_pkg get_fstab file_systems_mounted bind_mount \ + bind_umount configure_system_native configure_system_foreign \ + find_kernel make_initramfs; do + eval "profile_${func}() { \"prof_\${profile}_${func}\" \"\${@}\"; }" +done -- cgit v0.9.1