From 9a90709b27e356c9cd002eae00681b3edb5cb27d Mon Sep 17 00:00:00 2001
From: Robert Nelson <robertcnelson@gmail.com>
Date: Wed, 20 Feb 2013 10:28:51 -0600
Subject: [PATCH] cleanup: start unifing things, dpkg_arch

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
---
 base_image.sh      | 25 +++++++++++--------------
 build_image.sh     | 25 +++++++++++--------------
 imx_build_image.sh | 17 +++++++----------
 lxde_image.sh      | 25 +++++++++++--------------
 4 files changed, 40 insertions(+), 52 deletions(-)

diff --git a/base_image.sh b/base_image.sh
index d863f04b6..26e61ce0a 100755
--- a/base_image.sh
+++ b/base_image.sh
@@ -22,13 +22,10 @@
 
 SYST=$(uname -n)
 HOST_ARCH=$(uname -m)
-TIME=$(date +%Y-%m-%d)
 time=$(date +%Y-%m-%d)
 
 unset USE_OEM
 
-MINIMAL="-minimal"
-
 DIR=$PWD
 tempdir=$(mktemp -d)
 
@@ -60,13 +57,13 @@ function minimal_armel {
 	case "${DIST}" in
 	squeeze)
 		#http://www.debian.org/releases/squeeze/
-		export_filename="${distro}-6.0.6-minimal-${ARCH}-${time}"
+		export_filename="${distro}-6.0.6-minimal-${dpkg_arch}-${time}"
 		;;
 	quantal)
-		export_filename="${distro}-12.10-minimal-${ARCH}-${time}"
+		export_filename="${distro}-12.10-minimal-${dpkg_arch}-${time}"
 		;;
 	*)
-		export_filename="${distro}-${DIST}-minimal-${ARCH}-${time}"
+		export_filename="${distro}-${release}-minimal-${dpkg_arch}-${time}"
 		;;
 	esac
 
@@ -78,7 +75,7 @@ function minimal_armel {
 
 		distro="${distro}"
 		release="${release}"
-		dpkg_arch="${ARCH}"
+		dpkg_arch="${dpkg_arch}"
 
 		apt_proxy="${apt_proxy}"
 		base_pkg_list="${base_pkg_list}"
@@ -142,7 +139,7 @@ function quantal_release {
 
 	MIRROR="${MIRROR_UBU}"
 	COMPONENTS="${UBU_COMPONENTS}"
-	BUILD="${QUANTAL_CURRENT}${MINIMAL}-${ARCH}-${TIME}"
+
 	minimal_armel
 	compression
 }
@@ -157,7 +154,7 @@ function raring_release {
 
 	MIRROR="${MIRROR_UBU}"
 	COMPONENTS="${UBU_COMPONENTS}"
-	BUILD="${RARING_CURRENT}${MINIMAL}-${ARCH}-${TIME}"
+
 	minimal_armel
 	compression
 }
@@ -172,7 +169,7 @@ function squeeze_release {
 
 	MIRROR="${MIRROR_DEB}"
 	COMPONENTS="${DEB_COMPONENTS}"
-	BUILD="${SQUEEZE_CURRENT}${MINIMAL}-${ARCH}-${TIME}"
+
 	minimal_armel
 	compression
 }
@@ -187,7 +184,7 @@ function wheezy_release {
 
 	MIRROR="${MIRROR_DEB}"
 	COMPONENTS="${DEB_COMPONENTS}"
-	BUILD="${WHEEZY_CURRENT}${MINIMAL}-${ARCH}-${TIME}"
+
 	minimal_armel
 	compression
 }
@@ -202,7 +199,7 @@ function sid_release {
 
 	MIRROR="${MIRROR_DEB}"
 	COMPONENTS="${DEB_COMPONENTS}"
-	BUILD="${DIST}${MINIMAL}-${ARCH}-${TIME}"
+
 	minimal_armel
 	compression
 }
@@ -230,11 +227,11 @@ if [ -f ${DIR}/release ] ; then
 	chroot_ENABLE_DEB_SRC="enable"
 fi
 
-ARCH=armel
+dpkg_arch="armel"
 squeeze_release
 wheezy_release
 
-ARCH=armhf
+dpkg_arch="armhf"
 wheezy_release
 quantal_release
 raring_release
diff --git a/build_image.sh b/build_image.sh
index b42ddd5e3..92b54cc19 100755
--- a/build_image.sh
+++ b/build_image.sh
@@ -22,13 +22,10 @@
 
 SYST=$(uname -n)
 HOST_ARCH=$(uname -m)
-TIME=$(date +%Y-%m-%d)
 time=$(date +%Y-%m-%d)
 
 unset USE_OEM
 
-MINIMAL="-minimal"
-
 DIR=$PWD
 tempdir=$(mktemp -d)
 
@@ -66,13 +63,13 @@ function minimal_armel {
 	case "${DIST}" in
 	squeeze)
 		#http://www.debian.org/releases/squeeze/
-		export_filename="${distro}-6.0.6-console-${ARCH}-${time}"
+		export_filename="${distro}-6.0.6-console-${dpkg_arch}-${time}"
 		;;
 	quantal)
