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

Correct neuros problem with no source directory
Author: jgg
Date: 2002-04-24 05:02:40 GMT
Correct neuros problem with no source directory

Arch Librarian лет назад: 22
Родитель
Сommit
171c45bcc2
2 измененных файлов с 9 добавлено и 8 удалено
  1. 3 3
      apt-pkg/contrib/fileutl.cc
  2. 6 5
      ftparchive/writer.cc

+ 3 - 3
apt-pkg/contrib/fileutl.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: fileutl.cc,v 1.40 2002/04/18 05:08:49 jgg Exp $
+// $Id: fileutl.cc,v 1.41 2002/04/24 05:02:40 jgg Exp $
 /* ######################################################################
 /* ######################################################################
    
    
    File Utilities
    File Utilities
@@ -156,12 +156,12 @@ string flNotDir(string File)
 									/*}}}*/
 									/*}}}*/
 // flNotFile - Strip the file from the directory name			/*{{{*/
 // flNotFile - Strip the file from the directory name			/*{{{*/
 // ---------------------------------------------------------------------
 // ---------------------------------------------------------------------
-/* */
+/* Result ends in a / */
 string flNotFile(string File)
 string flNotFile(string File)
 {
 {
    string::size_type Res = File.rfind('/');
    string::size_type Res = File.rfind('/');
    if (Res == string::npos)
    if (Res == string::npos)
-      return File;
+      return "./";
    Res++;
    Res++;
    return string(File,0,Res);
    return string(File,0,Res);
 }
 }

+ 6 - 5
ftparchive/writer.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: writer.cc,v 1.4 2001/06/26 02:50:27 jgg Exp $
+// $Id: writer.cc,v 1.5 2002/04/24 05:02:40 jgg Exp $
 /* ######################################################################
 /* ######################################################################
 
 
    Writer 
    Writer 
@@ -603,10 +603,10 @@ bool SourcesWriter::DoPackage(string FileName)
       NewFileName = OriginalPath;
       NewFileName = OriginalPath;
    if (PathPrefix.empty() == false)
    if (PathPrefix.empty() == false)
       NewFileName = flCombine(PathPrefix,NewFileName);
       NewFileName = flCombine(PathPrefix,NewFileName);
-    
+
    string Directory = flNotFile(OriginalPath);
    string Directory = flNotFile(OriginalPath);
    string Package = Tags.FindS("Source");
    string Package = Tags.FindS("Source");
-   
+
    // Perform the delinking operation over all of the files
    // Perform the delinking operation over all of the files
    string ParseJnk;
    string ParseJnk;
    const char *C = Files;
    const char *C = Files;
@@ -633,7 +633,7 @@ bool SourcesWriter::DoPackage(string FileName)
    Directory = flNotFile(NewFileName);
    Directory = flNotFile(NewFileName);
    if (Directory.length() > 2)
    if (Directory.length() > 2)
       Directory.erase(Directory.end()-1);
       Directory.erase(Directory.end()-1);
-      
+
    // This lists all the changes to the fields we are going to make.
    // This lists all the changes to the fields we are going to make.
    // (5 hardcoded + maintainer + end marker)
    // (5 hardcoded + maintainer + end marker)
    TFRewriteData Changes[5+1+SOverItem->FieldOverride.size()+1];
    TFRewriteData Changes[5+1+SOverItem->FieldOverride.size()+1];
@@ -641,7 +641,8 @@ bool SourcesWriter::DoPackage(string FileName)
    unsigned int End = 0;
    unsigned int End = 0;
    SetTFRewriteData(Changes[End++],"Source",Package.c_str(),"Package");
    SetTFRewriteData(Changes[End++],"Source",Package.c_str(),"Package");
    SetTFRewriteData(Changes[End++],"Files",Files);
    SetTFRewriteData(Changes[End++],"Files",Files);
-   SetTFRewriteData(Changes[End++],"Directory",Directory.c_str());
+   if (Directory != "./")
+      SetTFRewriteData(Changes[End++],"Directory",Directory.c_str());
    SetTFRewriteData(Changes[End++],"Priority",BestPrio.c_str());
    SetTFRewriteData(Changes[End++],"Priority",BestPrio.c_str());
    SetTFRewriteData(Changes[End++],"Status",0);
    SetTFRewriteData(Changes[End++],"Status",0);