Просмотр исходного кода

--- Merging r21317 into '.':
U rtl/unix/unixutil.pp
--- Merging r21322 into '.':
U ide/fpcompil.pas
--- Merging r21327 into '.':
U tests/utils/redir.pp
--- Merging r21331 into '.':
U packages/xforms/src/fd2pascal.pp
--- Merging r21332 into '.':
U compiler/utils/ppumove.pp
--- Merging r21341 into '.':
G tests/utils/redir.pp
--- Merging r21346 into '.':
G tests/utils/redir.pp
--- Merging r21358 into '.':
G rtl/unix/unixutil.pp

# revisions: 21317,21322,21327,21331,21332,21341,21346,21358
r21317 | marco | 2012-05-17 18:58:09 +0200 (Thu, 17 May 2012) | 2 lines
Changed paths:
M /trunk/rtl/unix/unixutil.pp

* getfs deprecated, replaced by a totally crossplatform sysutils.getfilehandle, probably already since 2.4.0
r21322 | marco | 2012-05-18 14:11:50 +0200 (Fri, 18 May 2012) | 2 lines
Changed paths:
M /trunk/ide/fpcompil.pas

* removed single remaining use of a 1.0.x deprecated function.
r21327 | marco | 2012-05-19 11:00:37 +0200 (Sat, 19 May 2012) | 2 lines
Changed paths:
M /trunk/tests/utils/redir.pp

* replaced deprecated shell by fpsystem.
r21331 | marco | 2012-05-19 12:37:05 +0200 (Sat, 19 May 2012) | 2 lines
Changed paths:
M /trunk/packages/xforms/src/fd2pascal.pp

* remove the use of unixutils and deprecated functions in it.
r21332 | marco | 2012-05-19 13:34:04 +0200 (Sat, 19 May 2012) | 2 lines
Changed paths:
M /trunk/compiler/utils/ppumove.pp

* remove used of deprecated function. Use this one from dos.
r21341 | marco | 2012-05-20 13:29:22 +0200 (Sun, 20 May 2012) | 2 lines
Changed paths:
M /trunk/tests/utils/redir.pp

* routine to transform result of fpsystem to old "shell" convention added.
r21346 | pierre | 2012-05-20 19:03:01 +0200 (Sun, 20 May 2012) | 1 line
Changed paths:
M /trunk/tests/utils/redir.pp

Fix win32 compilation
r21358 | marco | 2012-05-22 10:00:36 +0200 (Tue, 22 May 2012) | 3 lines
Changed paths:
M /trunk/rtl/unix/unixutil.pp

* more deprecations. Copies of stringtypes usually defined in unit dos, but
that are no longer needed.

git-svn-id: branches/fixes_2_6@21462 -

marco 13 лет назад
Родитель
Сommit
b01de73026
5 измененных файлов с 29 добавлено и 20 удалено
  1. 1 1
      compiler/utils/ppumove.pp
  2. 1 1
      ide/fpcompil.pas
  3. 5 9
      packages/xforms/src/fd2pascal.pp
  4. 7 7
      rtl/unix/unixutil.pp
  5. 15 2
      tests/utils/redir.pp

+ 1 - 1
compiler/utils/ppumove.pp

@@ -35,7 +35,7 @@ uses
 {$ENDIF}
 
 {$ifdef unix}
-  Baseunix,Unix, UnixUtil,
+  Baseunix,Unix, Dos,
 {$else unix}
   dos,
 {$endif unix}

+ 1 - 1
ide/fpcompil.pas

@@ -1008,7 +1008,7 @@ begin
 {$endif}
 {$ifdef Unix}
        error:=0;
-       If Shell(GetExePath+PpasFile)=-1 Then
+       If fpsystem(GetExePath+PpasFile)=-1 Then
         Error:=fpgeterrno;
 {$else}
        DosExecute(GetEnv('COMSPEC'),'/C '+GetExePath+PpasFile);

+ 5 - 9
packages/xforms/src/fd2pascal.pp

@@ -23,7 +23,7 @@ Program fd2pascal;
 uses
   baseunix,
   Unix,