-		export_filename="${distro}-12.10-console-${ARCH}-${time}"
+		export_filename="${distro}-12.10-console-${dpkg_arch}-${time}"
 		;;
 	*)
-		export_filename="${distro}-${DIST}-console-${ARCH}-${time}"
+		export_filename="${distro}-${release}-console-${dpkg_arch}-${time}"
 		;;
 	esac
 
@@ -88,7 +85,7 @@ function minimal_armel {
 
 		distro="${distro}"
 		release="${release}"
-		dpkg_arch="${ARCH}"
+		dpkg_arch="${dpkg_arch}"
 
 		apt_proxy="${apt_proxy}"
 		base_pkg_list="${base_pkg_list}"
@@ -134,7 +131,7 @@ function kernel_chooser {
 			rm -f ${tempdir}/LATEST-${SUBARCH}
 		fi
 
-		wget --no-verbose --directory-prefix=${tempdir}/ http://rcn-ee.net/deb/${release}-${ARCH}/LATEST-${SUBARCH}
+		wget --no-verbose --directory-prefix=${tempdir}/ http://rcn-ee.net/deb/${release}-${dpkg_arch}/LATEST-${SUBARCH}
 		FTP_DIR=$(cat ${tempdir}/LATEST-${SUBARCH} | grep "ABI:1 ${KERNEL_ABI}" | awk '{print $3}')
 		FTP_DIR=$(echo ${FTP_DIR} | awk -F'/' '{print $6}')
 	else
@@ -183,7 +180,7 @@ function quantal_release {
 
 	MIRROR="${MIRROR_UBU}"
 	COMPONENTS="${UBU_COMPONENTS}"
-	BUILD="${QUANTAL_CURRENT}${MINIMAL}-${ARCH}-${TIME}"
+
 	minimal_armel
 	compression
 }
@@ -198,7 +195,7 @@ function raring_release {
 
 	MIRROR="${MIRROR_UBU}"
 	COMPONENTS="${UBU_COMPONENTS}"
-	BUILD="${RARING_CURRENT}${MINIMAL}-${ARCH}-${TIME}"
+
 	minimal_armel
 	compression
 }
@@ -213,7 +210,7 @@ function squeeze_release {
 
 	MIRROR="${MIRROR_DEB}"
 	COMPONENTS="${DEB_COMPONENTS}"
-	BUILD="${SQUEEZE_CURRENT}${MINIMAL}-${ARCH}-${TIME}"
+
 	minimal_armel
 	compression
 }
@@ -228,7 +225,7 @@ function wheezy_release {
 
 	MIRROR="${MIRROR_DEB}"
 	COMPONENTS="${DEB_COMPONENTS}"
-	BUILD="${WHEEZY_CURRENT}${MINIMAL}-${ARCH}-${TIME}"
+
 	minimal_armel
 	compression
 }
@@ -243,7 +240,7 @@ function sid_release {
 
 	MIRROR="${MIRROR_DEB}"
 	COMPONENTS="${DEB_COMPONENTS}"
-	BUILD="${DIST}${MINIMAL}-${ARCH}-${TIME}"
+
 	minimal_armel
 	compression
 }
@@ -272,7 +269,7 @@ if [ -f ${DIR}/release ] ; then
 	chroot_ENABLE_DEB_SRC="enable"
 fi
 
-ARCH=armhf
+dpkg_arch="armhf"
 quantal_release
 raring_release
 
diff --git a/imx_build_image.sh b/imx_build_image.sh
index ff576bfa3..1c98c162a 100755
--- a/imx_build_image.sh
+++ b/imx_build_image.sh
@@ -22,13 +22,10 @@
 
 SYST=$(uname -n)
 HOST_ARCH=$(uname -m)
-TIME=$(date +%Y-%m-%d)
 time=$(date +%Y-%m-%d)
 
 unset USE_OEM
 
-MINIMAL="-minimal"
-
 DIR=$PWD
 tempdir=$(mktemp -d)
 
@@ -66,13 +63,13 @@ function minimal_armel {
 	case "${DIST}" in
 	squeeze)
 		#http://www.debian.org/releases/squeeze/
-		export_filename="${distro}-6.0.6-console-${ARCH}-${time}"
+		export_filename="${distro}-6.0.6-console-${dpkg_arch}-${time}"
 		;;
 	quantal)
-		export_filename="${distro}-12.10-console-${ARCH}-${time}"
+		export_filename="${distro}-12.10-console-${dpkg_arch}-${time}"
 		;;
 	*)
