summaryrefslogtreecommitdiff
path: root/lang/squeak-dev/files/patch-platforms__unix__npsqueak__npsqueakrun.in
blob: 0a6058b52ab462176ee80f2eb3d70518f85b9658 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
--- platforms/unix/npsqueak/npsqueakrun.in.orig	Sun Mar 20 05:38:26 2005
+++ platforms/unix/npsqueak/npsqueakrun.in	Sun Jan  7 16:30:12 2007
@@ -1,4 +1,4 @@
-#! /bin/bash
+#! %%LOCALBASE%%/bin/bash
 
 # File:        npsqueakrun
 # Author:      Bert Freudenberg
@@ -60,12 +60,24 @@
 ensurefile()
 {
     if [ ! -e "${1}" ] ; then
-	if cp "${2}" "${1}" ; then
-	    pdebug "Created ${1}"
+	if [ -e "${2}" ] ;then
+	    if cp "${2}" "${1}" ; then
+		pdebug "Created ${1}"
+	    else
+		perror "Could not create ${1}"
+		if [ ! -r "${2}" ] ; then
+		    perror "because ${2} is missing"
+		fi
+	    fi
 	else
-	    perror "Could not create ${1}"
-	    if [ ! -r "${2}" ] ; then
-		perror "because ${2} is missing"
+	    if [ -e "${2}.gz" ] ; then
+		gunzip -c "${2}.gz" > "${1}"
+		pdebug "Created ${1} from ${2}.gz"
+	    else
+		perror "Could not create ${1}"
+		if [ ! -r "${2}" ] ; then
+		    perror "because ${2} is missing"
+		fi
 	    fi
 	fi
     fi