Преглед изворни кода

First draft of make system and name change to apt-pkg
Author: jgg
Date: 1998-07-12 23:58:20 GMT
First draft of make system and name change to apt-pkg

Arch Librarian пре 22 година
родитељ
комит
094a497dd2

+ 4 - 4
apt-pkg/algorithms.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: algorithms.cc,v 1.2 1998/07/12 01:25:59 jgg Exp $
+// $Id: algorithms.cc,v 1.3 1998/07/12 23:58:20 jgg Exp $
 /* ######################################################################
 
    Algorithms - A set of misc algorithms
@@ -9,10 +9,10 @@
 									/*}}}*/
 // Include Files							/*{{{*/
 #ifdef __GNUG__
-#pragma implementation "pkglib/algorithms.h"
+#pragma implementation "apt-pkg/algorithms.h"
 #endif 
-#include <pkglib/algorithms.h>
-#include <pkglib/error.h>
+#include <apt-pkg/algorithms.h>
+#include <apt-pkg/error.h>
 #include <iostream.h>
 									/*}}}*/
 

+ 4 - 4
apt-pkg/algorithms.h

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: algorithms.h,v 1.1 1998/07/07 04:17:00 jgg Exp $
+// $Id: algorithms.h,v 1.2 1998/07/12 23:58:22 jgg Exp $
 /* ######################################################################
 
    Algorithms - A set of misc algorithms
@@ -22,11 +22,11 @@
 #define PKGLIB_ALGORITHMS_H
 
 #ifdef __GNUG__
-#pragma interface "pkglib/algorithms.h"
+#pragma interface "apt-pkg/algorithms.h"
 #endif 
 
-#include <pkglib/packagemanager.h>
-#include <pkglib/depcache.h>
+#include <apt-pkg/packagemanager.h>
+#include <apt-pkg/depcache.h>
 
 class pkgSimulate : public pkgPackageManager
 {

+ 3 - 3
apt-pkg/cacheiterators.h

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: cacheiterators.h,v 1.5 1998/07/12 01:26:00 jgg Exp $
+// $Id: cacheiterators.h,v 1.6 1998/07/12 23:58:23 jgg Exp $
 /* ######################################################################
    
    Cache Iterators - Iterators for navigating the cache structure
@@ -24,7 +24,7 @@
    that has the depends pointer as a member. The provide iterator has the
    same system.
    
-   This header is not user includable, please use pkglib/pkgcache.h
+   This header is not user includable, please use apt-pkg/pkgcache.h
    
    ##################################################################### */
 									/*}}}*/
@@ -33,7 +33,7 @@
 #define PKGLIB_CACHEITERATORS_H
 
 #ifdef __GNUG__
-#pragma interface "pkglib/cacheiterators.h"
+#pragma interface "apt-pkg/cacheiterators.h"
 #endif 
 
 // Package Iterator

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

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: configuration.cc,v 1.2 1998/07/09 05:12:33 jgg Exp $
+// $Id: configuration.cc,v 1.3 1998/07/12 23:58:44 jgg Exp $
 /* ######################################################################
 
    Configuration Class
@@ -13,9 +13,9 @@
 									/*}}}*/
 // Include files							/*{{{*/
 #ifdef __GNUG__
-#pragma implementation "pkglib/configuration.h"
+#pragma implementation "apt-pkg/configuration.h"
 #endif
-#include <pkglib/configuration.h>
+#include <apt-pkg/configuration.h>
 #include <strutl.h>
 
 #include <stdio.h>

+ 2 - 2
apt-pkg/contrib/configuration.h

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: configuration.h,v 1.2 1998/07/09 05:12:34 jgg Exp $
+// $Id: configuration.h,v 1.3 1998/07/12 23:58:45 jgg Exp $
 /* ######################################################################
 
    Configuration Class
@@ -25,7 +25,7 @@
 #define PKGLIB_CONFIGURATION_H
 
 #ifdef __GNUG__
-#pragma interface "pkglib/configuration.h"
+#pragma interface "apt-pkg/configuration.h"
 #endif 
 
 #include <string>

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

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: error.cc,v 1.2 1998/07/07 04:17:10 jgg Exp $
+// $Id: error.cc,v 1.3 1998/07/12 23:58:46 jgg Exp $
 /* ######################################################################
    
    Global Erorr Class - Global error mechanism
@@ -15,7 +15,7 @@
 									/*}}}*/
 // Include Files							/*{{{*/
 #ifdef __GNUG__
-#pragma implementation "pkglib/error.h"
+#pragma implementation "apt-pkg/error.h"
 #endif 
 
 #include <errno.h>
@@ -23,7 +23,7 @@
 #include <string.h>
 #include <stdarg.h>
 