-		export_filename="${distro}-${DIST}-console-${ARCH}-${time}"
+		export_filename="${distro}-${release}-console-${dpkg_arch}-${time}"
 		;;
 	esac
 
@@ -84,7 +81,7 @@ function minimal_armel {
 
 		distro="${distro}"
 		release="${release}"
-		dpkg_arch="${ARCH}"
+		dpkg_arch="${dpkg_arch}"
 
 		apt_proxy="${apt_proxy}"
 		base_pkg_list="${base_pkg_list}"
@@ -130,7 +127,7 @@ function kernel_chooser {
 			rm -f ${tempdir}/LATEST-${SUBARCH}
 		fi
 
-		wget --no-verbose --directory-prefix=${tempdir}/ http://rcn-ee.net/deb/${release}-${ARCH}/LATEST-${SUBARCH}
+		wget --no-verbose --directory-prefix=${tempdir}/ http://rcn-ee.net/deb/${release}-${dpkg_arch}/LATEST-${SUBARCH}
 		FTP_DIR=$(cat ${tempdir}/LATEST-${SUBARCH} | grep "ABI:1 ${KERNEL_ABI}" | awk '{print $3}')
 		FTP_DIR=$(echo ${FTP_DIR} | awk -F'/' '{print $6}')
 	else
@@ -169,7 +166,7 @@ function wheezy_release {
 
 	MIRROR="${MIRROR_DEB}"
 	COMPONENTS="${DEB_COMPONENTS}"
-	BUILD="${WHEEZY_CURRENT}${MINIMAL}-${ARCH}-${TIME}"
+
 	minimal_armel
 	compression
 }
@@ -198,7 +195,7 @@ if [ -f ${DIR}/release ] ; then
 	chroot_ENABLE_DEB_SRC="enable"
 fi
 
-ARCH=armhf
+dpkg_arch="armhf"
 wheezy_release
 
 echo "done"
diff --git a/lxde_image.sh b/lxde_image.sh
index 89c827f8d..ba1326883 100755
--- a/lxde_image.sh
+++ b/lxde_image.sh
@@ -22,13 +22,10 @@
 
 SYST=$(uname -n)
 HOST_ARCH=$(uname -m)
-TIME=$(date +%Y-%m-%d)
 time=$(date +%Y-%m-%d)
 
 unset USE_OEM
 
-MINIMAL="-lxde"
-
 DIR=$PWD
 tempdir=$(mktemp -d)
 
@@ -66,13 +63,13 @@ function minimal_armel {
 	case "${DIST}" in
 	squeeze)
 		#http://www.debian.org/releases/squeeze/
-		export_filename="${distro}-6.0.6-lxde-${ARCH}-${time}"
+		export_filename="${distro}-6.0.6-lxde-${dpkg_arch}-${time}"
 		;;
 	quantal)
-		export_filename="${distro}-12.10-lxde-${ARCH}-${time}"
+		export_filename="${distro}-12.10-lxde-${dpkg_arch}-${time}"
 		;;
 	*)
