]> git.saurik.com Git - apt.git/commitdiff
First draft of make system and name change to apt-pkg
authorArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:50:46 +0000 (16:50 +0000)
committerArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:50:46 +0000 (16:50 +0000)
Author: jgg
Date: 1998-07-12 23:58:20 GMT
First draft of make system and name change to apt-pkg

35 files changed:
apt-pkg/algorithms.cc
apt-pkg/algorithms.h
apt-pkg/cacheiterators.h
apt-pkg/contrib/configuration.cc
apt-pkg/contrib/configuration.h
apt-pkg/contrib/error.cc
apt-pkg/contrib/error.h
apt-pkg/contrib/fileutl.cc
apt-pkg/contrib/fileutl.h
apt-pkg/contrib/mmap.cc
apt-pkg/contrib/mmap.h
apt-pkg/deb/deblistparser.cc
apt-pkg/deb/deblistparser.h
apt-pkg/depcache.cc
apt-pkg/depcache.h
apt-pkg/init.cc
apt-pkg/init.h
apt-pkg/makefile [new file with mode: 0644]
apt-pkg/orderlist.cc
apt-pkg/orderlist.h
apt-pkg/packagemanager.cc
apt-pkg/packagemanager.h
apt-pkg/pkgcache.cc
apt-pkg/pkgcache.h
apt-pkg/pkgcachegen.cc
apt-pkg/pkgcachegen.h
apt-pkg/sourcelist.cc
apt-pkg/sourcelist.h
apt-pkg/tagfile.cc
apt-pkg/tagfile.h
apt-pkg/templates.cc
apt-pkg/version.cc
apt-pkg/version.h
buildlib/defaults.mak [new file with mode: 0644]
buildlib/library.mak [new file with mode: 0644]

index e4bc99a28f07939368c09d0310080485043e19f3..ce0c41efd7c2c0b3f0a74b4e6b7169e09960ac05 100644 (file)
@@ -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>
                                                                        /*}}}*/
 
