[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tyndur-devel] [PATCH] + lpt: Repository-Typen



On Thu, May 14 19:05, Alexander Siol wrote:
> diff --git a/trunk/src/modules/pas/lpt/repositories.pas b/trunk/src/modules/pas/lpt/repositories.pas
> index 7484ab6..6d998bd 100644
> --- a/trunk/src/modules/pas/lpt/repositories.pas
> +++ b/trunk/src/modules/pas/lpt/repositories.pas
> @@ -9,6 +9,7 @@ type
>          public
>              name:   String;
>              url:    String;
> +            repostype: String;
>      end;
>  
>  
> @@ -27,7 +28,9 @@ var
>      f: Text;
>      name: String;
>      url: String;
> +    repostype: String;

Hm hier vielleicht besser ein enum? Also das Pascal-Pendant, wie das da
offizell heisst weiss ich nicht. ;-)

>      space: integer;
> +    protofinder: integer;
>  begin
>      Assign(f, filename);
>      Reset(f);
> @@ -44,6 +47,12 @@ begin
>          if  space > 0 then begin
>              name := Copy(url, 1, space - 1);
>              url := Copy(url, space + 1, length(url));
> +            protofinder := Pos('http://', url);
> +            if protofinder > 0 then begin
> +                repostype := 'http';
> +            end else begin
> +                repostype := 'file';
> +            end
>          end else begin
>              WriteLn('Ungueltige Paketquelle: ' + url);
>              continue;
> @@ -53,6 +62,7 @@ begin
>          repo := TRepository(repos.add());
>          repo.name := name;
>          repo.url := url;
> +        repo.repostype := repostype;
>      end;
>      Close(f);
>  end;

Sonst sieht das, soweit ich es beurteilen kann, gut aus.

-- 
Antoine Kaufmann
<toni@xxxxxxxxxxxxxxxx>

Attachment: pgphlQusy8XcL.pgp
Description: PGP signature