-#include <pkglib/error.h>
+#include <apt-pkg/error.h>
    									/*}}}*/
 
 GlobalError *_error = new GlobalError;

+ 2 - 2
apt-pkg/contrib/error.h

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: error.h,v 1.2 1998/07/07 04:17:11 jgg Exp $
+// $Id: error.h,v 1.3 1998/07/12 23:58:47 jgg Exp $
 /* ######################################################################
    
    Global Erorr Class - Global error mechanism
@@ -42,7 +42,7 @@
 #define PKGLIB_ERROR_H
 
 #ifdef __GNUG__
-#pragma interface "pkglib/error.h"
+#pragma interface "apt-pkg/error.h"
 #endif 
 
 #include <string>

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

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: fileutl.cc,v 1.3 1998/07/07 04:17:12 jgg Exp $
+// $Id: fileutl.cc,v 1.4 1998/07/12 23:58:48 jgg Exp $
 /* ######################################################################
    
    File Utilities
@@ -15,10 +15,10 @@
 									/*}}}*/
 // Include Files							/*{{{*/
 #ifdef __GNUG__
-#pragma implementation "pkglib/fileutl.h"
+#pragma implementation "apt-pkg/fileutl.h"
 #endif 
-#include <pkglib/fileutl.h>
-#include <pkglib/error.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/error.h>
 
 #include <unistd.h>
 #include <sys/stat.h>

+ 2 - 2
apt-pkg/contrib/fileutl.h

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: fileutl.h,v 1.2 1998/07/07 04:17:13 jgg Exp $
+// $Id: fileutl.h,v 1.3 1998/07/12 23:58:49 jgg Exp $
 /* ######################################################################
    
    File Utilities
@@ -23,7 +23,7 @@
 #define PKGLIB_FILEUTL_H
 
 #ifdef __GNUG__
-#pragma interface "pkglib/fileutl.h"
+#pragma interface "apt-pkg/fileutl.h"
 #endif 
 
 #include <string>

+ 4 - 4
apt-pkg/contrib/mmap.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: mmap.cc,v 1.4 1998/07/07 04:17:14 jgg Exp $
+// $Id: mmap.cc,v 1.5 1998/07/12 23:58:50 jgg Exp $
 /* ######################################################################
    
    MMap Class - Provides 'real' mmap or a faked mmap using read().
@@ -22,12 +22,12 @@
 									/*}}}*/
 // Include Files							/*{{{*/
 #ifdef __GNUG__
-#pragma implementation "pkglib/mmap.h"
+#pragma implementation "apt-pkg/mmap.h"
 #endif 
 
 #define _BSD_SOURCE
-#include <pkglib/mmap.h>
-#include <pkglib/error.h>
+#include <apt-pkg/mmap.h>
+#include <apt-pkg/error.h>
 
 #include <sys/mman.h>
 #include <sys/stat.h>

+ 3 - 3
apt-pkg/contrib/mmap.h

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: mmap.h,v 1.3 1998/07/07 04:17:15 jgg Exp $
+// $Id: mmap.h,v 1.4 1998/07/12 23:58:51 jgg Exp $
 /* ######################################################################
    
    MMap Class - Provides 'real' mmap or a faked mmap using read().
@@ -27,11 +27,11 @@
 #define PKGLIB_MMAP_H
 
 #ifdef __GNUG__
-#pragma interface "pkglib/mmap.h"
+#pragma interface "apt-pkg/mmap.h"
 #endif
 
 #include <string>
-#include <pkglib/fileutl.h>
+#include <apt-pkg/fileutl.h>
 
 class MMap
 {

+ 4 - 4
apt-pkg/deb/deblistparser.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: deblistparser.cc,v 1.5 1998/07/09 05:12:37 jgg Exp $
+// $Id: deblistparser.cc,v 1.6 1998/07/12 23:58:52 jgg Exp $
 /* ######################################################################
    
    Package Cache Generator - Generator for the cache structure.
@@ -10,9 +10,9 @@
    ##################################################################### */
 									/*}}}*/
 // Include Files							/*{{{*/
-#include <pkglib/deblistparser.h>
-#include <pkglib/error.h>
-#include <pkglib/configuration.h>
+#include <apt-pkg/deblistparser.h>
+#include <apt-pkg/error.h>
+#include <apt-pkg/configuration.h>
 #include <strutl.h>
 
 #include <system.h>