-  unixutil;
+  sysutils;
 
 Const RevString = '$Revision: 1.5 $';
   NrOptions = 4;
@@ -155,17 +155,13 @@ Var
   Utilities Code
   ------------------------------------------------------------------------ }
 
-
-Function IntTostr (s : Longint) : String;
-
-var temp : String;
-
+Function BaseName(const s:ansistring;suf:ansistring):ansistring;
 begin
-  str(s,temp);
-  IntToStr:=Temp;
+  BaseName:=extractfilename(s);
+  if '.'+suf=extractfileext(s) then
+    BaseName:=changefileext(s,'');  
 end;
 
-
 Procedure EmitError (Const s : String);
 
 begin

+ 7 - 7
rtl/unix/unixutil.pp

@@ -20,11 +20,11 @@ var
   Tzseconds : Longint;
 
 Type
-  ComStr  = String[255];
-  PathStr = String[255];
-  DirStr  = String[255];
-  NameStr = String[255];
-  ExtStr  = String[255];
+  ComStr  = String[255] deprecated 'Clean up shortstring use, or use same type from unit dos.';
+  PathStr = String[255] deprecated 'Clean up shortstring use, or use same type from unit dos.';
+  DirStr  = String[255] deprecated 'Clean up shortstring use, or use same type from unit dos.';
+  NameStr = String[255] deprecated 'Clean up shortstring use, or use same type from unit dos.';
+  ExtStr  = String[255] deprecated 'Clean up shortstring use, or use same type from unit dos.';
 
 Function Dirname(Const path:pathstr):pathstr; deprecated;
 Function StringToPPChar(S: PChar;ReserveEntries:integer):ppchar;
@@ -33,8 +33,8 @@ Function StringToPPChar(Var S:AnsiString;ReserveEntries:integer):ppchar;
 function ArrayStringToPPchar(const S:Array of AnsiString;reserveentries:Longint):ppchar; // const ?
 Function Basename(Const path:pathstr;Const suf:pathstr):pathstr; deprecated;
 Function FNMatch(const Pattern,Name:string):Boolean; deprecated;
-Function GetFS (var T:Text):longint;
-Function GetFS(Var F:File):longint;
+Function GetFS (var T:Text):longint; deprecated;
+Function GetFS(Var F:File):longint; deprecated; // use sysutils.getfilehandle
 Procedure FSplit(const Path:PathStr;Var Dir:DirStr;Var Name:NameStr;Var Ext:ExtStr); deprecated;
 Function LocalToEpoch(year,month,day,hour,minute,second:Word):Longint;
 Procedure EpochToLocal(epoch:longint;var year,month,day,hour,minute,second:Word);

+ 15 - 2
tests/utils/redir.pp

@@ -973,6 +973,19 @@ end;
 {$endif not implemented}
 
 {............................................................................}
+{$ifdef UNIX}
+function TransformfpSystemToShell(s:cint):cint;
+// transforms standarized (fp)System(3) result to the conventions of the old Unix.shell function.
+begin
+ if s=-1 then exit(-1);
+ if wifexited(s) then
+   TransformfpSystemToShell:=wexitstatus(s)
+ else if (s>0) then
+   TransformfpSystemToShell:=-s
+ else
+   TransformfpSystemToShell:=s;
+end;
+{$endif def UNIX}
 
   procedure DosExecute(ProgName, ComLine : String);
 
@@ -984,10 +997,10 @@ end;
 {$ifdef usedos}
     SwapVectors;
 {$endif usedos}
-    { Must use shell() for linux for the wildcard expansion (PFV) }
+    { Must use shell/fpsystem() for *nix for the wildcard expansion (PFV) }
 {$ifdef UNIX}
     IOStatus:=0;
-    ExecuteResult:=Shell(FixPath(Progname)+' '+Comline);
+    ExecuteResult:=Transformfpsystemtoshell(fpsystem((FixPath(Progname)+' '+Comline)));
     if ExecuteResult<0 then
       begin
         IOStatus:=(-ExecuteResult) and $7f;