index 0dd77d940a79861cc780f0f1121a29c170855cbd..d6078b2cb48af340f4b6785d7430ce96cc9ad491 100644 (file)
@@ -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
 #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
 {
index d382e4b98307dd64cf888e0b9943d9c5125d5176..390c923b95feaf70c07e8d9b4f34ec3d9dff4d5f 100644 (file)
@@ -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
index 7694330f98ed4018ef9ffed6f3eed06ab2d0b8c8..72b654b01c149af41fe8b7885a4c0c13ea028f7f 100644 (file)
@@ -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>
index bd06f5e37868222ce293c238ddcb5774fba9be18..9229a0f66248cf40d221efd2f9b5da2518662f84 100644 (file)
@@ -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>
index d1ea1b87b110814da63da224017f8297bfe8f16f..d31aaf1b1e702b0d9515344df43af0722781231c 100644 (file)
@@ -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;
index 06367592b96501b357cf17417d9ec93cdcac38ca..5d015c4170978d19ec22ff33e2cccada48696dff 100644 (file)
@@ -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>
index 29b12bef1927af465bdfc40737fdbf980fc4fce2..1b087696df0f70f7f7568278522faec5580ae066 100644 (file)
@@ -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
                                                                        /*}}}*/
 // 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>
index aa2d2ee2eddc33ce488800913a1656bc5bc78b5b..3328ce2b4831707577b4e31a0a176d321d870456 100644 (file)
@@ -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>
index c0cc13f002ae2d8df52e81b80fc15a10271bdc1e..ccb706eab0273290158b1cdc93c7973d80f74c64 100644 (file)
@@ -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().
                                                                        /*}}}*/
 // 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>
index 55feda741b841728034ebb42e3af3ba3adaafb4a..0e80c15d21b5ce18638ccb507f102ea96e773328 100644 (file)
@@ -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().
 #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
 {
index 3c82ee51da2dda5ceffa4d1e47fa9746c1371919..7587760b51e993f9a6f95679c89057e4ec015ee0 100644 (file)
@@ -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>
index c7a97c16abf4d2f5cfddea6ec3042b336ff695c7..63e78a9885f6b09884344e01bfef6a45da4577a2 100644 (file)
@@ -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
 {
index a7784c0a528e12d80be3229fbb05bb50a5353cd2..71a0d02a2f9b3e88e08f113afa8a68a5a4f38eaf 100644 (file)
@@ -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                                        /*{{{*/
index 39ed215b2af5e63c27248d9d5ca3af5eb41516ad..6cb8c11879268fc3b3db09ff299ba51e1eab7890 100644 (file)
@@ -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
 #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
 {
index 5dd7b58aa81b0a35e7ab80d8c58c0f9bc4e94e36..a93e65c1a4877bfb462e33bf11d5cbe13734e003 100644 (file)
@@ -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               /*{{{*/
index bd03dd10d8b184917cdc871820f06ff349b21645..ecfe702d41e2a890bdb4f2c096292fa2d81e2ac5 100644 (file)
@@ -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);
 
diff --git a/apt-pkg/makefile b/apt-pkg/makefile
new file mode 100644 (file)
index 0000000..f6a5d00
--- /dev/null
@@ -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)
index f79a063bd01c389c9ae2356184681709bcffd738..85d35d5a1bb3cee862cd2b513bb3ac4c190c099a 100644 (file)
@@ -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.
                                                                        /*}}}*/
 // 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;
index 0dc8a5038b2df7adf0acc5f821c8568daf447db1..2065fc4c81ff4b7bd284589e1f50e9b702fd9603 100644 (file)
@@ -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.
 #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
index afe5fc176dad3bb04dcf6a9604ff79bf6fd9a9f1..1780dff09b9a9ef917bed455997a7d59800657a4 100644 (file)
@@ -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
                                                                        /*}}}*/
 // 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                                    /*{{{*/
index 5f1b34635ca1974ffca214b338ca34906c8e62ad..a097712a368e0928126c6da1e4edf02926e8eb86 100644 (file)
@@ -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
 #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;
index b8af6b5e43ace8317c84a3dec18fa4e4a63e96f8..20590e971db62803cc139a8e7c7fc85640cc34f8 100644 (file)
@@ -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
                                                                        /*}}}*/
 // 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>
index 852949b1f4a2de22ba9d6b681f5ecf693f79278f..5ff29cfb4b17057d09494f653445a480460026cb 100644 (file)
@@ -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
 #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);};
index 3e37c74f3517452bb75e72083bb005b059fac9d7..e0f8f3a197c6ffbbae51193da2f283170656c749 100644 (file)
@@ -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.
                                                                        /*}}}*/
 // 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>
index c883828eb12dc5e5eeb7d37219deda1211472cff..0a4881057fef4c3a7e1a350a1723c50cb796ae3b 100644 (file)
@@ -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.
 #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
 {
index bce3e5990dcf46b8fd2a9c057cb8b2fdf5c2d6cb..f9de995848ea3f07321fe267d2538f31d3439450 100644 (file)
@@ -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>
index 43739fbcd1634679fa6834a40b3a3fd53beecaee..57a648b972272f96251ababe5fd98f3db6c8bd9c 100644 (file)
@@ -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
 #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;
index aaef3da8b329d493f15eca8e5df03a3f6f3be959..42a44453f256b98a103a0fa9164717566c1daeb3 100644 (file)
@@ -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
                                                                        /*}}}*/
 // 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();
-}
index c1fffcf13bf38d288952ae8ea5e780fec076b811..097eb73bd190fb60f383108efc1093c54b6a7187 100644 (file)
@@ -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
 #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
 {
index 0f86bde9af6e90d31be3c3630862c18cdd0dcae0..1e7d202c93168553ce3ae8cebf3ecae89b221d5e 100644 (file)
@@ -1,5 +1,5 @@
 /* All template instances are explicly declared here */
 
-#include <pkglib/sourcelist.h>
+#include <apt-pkg/sourcelist.h>
 
 template vector<pkgSourceList::Item>;
index 7eb85726c38b9539eb6becbe3f712fcf49615ba5..9f245a9e70510e70ef48707db5f6a5b32b8ad9d9 100644 (file)
@@ -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 
                                                                        /*}}}*/
 // 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>
                                                                        /*}}}*/
index 3ced5d3e431a5807cb2d63c8aaa8fd60a1961e4c..b263d7c907ae0fa4558639b04ba6fb6886177dd4 100644 (file)
@@ -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>
diff --git a/buildlib/defaults.mak b/buildlib/defaults.mak
new file mode 100644 (file)
index 0000000..b268c4b
--- /dev/null
@@ -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  
diff --git a/buildlib/library.mak b/buildlib/library.mak
new file mode 100644 (file)
index 0000000..1b81487
--- /dev/null
@@ -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