+ 3 - 3
apt-pkg/deb/deblistparser.h

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: deblistparser.h,v 1.3 1998/07/05 05:34:01 jgg Exp $
+// $Id: deblistparser.h,v 1.4 1998/07/12 23:58:54 jgg Exp $
 /* ######################################################################
    
    Debian Package List Parser - This implements the abstract parser 
@@ -12,8 +12,8 @@
 #ifndef PKGLIB_DEBLISTPARSER_H
 #define PKGLIB_DEBLISTPARSER_H
 
-#include <pkglib/pkgcachegen.h>
-#include <pkglib/tagfile.h>
+#include <apt-pkg/pkgcachegen.h>
+#include <apt-pkg/tagfile.h>
 
 class debListParser : public pkgCacheGenerator::ListParser
 {

+ 5 - 5
apt-pkg/depcache.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: depcache.cc,v 1.1 1998/07/07 04:17:01 jgg Exp $
+// $Id: depcache.cc,v 1.2 1998/07/12 23:58:24 jgg Exp $
 /* ######################################################################
 
    Dependency Cache - Caches Dependency information.
@@ -9,12 +9,12 @@
 									/*}}}*/
 // Include Files							/*{{{*/
 #ifdef __GNUG__
-#pragma implementation "pkglib/depcache.h"
+#pragma implementation "apt-pkg/depcache.h"
 #endif
-#include <pkglib/depcache.h>
+#include <apt-pkg/depcache.h>
 
-#include <pkglib/version.h>
-#include <pkglib/error.h>
+#include <apt-pkg/version.h>
+#include <apt-pkg/error.h>
 									/*}}}*/
 
 // DepCache::pkgDepCache - Constructors					/*{{{*/

+ 3 - 3
apt-pkg/depcache.h

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: depcache.h,v 1.2 1998/07/12 01:26:01 jgg Exp $
+// $Id: depcache.h,v 1.3 1998/07/12 23:58:25 jgg Exp $
 /* ######################################################################
 
    DepCache - Dependency Extension data for the cache
@@ -40,10 +40,10 @@
 #define PKGLIB_DEPCACHE_H
 
 #ifdef __GNUG__
-#pragma interface "pkglib/depcache.h"
+#pragma interface "apt-pkg/depcache.h"
 #endif
 
-#include <pkglib/pkgcache.h>
+#include <apt-pkg/pkgcache.h>
 
 class pkgDepCache : public pkgCache
 {

+ 2 - 2
apt-pkg/init.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: init.cc,v 1.1 1998/07/09 05:12:27 jgg Exp $
+// $Id: init.cc,v 1.2 1998/07/12 23:58:26 jgg Exp $
 /* ######################################################################
 
    Init - Initialize the package library
@@ -8,7 +8,7 @@
    ##################################################################### */
 									/*}}}*/
 // Include files							/*{{{*/
-#include <pkglib/init.h>
+#include <apt-pkg/init.h>
 									/*}}}*/
 
 // pkglibInitialize - Initialize the configuration class		/*{{{*/

+ 2 - 2
apt-pkg/init.h

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: init.h,v 1.1 1998/07/09 05:12:27 jgg Exp $
+// $Id: init.h,v 1.2 1998/07/12 23:58:27 jgg Exp $
 /* ######################################################################
 
    Init - Initialize the package library
@@ -14,7 +14,7 @@
 #ifndef PKGLIB_INIT_H
 #define PKGLIB_INIT_H
 
-#include <pkglib/configuration.h>
+#include <apt-pkg/configuration.h>
 
 bool pkglibInitialize(Configuration &Cnf);
 

+ 38 - 0
apt-pkg/makefile

@@ -0,0 +1,38 @@
+# -*- make -*-
+BASE=..
+
+# Header location
+SUBDIRS = deb contrib
+HEADER_TARGETDIRS = apt-pkg
+
+# Bring in the default rules
+include ../buildlib/defaults.mak
+
+# The library name
+LIBRARY=apt-pkg
+MAJOR=2
+MINOR=0.0
+
+# Source code for the contributed non-core things
+SOURCE = contrib/mmap.cc contrib/error.cc contrib/strutl.cc \
+         contrib/configuration.cc
+	 
+# Source code for the main library
+SOURCE+= pkgcache.cc version.cc fileutl.cc pkgcachegen.cc depcache.cc \
+         orderlist.cc tagfile.cc sourcelist.cc packagemanager.cc \
+	 algorithms.cc init.cc templates.cc
+	 
+# Source code for the debian specific components	 
+SOURCE+= deb/deblistparser.cc
+
+# Public apt-pkg header files
+HEADERS = algorithms.h depcache.h mmap.h pkgcachegen.h cacheiterators.h \
+          error.h orderlist.h sourcelist.h configuration.h fileutl.h \
+          packagemanager.h tagfile.h deblistparser.h init.h pkgcache.h \
+          version.h
+HEADERS := $(addprefix apt-pkg/,$(HEADERS))
+
+# Private header files
+HEADERS+= strutl.h system.h
+
+include $(LIBRARY_H)

+ 6 - 6
apt-pkg/orderlist.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: orderlist.cc,v 1.1 1998/07/07 04:17:01 jgg Exp $
+// $Id: orderlist.cc,v 1.2 1998/07/12 23:58:28 jgg Exp $
 /* ######################################################################
 
    Order List - Represents and Manipulates an ordered list of packages.
@@ -50,12 +50,12 @@
 									/*}}}*/
 // Include Files							/*{{{*/
 #ifdef __GNUG__
-#pragma implementation "pkglib/orderlist.h"
+#pragma implementation "apt-pkg/orderlist.h"
 #endif 
-#include <pkglib/orderlist.h>
-#include <pkglib/depcache.h>
-#include <pkglib/error.h>
-#include <pkglib/version.h>
+#include <apt-pkg/orderlist.h>
+#include <apt-pkg/depcache.h>
+#include <apt-pkg/error.h>
+#include <apt-pkg/version.h>
 									/*}}}*/
 
 pkgOrderList *pkgOrderList::Me = 0;

+ 3 - 3
apt-pkg/orderlist.h

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: orderlist.h,v 1.1 1998/07/07 04:17:01 jgg Exp $
+// $Id: orderlist.h,v 1.2 1998/07/12 23:58:29 jgg Exp $
 /* ######################################################################
 
    Order List - Represents and Manipulates an ordered list of packages.
@@ -18,10 +18,10 @@
 #define PKGLIB_ORDERLIST_H
 
 #ifdef __GNUG__
-#pragma interface "pkglib/orderlist.h"
+#pragma interface "apt-pkg/orderlist.h"
 #endif 
 
-#include <pkglib/pkgcache.h>
+#include <apt-pkg/pkgcache.h>
 
 class pkgDepCache;
 class pkgOrderList

+ 7 - 7
apt-pkg/packagemanager.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: packagemanager.cc,v 1.3 1998/07/12 01:26:02 jgg Exp $
+// $Id: packagemanager.cc,v 1.4 1998/07/12 23:58:30 jgg Exp $
 /* ######################################################################
 
    Package Manager - Abstacts the package manager
@@ -14,13 +14,13 @@
 									/*}}}*/
 // Include Files							/*{{{*/
 #ifdef __GNUG__
-#pragma implementation "pkglib/packagemanager.h"
+#pragma implementation "apt-pkg/packagemanager.h"
 #endif
-#include <pkglib/packagemanager.h>
-#include <pkglib/orderlist.h>
-#include <pkglib/depcache.h>
-#include <pkglib/error.h>
-#include <pkglib/version.h>
+#include <apt-pkg/packagemanager.h>
+#include <apt-pkg/orderlist.h>
+#include <apt-pkg/depcache.h>
+#include <apt-pkg/error.h>
+#include <apt-pkg/version.h>
 									/*}}}*/
 
 // PM::PackageManager - Constructor					/*{{{*/

+ 3 - 3
apt-pkg/packagemanager.h

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: packagemanager.h,v 1.2 1998/07/09 05:41:13 jgg Exp $
+// $Id: packagemanager.h,v 1.3 1998/07/12 23:58:31 jgg Exp $
 /* ######################################################################
 
    Package Manager - Abstacts the package manager
@@ -25,11 +25,11 @@
 #define PKGLIB_PACKAGEMANAGER_H
 
 #ifdef __GNUG__
-#pragma interface "pkglib/packagemanager.h"
+#pragma interface "apt-pkg/packagemanager.h"
 #endif
 
 #include <string>
-#include <pkglib/pkgcache.h>
+#include <apt-pkg/pkgcache.h>
 
 class pkgAquire;
 class pkgDepCache;

+ 7 - 7
apt-pkg/pkgcache.cc

@@ -1,11 +1,11 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: pkgcache.cc,v 1.6 1998/07/12 01:26:04 jgg Exp $
+// $Id: pkgcache.cc,v 1.7 1998/07/12 23:58:32 jgg Exp $
 /* ######################################################################
    
    Package Cache - Accessor code for the cache
    
-   Please see doc/pkglib/cache.sgml for a more detailed description of 
+   Please see doc/apt-pkg/cache.sgml for a more detailed description of 
    this format. Also be sure to keep that file up-to-date!!
    
    This is the general utility functions for cache managment. They provide
@@ -21,12 +21,12 @@
 									/*}}}*/
 // Include Files							/*{{{*/
 #ifdef __GNUG__
-#pragma implementation "pkglib/pkgcache.h"
-#pragma implementation "pkglib/cacheiterators.h"
+#pragma implementation "apt-pkg/pkgcache.h"
+#pragma implementation "apt-pkg/cacheiterators.h"
 #endif 
