* Have "apt-ftparchive release" strip the leading path ...
authorArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 17:04:38 +0000 (17:04 +0000)
committerArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 17:04:38 +0000 (17:04 +0000)
Author: mdz
Date: 2004-01-02 21:48:13 GMT
* Have "apt-ftparchive release" strip the leading path component from
the checksum entries

debian/changelog
ftparchive/apt-ftparchive.cc
ftparchive/writer.cc
po/apt-all.pot

index 7dece2e..50af6a1 100644 (file)
@@ -2,8 +2,10 @@ apt (0.5.18) unstable; urgency=low
 
   * New no_NO.po file from Tollef Fog Heen <tfheen@debian.org> to fix
     encoding problems (Closes: #225602)
+  * Have "apt-ftparchive release" strip the leading path component from
+    the checksum entries
 
- --
+ -- Matt Zimmerman <mdz@debian.org>  Fri,  2 Jan 2004 11:24:35 -0800
 
 apt (0.5.17) unstable; urgency=low
 
index 287f40a..64aa58f 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: apt-ftparchive.cc,v 1.11 2003/12/26 22:50:52 mdz Exp $
+// $Id: apt-ftparchive.cc,v 1.12 2004/01/02 21:48:13 mdz Exp $
 /* ######################################################################
 
    apt-scanpackages - Efficient work-alike for dpkg-scanpackages
@@ -681,11 +681,15 @@ bool SimpleGenRelease(CommandLine &CmdL)
    if (CmdL.FileSize() < 2)
       return ShowHelp(CmdL);
 
+   string Dir = CmdL.FileList[1];
+
    ReleaseWriter Release("");
+   Release.DirStrip = Dir;
+
    if (_error->PendingError() == true)
       return false;
 
-   if (Release.RecursiveScan(CmdL.FileList[1]) == false)
+   if (Release.RecursiveScan(Dir) == false)
       return false;
 
    Release.Finish();
index d7d8430..e495a4c 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: writer.cc,v 1.10 2003/12/26 23:09:30 mdz Exp $
+// $Id: writer.cc,v 1.11 2004/01/02 21:48:13 mdz Exp $
 /* ######################################################################
 
    Writer 
@@ -849,9 +849,14 @@ bool ReleaseWriter::DoPackage(string FileName)
        FileName.length() > DirStrip.length() &&
        stringcmp(FileName.begin(),FileName.begin() + DirStrip.length(),
                 DirStrip.begin(),DirStrip.end()) == 0)
+   {
       NewFileName = string(FileName.begin() + DirStrip.length(),FileName.end());
+      while (NewFileName[0] == '/')
+           NewFileName = string(FileName.begin() + 1,FileName.end());
+   }
    else 
       NewFileName = FileName;
+
    if (PathPrefix.empty() == false)
       NewFileName = flCombine(PathPrefix,NewFileName);
 
@@ -862,16 +867,16 @@ bool ReleaseWriter::DoPackage(string FileName)
       return false;
    }
 
-   CheckSums[FileName].size = fd.Size();
+   CheckSums[NewFileName].size = fd.Size();
 
    MD5Summation MD5;
    MD5.AddFD(fd.Fd(), fd.Size());
-   CheckSums[FileName].MD5 = MD5.Result();
+   CheckSums[NewFileName].MD5 = MD5.Result();
 
    fd.Seek(0);
    SHA1Summation SHA1;
    SHA1.AddFD(fd.Fd(), fd.Size());
-   CheckSums[FileName].SHA1 = SHA1.Result();
+   CheckSums[NewFileName].SHA1 = SHA1.Result();
 
    fd.Close();
    
index 7a3d481..ab453fc 100644 (file)
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2003-12-26 12:44-0800\n"
+"POT-Creation-Date: 2004-01-02 11:31-0800\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -270,6 +270,7 @@ msgid ""
 "Commands: packages binarypath [overridefile [pathprefix]]\n"
 "          sources srcpath [overridefile [pathprefix]]\n"
 "          contents path\n"
+"          release path\n"
 "          generate config [groups]\n"
 "          clean config\n"
 "\n"
@@ -305,11 +306,11 @@ msgid ""
 "  -o=?  Set an arbitary configuration option"
 msgstr ""
 
-#: ftparchive/apt-ftparchive.cc:749
+#: ftparchive/apt-ftparchive.cc:757
 msgid "No selections matched"
 msgstr ""
 
-#: ftparchive/apt-ftparchive.cc:822
+#: ftparchive/apt-ftparchive.cc:830
 #, c-format
 msgid "Some files are missing in the package file group `%s'"
 msgstr ""