[slack-ru] Проблемы с j2sdk-1.4.2_09 и Point2Play

  • From: "Dmitry A. Koptev" <dimez@xxxxx>
  • To: slack-ru@xxxxxxxxxxxxx
  • Date: Thu, 27 Oct 2005 15:53:21 +0400

В последних версиях coreutils изменился синтаксис tail и head, в связи с чем некоторые программы отказываются нормально работать(или ставиться).
Например j2sdk-1.4.2_09 или Point2play.
Надеюсь, мои решения кому-то пригодятся.


Солюшн для джавы:

--- j2sdk-1_4_2_09-linux-i586.bin.orig 2005-10-24 14:56:06.000000000 +0400
+++ j2sdk-1_4_2_09-linux-i586.bin 2005-10-24 14:55:21.000000000 +0400
@@ -355,7 +355,7 @@
esac
done
outname=install.sfx.$$
-diskSpace=`df -k . | tail -1 | awk '{if ( $4 ~ /%/) { print $3 } else { print $4 } }'`
+diskSpace=`df -k . | tail -n -1 | awk '{if ( $4 ~ /%/) { print $3 } else { print $4 } }'`
if [ $diskSpace -lt $diskSpaceRequired ]; then
printf "You will need atleast %s kBytes of Disk Free\n" $diskSpaceRequired
printf "Please free up the required Disk Space and try again\n"
@@ -363,7 +363,7 @@
fi
trap 'rm -f $outname; exit 1' HUP INT QUIT TERM
echo "Unpacking..."
-tail +511 $0 > $outname
+tail -n +511 $0 > $outname
if [ -x /usr/bin/sum ] ; then
echo "Checksumming..."



Солюшн для Point2Play:
1) Заменить установленный файл /usr/lib/transgaming_point2play/setup_wizard_gui.py новым с http://downloads.transgaming.com/misc_downloads/point2play_2.0.3/setup_wizard_gui.py
2) Применить патч:


--- system_detection.orig       2005-10-27 15:34:22.000000000 +0400
+++ system_detection.py 2005-10-27 15:42:26.000000000 +0400
@@ -51,7 +51,7 @@

def detect_cpu():
if os.path.exists("/proc/cpuinfo"):
- pipeFile = os.popen("grep 'model name' /proc/cpuinfo | tail -1 | awk -F': ' '{print $2}'")
+ pipeFile = os.popen("grep 'model name' /proc/cpuinfo | tail -n -1 | awk -F': ' '{print $2}'")
cpu = pipeFile.readline()
return cpu[:-1]
return ""
@@ -59,7 +59,7 @@
def detect_cpu_ghz():
if os.path.exists("/proc/cpuinfo"):
# fixme - does /proc/cpuinfo *always* store this as MHz?
- pipeFile = os.popen("grep 'MHz' /proc/cpuinfo | tail -1 | awk -F': ' '{print $2}'")
+ pipeFile = os.popen("grep 'MHz' /proc/cpuinfo | tail -n -1 | awk -F': ' '{print $2}'")
cpu_mhz = pipeFile.readline()
cpu_mhz = float(cpu_mhz[:-1])
# now convert to ghz and round
@@ -204,7 +204,7 @@
def get_firstline(filename):
""" Returns the first line of a file. """


-    pipeFile = os.popen("head -1 " + filename)
+    pipeFile = os.popen("head -n -1 " + filename)
     contents = pipeFile.readline()
     status = pipeFile.close()
     if status:

--
WBR Dmitry


Other related posts: