diff options
author | Chris Lamb <chris@chris-lamb.co.uk> | 2008-01-15 02:43:42 +0000 |
---|---|---|
committer | Chris Lamb <chris@chris-lamb.co.uk> | 2008-01-15 02:43:42 +0000 |
commit | 13e554b1506f6bb0602f2f0ff2f5ef64f617dfb3 (patch) | |
tree | 1aed123662ad0ddc194ad3ffd21c7690d06f93b7 /helpers | |
parent | f3f923911054a72bb6ad3e6b0bc94b7311d5fcbf (diff) | |
download | vyos-live-build-13e554b1506f6bb0602f2f0ff2f5ef64f617dfb3.tar.gz vyos-live-build-13e554b1506f6bb0602f2f0ff2f5ef64f617dfb3.zip |
Refactor installing file to binary/pool/main/./.* functionality.
Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk>
Diffstat (limited to 'helpers')
-rwxr-xr-x | helpers/lh_binary_debian-installer | 119 |
1 files changed, 31 insertions, 88 deletions
diff --git a/helpers/lh_binary_debian-installer b/helpers/lh_binary_debian-installer index 0bf778c24..81d535f7c 100755 --- a/helpers/lh_binary_debian-installer +++ b/helpers/lh_binary_debian-installer @@ -111,6 +111,33 @@ VMLINUZ_GI="gtk/vmlinuz" INITRD_GI="gtk/initrd.gz" DESTDIR_GI="${DESTDIR}/gtk" +Install_file() { + local FILE="${1}" + + SOURCE="$(dpkg -f ${FILE} Source | awk '{ print $1 }')" + + if [ -z "${SOURCE}" ] + then + SOURCE="$(basename ${FILE} | awk -F_ '{ print $1 }')" + fi + + case "${SOURCE}" in + lib?*) + LETTER="$(echo ${SOURCE} | sed 's/\(....\).*/\1/')" + ;; + + *) + LETTER="$(echo ${SOURCE} | sed 's/\(.\).*/\1/')" + ;; + esac + + # Install directory + mkdir -p binary/pool/main/"${LETTER}"/"${SOURCE}" + + # Move files + cp "${FILE}" binary/pool/main/"${LETTER}"/"${SOURCE}" +} + # Workaround for syslinux (<< 3.36) which doesn't support long file/path names if [ "${LH_DISTRIBUTION}" = "etch" ] then @@ -231,28 +258,7 @@ if ls binary.deb/archives/*.deb > /dev/null 2>&1 then for FILE in binary.deb/archives/*.deb do - SOURCE="$(dpkg -f ${FILE} Source | awk '{ print $1 }')" - - if [ -z "${SOURCE}" ] - then - SOURCE="$(basename ${FILE} | awk -F_ '{ print $1 }')" - fi - - case "${SOURCE}" in - lib?*) - LETTER="$(echo ${SOURCE} | sed 's/\(....\).*/\1/')" - ;; - - *) - LETTER="$(echo ${SOURCE} | sed 's/\(.\).*/\1/')" - ;; - esac - - # Install directory - mkdir -p binary/pool/main/"${LETTER}"/"${SOURCE}" - - # Move files - cp "${FILE}" binary/pool/main/"${LETTER}"/"${SOURCE}" + Install_file "${FILE}" done fi @@ -261,28 +267,7 @@ if [ -d cache/packages_bootstrap ] then for FILE in cache/packages_bootstrap/*.deb do - SOURCE="$(dpkg -f ${FILE} Source | awk '{ print $1 }')" - - if [ -z "${SOURCE}" ] - then - SOURCE="$(basename ${FILE} | awk -F_ '{ print $1 }')" - fi - - case "${SOURCE}" in - lib?*) - LETTER="$(echo ${SOURCE} | sed 's/\(....\).*/\1/')" - ;; - - *) - LETTER="$(echo ${SOURCE} | sed 's/\(.\).*/\1/')" - ;; - esac - - # Install directory - mkdir -p binary/pool/main/"${LETTER}"/"${SOURCE}" - - # Move files - cp "${FILE}" binary/pool/main/"${LETTER}"/"${SOURCE}" + Install_file "${FILE}" done else Echo_error "E: Could not find cache/packages_bootstrap" @@ -294,28 +279,7 @@ if ls ../config/binary_local-debs/*_"${LH_ARCHITECTURE}".deb > /dev/null 2>&1 then for FILE in ../config/binary_local-debs/*_"${LH_ARCHITECTURE}".deb do - SOURCE="$(dpkg -f ${FILE} Source | awk '{ print $1 }')" - - if [ -z "${SOURCE}" ] - then - SOURCE="$(basename ${FILE} | awk -F_ '{ print $1 }')" - fi - - case "${SOURCE}" in - lib?*) - LETTER="$(echo ${SOURCE} | sed 's/\(....\).*/\1/')" - ;; - - *) - LETTER="$(echo ${SOURCE} | sed 's/\(.\).*/\1/')" - ;; - esac - - # Install directory - mkdir -p binary/pool/main/"${LETTER}"/"${SOURCE}" - - # Move files - cp "${FILE}" binary/pool/main/"${LETTER}"/"${SOURCE}" + Install_file "${FILE}" done fi @@ -323,28 +287,7 @@ if ls ../config/binary_local-debs/*_all.deb > /dev/null 2>&1 then for FILE in ../config/binary_local-debs/*_all.deb do - SOURCE="$(dpkg -f ${FILE} Source | awk '{ print $1 }')" - - if [ -z "${SOURCE}" ] - then - SOURCE="$(basename ${FILE} | awk -F_ '{ print $1 }')" - fi - - case "${SOURCE}" in - lib?*) - LETTER="$(echo ${SOURCE} | sed 's/\(....\).*/\1/')" - ;; - - *) - LETTER="$(echo ${SOURCE} | sed 's/\(.\).*/\1/')" - ;; - esac - - # Install directory - mkdir -p binary/pool/main/"${LETTER}"/"${SOURCE}" - - # Move files - cp "${FILE}" binary/pool/main/"${LETTER}"/"${SOURCE}" + Install_file "${FILE}" done fi |