Upgrades to packages
[hvlinux.git] / functions-update
index 1fe40ed..8fa73a9 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-LFS_PKG_BASE="$(dirname $(dirname $(pwd)))/packages"
+LFS_PKG_BASE="$(dirname $(pwd))/packages"
 LFS_PKG_DIR="${LFS_PKG_BASE}/${LFS_STAGE}"
 LFS_LOG_DIR="${LFS}/var/log/hvlinux-install/${LFS_STAGE}"
 LFS_LOG_FILE="${LFS_LOG_DIR}/pkg-update.log"
@@ -25,10 +25,10 @@ LFS_PATCHES_LIST=${LFS_PKG_DIR}/patches-list-lfs.html
 BLFS_PATCHES_LIST=${LFS_PKG_DIR}/patches-list-blfs.html
 HV_PATCHES_LIST=${LFS_PKG_DIR}/patches-list-hv.html
 
-
 # Arg. #1: URL for patches repository.
 # Arg. #2: Destination filename.
-static_fetch_patches_list() {
+static_fetch_patches_list()
+{
     PATCHES_URL=${1}
     PATCHES_LIST_FILENAME=${2}
 
@@ -36,10 +36,10 @@ static_fetch_patches_list() {
     mv ${LFS_PKG_DIR}/index.html ${PATCHES_LIST_FILENAME}
 }
 
-
 # Arg. #1: URL for patches repository. The trailing
 #          slash is absolutely necessary for this to work.
-update_packages_init() {
+update_packages_init()
+{
     # First create log directory if it does not exists.
     if [ ! -d ${LFS_LOG_DIR} ]; then
        install -m755 -d ${LFS_LOG_DIR} || exit 1
@@ -61,12 +61,12 @@ update_packages_init() {
     action_checkbox "Fetching hugovil.com patches list" static_fetch_patches_list ${HV_PATCHES_URL} ${HV_PATCHES_LIST}
 }
 
-
 # Get patch package if it is not in the repository
 # Arg. #1: Package name and version
 # Arg. #2: Patches list file (HTML)
 # Arg. #3: Patches URL
-static_checkpatch() {
+static_checkpatch()
+{
     local PACK=${1}
     local PATCHES_LIST=${2}
     local PATCHES_URL=${3}
@@ -81,10 +81,10 @@ static_checkpatch() {
     fi
 }
 
-
 # Get patch package if it is not in the repository
 # Arg. #1: Package name and version
-static_getpatch() {
+static_getpatch()
+{
     PACK=${1}
 
     # Checking for correct number of arguments
@@ -103,7 +103,6 @@ static_getpatch() {
     static_checkpatch ${PACK} ${HV_PATCHES_LIST} ${HV_PATCHES_URL}
 }
 
-
 # Convert multiple compressed gzip files to bzip2.
 # Usage: gztobz2 [FILES]
 gztobz2()
@@ -152,7 +151,6 @@ gztobz2()
     done
 }
 
-
 detect_file_not_found()
 {
     # HTTP: will return error code 404.
@@ -166,11 +164,11 @@ detect_file_not_found()
     fi
 }
 
-
 # Get package if it is not in the repository
 # Arg. #1: Package name and version
 # Arg. #2: URL
-static_getpkg() {
+static_getpkg()
+{
     PACK=${1}
     URL=${2}
 
@@ -219,11 +217,11 @@ static_getpkg() {
     return 1
 }
 
-
 # Get package if it is not in the repository
 # Arg. #1: Package name and version
 # Arg. #2: URL
-fpkg() {
+fpkg()
+{
     PACK=${1}
     URL=${2}
 
@@ -241,14 +239,14 @@ fpkg() {
     static_getpatch ${PACK}
 }
 
-
 # Get package if it is not in the repository.
 # This function is used if the source and target names for the
 # package are different (name mismatch).
 # Arg. #1: Target package name and version (on disk)
 # Arg. #2: Source package name and version (on internet)
 # Arg. #3: URL
-fpkg_mis() {
+fpkg_mis()
+{
     TARGET=${1}
     SOURCE=${2}
     URL=${3}
@@ -280,11 +278,11 @@ fpkg_mis() {
     fi
 }
 
-
 # Get package if it is not in the repository
 # Arg. #1: Package name and version
 # Arg. #2: Directory name (optional)
-fpkg_gnu() {
+fpkg_gnu()
+{
     PACK=${1}
 
     if [ $# -eq 2 ]; then
@@ -302,11 +300,11 @@ fpkg_gnu() {
     fpkg ${PACK} "${GNU_URL}/${NAME}"
 }
 
-
 # Fetch Gnome package (if it is not in the repository).
 # Arg. #1: Package name and version
 # Arg. #2: Directory name (optional)
-fpkg_gnome() {
+fpkg_gnome()
+{
     PACK=${1}
 
     if [ $# -eq 2 ]; then
@@ -324,11 +322,11 @@ fpkg_gnome() {
     fpkg ${PACK} "${GNOME_URL}/${NAME}/$(get_pkg_ver_base ${PACK})"
 }
 
-
 # Get package if it is not in the repository
 # Arg. #1: Package name and version
 # Arg. #2: Directory name (optional)
-fpkg_sf() {
+fpkg_sf()
+{
     PACK=${1}
 
     if [ $# -eq 2 ]; then
@@ -346,11 +344,11 @@ fpkg_sf() {
     fpkg ${PACK} ${SOURCEFORGE_URL}/${NAME}
 }
 
-
 # Get package if it is not in the repository
 # Arg. #1: Package name and version
 # Arg. #2: Directory name (optional)
-fpkg_hv() {
+fpkg_hv()
+{
     PACK=${1}
 
     # Checking for correct number of arguments
@@ -366,11 +364,11 @@ fpkg_hv() {
     fi
 }
 
-
 # Get package if it is not in the repository
 # Arg. #1: Package name and version
 # Arg. #2: Directory name (optional)
-fpkg_lfs() {
+fpkg_lfs()
+{
     PACK=${1}
 
     # Checking for correct number of arguments
@@ -386,12 +384,12 @@ fpkg_lfs() {
     fi
 }
 
-
 # Create a symbolic link to a package that is located in another stage
 # repository (to not have the same file twice).
 # Arg. #1: Source stage number (1, 2, 3, etc)
 # Arg. #2: Package name
-lpkg() {
+lpkg()
+{
     SRCSTAGE="stage${1}"
     FILE="${2}.tar.bz2"
     PACKAGE_NAME="${2}"