-#include <pkglib/pkgcache.h>
-#include <pkglib/version.h>
-#include <pkglib/error.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/version.h>
+#include <apt-pkg/error.h>
 #include <system.h>
 
 #include <string>

+ 5 - 5
apt-pkg/pkgcache.h

@@ -1,11 +1,11 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: pkgcache.h,v 1.5 1998/07/07 04:17:03 jgg Exp $
+// $Id: pkgcache.h,v 1.6 1998/07/12 23:58:33 jgg Exp $
 /* ######################################################################
    
    Cache - Structure definitions for the cache file
    
-   Please see doc/pkglib/cache.sgml for a more detailed description of 
+   Please see doc/apt-pkg/cache.sgml for a more detailed description of 
    this format. Also be sure to keep that file up-to-date!!
    
    Clients should always use the CacheIterators classes for access to the
@@ -21,12 +21,12 @@
 #define PKGLIB_PKGCACHE_H
 
 #ifdef __GNUG__
-#pragma interface "pkglib/pkgcache.h"
+#pragma interface "apt-pkg/pkgcache.h"
 #endif 
 
 #include <string>
 #include <time.h>
-#include <pkglib/mmap.h>
+#include <apt-pkg/mmap.h>
 
 class pkgCache
 {
@@ -258,7 +258,7 @@ struct pkgCache::StringItem
    unsigned long NextItem;      // StringItem
 };
 
-#include <pkglib/cacheiterators.h>
+#include <apt-pkg/cacheiterators.h>
 
 inline pkgCache::PkgIterator pkgCache::PkgBegin() 
        {return PkgIterator(*this);};

+ 5 - 5
apt-pkg/pkgcachegen.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: pkgcachegen.cc,v 1.8 1998/07/09 05:12:27 jgg Exp $
+// $Id: pkgcachegen.cc,v 1.9 1998/07/12 23:58:34 jgg Exp $
 /* ######################################################################
    
    Package Cache Generator - Generator for the cache structure.
@@ -11,12 +11,12 @@
 									/*}}}*/
 // Include Files							/*{{{*/
 #ifdef __GNUG__
-#pragma implementation "pkglib/pkgcachegen.h"
+#pragma implementation "apt-pkg/pkgcachegen.h"
 #endif
 
-#include <pkglib/pkgcachegen.h>
-#include <pkglib/error.h>
-#include <pkglib/version.h>
+#include <apt-pkg/pkgcachegen.h>
+#include <apt-pkg/error.h>
+#include <apt-pkg/version.h>
 #include <strutl.h>
 
 #include <sys/stat.h>

+ 3 - 3
apt-pkg/pkgcachegen.h

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: pkgcachegen.h,v 1.4 1998/07/07 04:17:05 jgg Exp $
+// $Id: pkgcachegen.h,v 1.5 1998/07/12 23:58:35 jgg Exp $
 /* ######################################################################
    
    Package Cache Generator - Generator for the cache structure.
@@ -14,10 +14,10 @@
 #define PKGLIB_PKGCACHEGEN_H
 
 #ifdef __GNUG__
-#pragma interface "pkglib/pkgcachegen.h"
+#pragma interface "apt-pkg/pkgcachegen.h"
 #endif 
 
-#include <pkglib/pkgcache.h>
+#include <apt-pkg/pkgcache.h>
 
 class pkgCacheGenerator
 {

+ 6 - 6
apt-pkg/sourcelist.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: sourcelist.cc,v 1.2 1998/07/09 05:12:28 jgg Exp $
+// $Id: sourcelist.cc,v 1.3 1998/07/12 23:58:36 jgg Exp $
 /* ######################################################################
 
    List of Sources
@@ -9,13 +9,13 @@
 									/*}}}*/
 // Include Files							/*{{{*/
 #ifdef __GNUG__
-#pragma implementation "pkglib/sourcelist.h"
+#pragma implementation "apt-pkg/sourcelist.h"
 #endif
 
-#include <pkglib/sourcelist.h>
-#include <pkglib/error.h>
-#include <pkglib/fileutl.h>
-#include <pkglib/configuration.h>
+#include <apt-pkg/sourcelist.h>
+#include <apt-pkg/error.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/configuration.h>
 #include <strutl.h>
 
 #include <fstream.h>

