diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2010-12-31 16:46:41 +0100 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2010-12-31 16:46:41 +0100 |
commit | dbbf5ccabc342f6cedd975378209b0c4af20e5c6 (patch) | |
tree | e0845797b2c5369b40ebcb62217444a6249bdb41 /src/core/libs/lib-pacman.sh | |
parent | bffae93369818a82f0cbbcbff81939c104699550 (diff) |
Inform user more in detail which pre/post-configure step went wrong
* Move all pre/post-configure logic to separate functions (initcpio
config, time setting, mirrorlist)
* other steps will continue to be run, even if previous one(s) failed
* at the end of the pre/post-configure step you will be warned which
steps failed, if needed.
Diffstat (limited to 'src/core/libs/lib-pacman.sh')
-rw-r--r-- | src/core/libs/lib-pacman.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core/libs/lib-pacman.sh b/src/core/libs/lib-pacman.sh index 2b1220e..4dde616 100644 --- a/src/core/libs/lib-pacman.sh +++ b/src/core/libs/lib-pacman.sh @@ -157,3 +157,17 @@ pkginfo () { PACKAGE_INFO=`LANG=C $PACMAN_TARGET -Si "$@" | awk '/^Name/{ printf("%s ",$3) } /^Version/{ printf("%s ",$3) } /^Group/{ printf("%s", $3) } /^Description/{ for(i=3;i<=NF;++i) printf(" %s",$i); printf ("\n")}'` } + +target_configure_mirrorlist () { + # add installer-selected mirror to the top of the mirrorlist, unless it's already at the top. previously added mirrors are kept (a bit lower), you never know.. + if [ "$var_PKG_SOURCE_TYPE" = "net" -a -n "${var_SYNC_URL}" ]; then + if ! grep "^Server =" -m 1 "${var_TARGET_DIR}/$var_MIRRORLIST" | grep "${var_SYNC_URL}" + then + debug 'PACMAN PROCEDURE' "Adding choosen mirror (${var_SYNC_URL}) to ${var_TARGET_DIR}/$var_MIRRORLIST" + mirrorlist=`awk "BEGIN { printf(\"# Mirror used during installation\nServer = "${var_SYNC_URL}"\n\n\") } 1 " "${var_TARGET_DIR}/$var_MIRRORLIST"` || return $? + echo "$mirrorlist" > "${var_TARGET_DIR}/$var_MIRRORLIST" || return $? + fi + fi + return 0 +} + |