[Debian-live-changes] r2261 - in dists/trunk/live-helper: docs functions helpers
otavio at alioth.debian.org
otavio at alioth.debian.org
Wed Jun 27 20:09:56 UTC 2007
Author: otavio
Date: 2007-06-27 20:09:56 +0000 (Wed, 27 Jun 2007)
New Revision: 2261
Added:
dists/trunk/live-helper/functions/arch.sh
Modified:
dists/trunk/live-helper/docs/ChangeLog
dists/trunk/live-helper/helpers/lh_binary_grub
dists/trunk/live-helper/helpers/lh_binary_syslinux
dists/trunk/live-helper/helpers/lh_binary_yaboot
Log:
Add Validade_architecture and use it on helpers
Modified: dists/trunk/live-helper/docs/ChangeLog
===================================================================
--- dists/trunk/live-helper/docs/ChangeLog 2007-06-27 19:58:40 UTC (rev 2260)
+++ dists/trunk/live-helper/docs/ChangeLog 2007-06-27 20:09:56 UTC (rev 2261)
@@ -1,5 +1,11 @@
2007-06-27 Otavio Salvador <otavio at debian.org>
+ * functions/arch.sh:
+ - Added.
+ * helpers/lh_binary_grub, helpers/lh_binary_syslinux,
+ helpers/lh_binary_yaboot:
+ - Use the new Check_architecture method to avoid duplicated code.
+
* functions/templates.sh:
- Added.
* helpers/lh_binary_grub, helpers/lh_binary_syslinux,
Added: dists/trunk/live-helper/functions/arch.sh
===================================================================
--- dists/trunk/live-helper/functions/arch.sh (rev 0)
+++ dists/trunk/live-helper/functions/arch.sh 2007-06-27 20:09:56 UTC (rev 2261)
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# arch.sh - handle arch support
+# Copyright (C) 2007 Otavio Salvador <otavio at debian.org>
+#
+# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
+# This is free software, and you are welcome to redistribute it
+# under certain conditions; see COPYING for details.
+
+set -ex
+
+Check_architecture ()
+{
+ ARCHS="$@"
+ VALID=false
+
+ for arch in $ARCHS; do
+ if [ $arch = ${LIVE_ARCHITECTURE} ]
+ then
+ VALID=true
+ break
+ fi
+ done
+
+ if [ "${VALID}" = false ]
+ then
+ Echo_warning "skipping $0, foreign architecture."
+ exit 0
+ fi
+}
Modified: dists/trunk/live-helper/helpers/lh_binary_grub
===================================================================
--- dists/trunk/live-helper/helpers/lh_binary_grub 2007-06-27 19:58:40 UTC (rev 2260)
+++ dists/trunk/live-helper/helpers/lh_binary_grub 2007-06-27 20:09:56 UTC (rev 2261)
@@ -54,11 +54,8 @@
# Creating lock file
Create_lockfile .lock
-if [ "${LIVE_ARCHITECTURE}" != "amd64" ] && [ "${LIVE_ARCHITECTURE}" != "i386" ]
-then
- Echo_warning "skipping binary_grub, foreign architecture."
- exit 0
-fi
+# Check architecture
+Check_architecture amd64 i386
# Checking depends
Check_package chroot/usr/sbin/grub grub
Modified: dists/trunk/live-helper/helpers/lh_binary_syslinux
===================================================================
--- dists/trunk/live-helper/helpers/lh_binary_syslinux 2007-06-27 19:58:40 UTC (rev 2260)
+++ dists/trunk/live-helper/helpers/lh_binary_syslinux 2007-06-27 20:09:56 UTC (rev 2261)
@@ -54,11 +54,8 @@
# Creating lock file
Create_lockfile .lock
-if [ "${LIVE_ARCHITECTURE}" != "amd64" ] && [ "${LIVE_ARCHITECTURE}" != "i386" ]
-then
- Echo_warning "skipping binary_syslinux, foreign architecture."
- exit 0
-fi
+# Check architecture
+Check_architecture amd64 i386
# Checking depends
Check_package chroot/usr/bin/syslinux syslinux
Modified: dists/trunk/live-helper/helpers/lh_binary_yaboot
===================================================================
--- dists/trunk/live-helper/helpers/lh_binary_yaboot 2007-06-27 19:58:40 UTC (rev 2260)
+++ dists/trunk/live-helper/helpers/lh_binary_yaboot 2007-06-27 20:09:56 UTC (rev 2261)
@@ -54,11 +54,8 @@
# Creating lock file
Create_lockfile .lock
-if [ "${LIVE_ARCHITECTURE}" != "powerpc" ] && [ "${LIVE_ARCHITECTURE}" != "ppc64" ]
-then
- Echo_warning "skipping binary_yaboot, foreign architecture."
- #exit 0 # REMOVE_ME
-fi
+# Check architecture
+Check_architecture powerpc ppc64
# Checking depends
Check_package chroot/usr/lib/yaboot/yaboot yaboot
More information about the Debian-live-changes
mailing list