diff options
author | Chris Lamb <chris@chris-lamb.co.uk> | 2008-01-15 02:43:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 18:35:35 +0100 |
commit | 295542614d7e44854df47e17c348e5f1f4187d58 (patch) | |
tree | 1aed123662ad0ddc194ad3ffd21c7690d06f93b7 /helpers | |
parent | 716d31d5877dc5d7f4f0182d7a9aaabca825231e (diff) | |
download | vyos-live-build-295542614d7e44854df47e17c348e5f1f4187d58.tar.gz vyos-live-build-295542614d7e44854df47e17c348e5f1f4187d58.zip |
Refactor installing file to binary/pool/main/./.* functionality.
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 |