Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Aug 2005 12:17:18 GMT
From:      soc-saturnero <soc-saturnero@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 81775 for review
Message-ID:  <200508101217.j7ACHI5E023863@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=81775

Change 81775 by soc-saturnero@soc-saturnero_sberta on 2005/08/10 12:17:09

	Install packages only if selected arch is equal to $(uname -m)

Affected files ...

.. //depot/projects/soc2005/freesbie/ToDo#7 edit
.. //depot/projects/soc2005/freesbie/scripts/pkginstall.sh#2 edit

Differences ...

==== //depot/projects/soc2005/freesbie/ToDo#7 (text+ko) ====

@@ -14,7 +14,7 @@
 List of files to be created:
 
 /
-   configure # Dialog-based configuration toolkit, creates config.sh
+   configure # Dialog-based configuration toolkit, creates conf/freesbie.conf
    Makefile  # Launches scripts, according to the selected target
 
    #Configuration file used in the build phase

==== //depot/projects/soc2005/freesbie/scripts/pkginstall.sh#2 (text+ko) ====

@@ -12,9 +12,24 @@
     exit 1
 fi
 
+PKGFILE=${PKGFILE:-${LOCALDIR}/conf/packages};
+
+if [ ! -f ${PKGFILE} ]; then
+    return
+fi
+
+if [ "${ARCH}" != "$(uname -m)" ]; then
+    echo "----------------------------------------------------------"
+    echo "You can install packages only if your machine architecture"
+    echo "is the same of the target architecture."
+    echo "----------------------------------------------------------"
+    echo "Skipping package installation."
+    sleep 5
+    return    
+fi
+
 WORKDIR=$(mktemp -d -t freesbie)
 CHROOTWD=$(TMPDIR=${BASEDIR}/tmp mktemp -d -t freesbie)
-PKGFILE=${PKGFILE:-${LOCALDIR}/conf/packages};
 
 find_origins() {
     cd ${WORKDIR}
@@ -127,13 +142,11 @@
 
 trap "purge_wd && exit 1" INT
 
-if [ -f ${PKGFILE} ]; then
-    echo "Installing packages listed in ${PKGFILE}"
-    find_origins
-    find_deps
-    create_packages
-    delete_old_packages
-    install_packages
-fi
+echo "Installing packages listed in ${PKGFILE}"
+find_origins
+find_deps
+create_packages
+delete_old_packages
+install_packages
 
 purge_wd



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200508101217.j7ACHI5E023863>