+ 3 - 3
apt-pkg/sourcelist.h

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: sourcelist.h,v 1.2 1998/07/09 05:12:31 jgg Exp $
+// $Id: sourcelist.h,v 1.3 1998/07/12 23:58:38 jgg Exp $
 /* ######################################################################
 
    SourceList - Manage a list of sources
@@ -17,10 +17,10 @@
 #include <string>
 #include <vector>
 #include <iostream.h>
-#include <pkglib/pkgcache.h>
+#include <apt-pkg/pkgcache.h>
 
 #ifdef __GNUG__
-#pragma interface "pkglib/sourcelist.h"
+#pragma interface "apt-pkg/sourcelist.h"
 #endif
 
 class pkgAquire;

+ 5 - 92
apt-pkg/tagfile.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: tagfile.cc,v 1.6 1998/07/09 05:12:32 jgg Exp $
+// $Id: tagfile.cc,v 1.7 1998/07/12 23:58:39 jgg Exp $
 /* ######################################################################
 
    Fast scanner for RFC-822 type header information
@@ -12,12 +12,12 @@
 									/*}}}*/
 // Include Files							/*{{{*/
 #ifdef __GNUG__
-#pragma implementation "pkglib/tagfile.h"
+#pragma implementation "apt-pkg/tagfile.h"
 #endif
 
-#include <pkglib/tagfile.h>
-#include <pkglib/error.h>
-#include <pkglib/init.h>
+#include <apt-pkg/tagfile.h>
+#include <apt-pkg/error.h>
+#include <apt-pkg/init.h>
 
 #include <string>
 #include <stdio.h>
@@ -153,90 +153,3 @@ bool pkgTagSection::Find(const char *Tag,const char *&Start,
    return false;
 }
 									/*}}}*/
-
-#include <pkglib/pkgcachegen.h>
-#include <pkglib/deblistparser.h>
-
-int main(int argc,char *argv[])
-{
-   pkglibInitialize(*_config);
-   cout << _config->Find("APT::arch") << endl;
-   cout << _config->FindDir("DIR::Etc::sourcelist") << endl;
-   
-   {
-      File CacheF("./cache",File::WriteEmpty);
-      DynamicMMap Map(CacheF,MMap::Public);
-      pkgCacheGenerator Gen(Map);
-
-      for (int I = 1; I != argc; I++)
-      {
-	 cout << "Merging in " << argv[I] << endl;
-	 File F(argv[I],File::ReadOnly);
-	 Gen.SelectFile(argv[I]);
-	 debListParser Parser(F);
-	 Gen.MergeList(Parser);
-      }      
-   }
-/*
-   {
-      File CacheF("./cache",File::WriteExists);
-      MMap Map(CacheF,MMap::Public | MMap::ReadOnly);
-      pkgCache Cache(Map);
-      for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
-      {
-	 cout << "Package: " << I.Name() << endl;
-	 for (pkgCache::VerIterator V = I.VersionList(); V.end() == false; V++)
-	 {
-	    cout << "Version: " << V.VerStr() << endl;
-	    cout << "Size: " << V->Size << endl;
-	    cout << "Installed-Size: " << V->InstalledSize << endl;
-	    cout << "Section: " << V.Section() << endl;
-	    cout << "Priority: " << Cache.Priority(V->Priority) << endl;
-	    
-	    pkgCache::PrvIterator P = V.ProvidesList();
-	    if (P.end() == false)
-	    {
-	       cout << "Provides: ";
-	       for (; P.end() == false; P++)
-		  cout << P.Name() << ", ";
-	       cout << endl;
-	    }	    
-	 }
-	 cout << endl;
-      }
-   }
-*/   
-#if 0 
-   pkgTagSection I;
-   while (Test.Step(I) == true)
-   {
-      const char *Start;
-      const char *End;
-      if (I.Find("Package",Start,End) == false)
-      {
-	 cout << "Failed" << endl;
-	 continue;
-      }
-      
-      cout << "Package: " << string(Start,End - Start) << endl;
-      
-/*      for (const char *I = Start; I < End; I++)
-      {
-	 const char *Begin = I;
-	 bool Number = true;
-	 while (isspace(*I) == 0 && ispunct(*I) == 0 && I < End)
-	 {
-	    if (isalpha(*I) != 0)
-	       Number = false;
-	    I++;
-	 }
-	 if (Number == false)
-	    cout << string(Begin,I-Begin) << endl;	 
-	 while ((isspace(*I) != 0 || ispunct(*I) != 0) && I < End)
-	    I++;
-	 I--;
-      }      */
-   }
-#endif   
-   _error->DumpErrors();
-}

+ 3 - 3
apt-pkg/tagfile.h

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: tagfile.h,v 1.3 1998/07/07 04:17:07 jgg Exp $
+// $Id: tagfile.h,v 1.4 1998/07/12 23:58:40 jgg Exp $
 /* ######################################################################
 
    Fast scanner for RFC-822 type header information
@@ -22,10 +22,10 @@
 #define PKGLIB_TAGFILE_H
 
 #ifdef __GNUG__
-#pragma interface "pkglib/tagfile.h"
+#pragma interface "apt-pkg/tagfile.h"
 #endif 
 
-#include <pkglib/fileutl.h>
+#include <apt-pkg/fileutl.h>
 
 class pkgTagSection
 {

+ 1 - 1
apt-pkg/templates.cc

@@ -1,5 +1,5 @@
 /* All template instances are explicly declared here */
 
