oiteam team mailing list archive
-
oiteam team
-
Mailing list archive
-
Message #00033
[Branch ~oiteam/pmmc-pte-pai/trunk] Rev 24: Universalize postinst scripts
------------------------------------------------------------
revno: 24
git commit: 3eedca465c83c5c18b2b5e9aa65d39ec513be162
committer: Laércio de Sousa <lbsousajr@xxxxxxxxx>
timestamp: Mon 2012-05-21 16:40:12 -0300
message:
Universalize postinst scripts
- Use contents of /etc/lsb-release to distinguish between hardy and others.
modified:
debian/pai-data-installer.postinst
debian/pai-doc-installer.postinst
--
lp:pmmc-pte-pai
https://code.launchpad.net/~oiteam/pmmc-pte-pai/trunk
Your team Orientadores de Informática is subscribed to branch lp:pmmc-pte-pai.
To unsubscribe from this branch go to https://code.launchpad.net/~oiteam/pmmc-pte-pai/trunk/+edit-subscription
=== modified file 'debian/pai-data-installer.postinst'
--- debian/pai-data-installer.postinst 2012-05-21 19:14:46 +0000
+++ debian/pai-data-installer.postinst 2012-05-21 19:40:12 +0000
@@ -19,10 +19,22 @@
. /usr/share/debconf/confmodule
. /usr/share/pai/functions
+. /etc/lsb-release
+
+case "${DISTRIB_CODENAME}" in
+ "hardy")
+ GIT_PROTOCOL="git"
+ MKTEMP_OPTS="-t"
+ ;;
+
+ *)
+ GIT_PROTOCOL="https"
+ MKTEMP_OPTS="--tmpdir"
+ ;;
+esac
CACHE_DIR=/var/opt/pmmc/pte/cache
-TEMP=`mktemp -d --tmpdir pai-unpack-XXXXXX`
-GIT_PROTOCOL="https"
+TEMP=`mktemp -d ${MKTEMP_OPTS} pai-unpack-XXXXXX`
exit_with_error() {
echo "PAI data is NOT installed."
@@ -129,7 +141,7 @@
prepatch_data() {
DATA_DEST=/opt/pmmc/pte/pai
- PAI_TEMP_DIR=`mktemp -d --tmpdir pai-patchset-XXXXXX`
+ PAI_TEMP_DIR=`mktemp -d ${MKTEMP_OPTS} pai-patchset-XXXXXX`
echo "Fetching patches from GitHub..."
(cd ${PAI_TEMP_DIR}
git clone ${GIT_PROTOCOL}://github.com/oiteam/pmmc-pte-pai-patchset.git
=== modified file 'debian/pai-doc-installer.postinst'
--- debian/pai-doc-installer.postinst 2012-05-21 17:04:41 +0000
+++ debian/pai-doc-installer.postinst 2012-05-21 19:40:12 +0000
@@ -19,9 +19,20 @@
. /usr/share/debconf/confmodule
. /usr/share/pai/functions
+. /etc/lsb-release
+
+case "${DISTRIB_CODENAME}" in
+ "hardy")
+ MKTEMP_OPTS="-t"
+ ;;
+
+ *)
+ MKTEMP_OPTS="--tmpdir"
+ ;;
+esac
CACHE_DIR=/var/opt/pmmc/pte/cache
-TEMP=`mktemp -d --tmpdir pai-unpack-XXXXXX`
+TEMP=`mktemp -d ${MKTEMP_OPTS} pai-unpack-XXXXXX`
exit_with_error() {
echo "PAI documentation is NOT installed."