-		export_filename="${distro}-${DIST}-lxde-${ARCH}-${time}"
+		export_filename="${distro}-${release}-lxde-${dpkg_arch}-${time}"
 		;;
 	esac
 
@@ -84,7 +81,7 @@ function minimal_armel {
 
 		distro="${distro}"
 		release="${release}"
-		dpkg_arch="${ARCH}"
+		dpkg_arch="${dpkg_arch}"
 
 		apt_proxy="${apt_proxy}"
 		base_pkg_list="${base_pkg_list}"
@@ -130,7 +127,7 @@ function kernel_chooser {
 			rm -f ${tempdir}/LATEST-${SUBARCH}
 		fi
 
-		wget --no-verbose --directory-prefix=${tempdir}/ http://rcn-ee.net/deb/${release}-${ARCH}/LATEST-${SUBARCH}
+		wget --no-verbose --directory-prefix=${tempdir}/ http://rcn-ee.net/deb/${release}-${dpkg_arch}/LATEST-${SUBARCH}
 		FTP_DIR=$(cat ${tempdir}/LATEST-${SUBARCH} | grep "ABI:1 ${KERNEL_ABI}" | awk '{print $3}')
 		FTP_DIR=$(echo ${FTP_DIR} | awk -F'/' '{print $6}')
 	else
@@ -174,7 +171,7 @@ function quantal_release {
 
 	MIRROR="${MIRROR_UBU}"
 	COMPONENTS="${UBU_COMPONENTS}"
-	BUILD="${QUANTAL_CURRENT}${MINIMAL}-${ARCH}-${TIME}"
+
 	minimal_armel
 	compression
 }
@@ -189,7 +186,7 @@ function raring_release {
 
 	MIRROR="${MIRROR_UBU}"
 	COMPONENTS="${UBU_COMPONENTS}"
-	BUILD="${RARING_CURRENT}${MINIMAL}-${ARCH}-${TIME}"
+
 	minimal_armel
 	compression
 }
@@ -204,7 +201,7 @@ function squeeze_release {
 
 	MIRROR="${MIRROR_DEB}"
 	COMPONENTS="${DEB_COMPONENTS}"
-	BUILD="${SQUEEZE_CURRENT}${MINIMAL}-${ARCH}-${TIME}"
+
 	minimal_armel
 	compression
 }
@@ -219,7 +216,7 @@ function wheezy_release {
 
 	MIRROR="${MIRROR_DEB}"
 	COMPONENTS="${DEB_COMPONENTS}"
-	BUILD="${WHEEZY_CURRENT}${MINIMAL}-${ARCH}-${TIME}"
+
 	minimal_armel
 	compression
 }
@@ -234,7 +231,7 @@ function sid_release {
 
 	MIRROR="${MIRROR_DEB}"
 	COMPONENTS="${DEB_COMPONENTS}"
-	BUILD="${DIST}${MINIMAL}-${ARCH}-${TIME}"
+
 	minimal_armel
 	compression
 }
@@ -263,7 +260,7 @@ if [ -f ${DIR}/release ] ; then
 	chroot_ENABLE_DEB_SRC="enable"
 fi
 
-ARCH=armhf
+dpkg_arch="armhf"
 quantal_release
 raring_release
 
-- 
GitLab