-#include <pkglib/sourcelist.h>
+#include <apt-pkg/sourcelist.h>
 
 template vector<pkgSourceList::Item>;

+ 4 - 4
apt-pkg/version.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: version.cc,v 1.3 1998/07/07 04:17:08 jgg Exp $
+// $Id: version.cc,v 1.4 1998/07/12 23:58:42 jgg Exp $
 /* ######################################################################
 
    Version - Version string 
@@ -18,11 +18,11 @@
 									/*}}}*/
 // Include Files							/*{{{*/
 #ifdef __GNUG__
-#pragma implementation "pkglib/version.h"
+#pragma implementation "apt-pkg/version.h"
 #endif 
 
-#include <pkglib/version.h>
-#include <pkglib/pkgcache.h>
+#include <apt-pkg/version.h>
+#include <apt-pkg/pkgcache.h>
 
 #include <stdlib.h>
 									/*}}}*/

+ 2 - 2
apt-pkg/version.h

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: version.h,v 1.2 1998/07/07 04:17:09 jgg Exp $
+// $Id: version.h,v 1.3 1998/07/12 23:58:43 jgg Exp $
 /* ######################################################################
 
    Version - Version string 
@@ -16,7 +16,7 @@
 #define PKGLIB_VERSION_H
 
 #ifdef __GNUG__
-#pragma interface "pkglib/version.h"
+#pragma interface "apt-pkg/version.h"
 #endif 
 
 #include <string>

+ 101 - 0
buildlib/defaults.mak

@@ -0,0 +1,101 @@
+# -*- make -*-
+
+# This file configures the default environment for the make system
+# The way it works is fairly simple, each module is defined in it's
+# own *.mak file. It expects a set of variables to be set to values
+# for it to operate as expected. When included the module generates
+# the requested rules based on the contents of its control variables.
+
+# This works out very well and allows a good degree of flexability.
+# To accomidate some of the features we introduce the concept of 
+# local variables. To do this we use the 'Computed Names' feature of
+# gmake. Each module declares a LOCAL scope and access it with,
+#   $($(LOCAL)-VAR)
+# This works very well but it is important to rembember that within
+# a rule the LOCAL var is unavailble, it will have to be constructed
+# from the information in the rule invokation. For stock rules like 
+# clean this is simple, we use a local clean rule called clean/$(LOCAL)
+# and then within the rule $(@F) gets back $(LOCAL)! Other rules will
+# have to use some other mechanism (filter perhaps?) The reason such
+# lengths are used is so that each directory can contain several 'instances'
+# of any given module
+
+# A build directory is used by default, all generated items get put into
+# there. However unlike automake this is not done with a VPATH build
+# (vpath builds break the distinction between #include "" and #include <>)
+# but by explicly setting the BUILD variable. Make is invoked from
+# within the source itself which is much more compatible with compilation
+# environments.
+
+ifndef BUILD
+BUILD=$(BASE)/build
+endif
+
+# Base definitions
+INCLUDE := $(BUILD)/include
+BIN := $(BUILD)/bin
+LIB := $(BIN)
+OBJ := $(BUILD)/obj
+DEP := $(OBJ)
+
+# Module types
+LIBRARY_H=$(BASE)/buildlib/library.mak
+
+# Source location control
+# SUBDIRS specifies sub components of the module that
+# may be located in subdrictories of the source dir. 
+# This should be declared before including this file
+SUBDIRS+=
+
+# Header file control. 
+# TARGETDIRS indicitates all of the locations that public headers 
+# will be published to.
+# This should be declared before including this file
+HEADER_TARGETDIRS+=
+
+# Options
+CXX = c++
+CC = cc
+CPPFLAGS+= -I$(INCLUDE)
+CXXFLAGS+= -Wall -g -fno-implicit-templates  -fno-exceptions
+PICFLAGS+= -fPIC -DPIC
+LFLAGS+= 
+INLINEDEPFLAG = -MD
+
+# Phony rules. Other things hook these by appending to the dependency
+# list
+.PHONY: headers library clean veryclean all binary program
+all: binary
+binary: library program
+headers library clean veryclean program:
+
+# Header file control. We want all published interface headers to go
+# into the build directory from thier source dirs. We setup some
+# search paths here
+vpath %.h $(SUBDIRS)
+$(INCLUDE)/%.h $(addprefix $(INCLUDE)/,$(addsuffix /%.h,$(HEADER_TARGETDIRS))) : %.h
+	cp $< $@
+
+# Dependency generation. We want to generate a .d file using gnu cpp.
+# For GNU systems the compiler can spit out a .d file while it is compiling,
+# this is specified with the INLINEDEPFLAG. Other systems might have a 
+# makedep program that can be called after compiling, that's illistrated
+# by the DEPFLAG case.
+# Compile rules are expected to call this macro after calling the compiler
+ ifdef INLINEDEPFLAG
+ define DoDep
+	sed -e "1s/.*:/$(subst /,\\/,$@):/" $(basename $(@F)).d > $(DEP)/$(basename $(@F)).d
+	-rm -f $(basename $(@F)).d
+ endef
+else
+ ifdef DEPFLAG
+  define DoDep
+	$(CXX) $(DEPFLAG) $(CPPFLAGS) -o $@ $<
+	sed -e "1s/.*:/$(subst /,\\/,$@):/" $(basename $(@F)).d > $(DEP)/$(basename $(@F)).d
+	-rm -f $(basename $(@F)).d
+  endef
+ else
+  define DoDep
+  endef
+ endif
+endif	

+ 61 - 0
buildlib/library.mak

@@ -0,0 +1,61 @@
+# -*- make -*-
+
+# This creates a shared library.
+
+# Input
+# $(SOURCE) - The source code to use
+# $(HEADERS) - Exported header files and private header files
+# $(LIBRARY) - The name of the library without lib or .so 
+# $(MAJOR) - The major version number of this library
+# $(MINOR) - The minor version number of this library
+
+# All output is writtin to .opic files in the build directory to
+# signify the PIC output.
+
+# See defaults.mak for information about LOCAL
+
+# Some local definitions
+LOCAL := lib$(LIBRARY).so.$(MAJOR).$(MINOR)
+$(LOCAL)-OBJS := $(addprefix $(OBJ)/,$(addsuffix .opic,$(notdir $(basename $(SOURCE)))))
+$(LOCAL)-DEP := $(addprefix $(DEP)/,$(addsuffix .d,$(notdir $(basename $(SOURCE)))))
+$(LOCAL)-HEADERS := $(addprefix $(INCLUDE)/,$(HEADERS))
+$(LOCAL)-SONAME := lib$(LIBRARY).so.$(MAJOR)
+
+# Install the command hooks
+headers: $($(LOCAL)-HEADERS)
+library: $(LIB)/lib$(LIBRARY).so $(LIB)/lib$(LIBRARY).so.$(MAJOR)
+clean: clean/$(LOCAL)
+veryclean: veryclean/$(LOCAL)
+
+# The clean rules
+.PHONY: clean/$(LOCAL) veryclean/$(LOCAL)
+clean/$(LOCAL):
+	-rm -f $($(@F)-OBJS) $($(@F)-DEP)
+veryclean/$(LOCAL): clean/$(LOCAL)
+	-rm -f $($(@F)-HEADERS) $(LIB)/lib$(LIBRARY).so*
+
+# Build rules for the two symlinks
+.PHONY: $(LIB)/lib$(LIBRARY).so.$(MAJOR) $(LIB)/lib$(LIBRARY).so
+$(LIB)/lib$(LIBRARY).so.$(MAJOR): $(LIB)/lib$(LIBRARY).so.$(MAJOR).$(MINOR)
+	ln -sf $(<F) $@
+$(LIB)/lib$(LIBRARY).so: $(LIB)/lib$(LIBRARY).so.$(MAJOR).$(MINOR)
+	ln -sf $(<F) $@
+	
+# The binary build rule
+$(LIB)/lib$(LIBRARY).so.$(MAJOR).$(MINOR): $($(LOCAL)-HEADERS) $($(LOCAL)-OBJS)
+	echo Building shared library $@
+	$(CXX) $(CXXFLAGS) $(LDFLAGS) $(PICFLAGS) $(LFLAGS) -o $@ \
+	   -Wl,-soname -Wl,$($(@F)-SONAME) -shared $(filter %.opic,$^)
+
+# Compilation rules
+vpath %.cc $(SUBDIRS)
+$(OBJ)/%.opic: %.cc
+	echo Compiling $< to $@
+	$(CXX) -c $(INLINEDEPFLAG) $(CPPFLAGS) $(CXXFLAGS) $(PICFLAGS) -o $@ $<
+	$(DoDep)
+
+# Include the dependencies that are available
+The_DFiles = $(wildcard $($(LOCAL)-DEP))
+ifneq ($(words $(The_DFiles)),0)
+include $(The_DFiles)
+endif