Classification: HACK

This patch allows to configure whether '--promoteepoch' will be used
when calling rpm. This happens through config['promotepoch'] and is
required when installing pre-FC1 packages with a recent rpm-version.

It is a hack since apt does not allow a direct setup for this flag;
instead of, RPM::Erase-Options will be abused since it is never used
by mach operations.


2004-01-26  Enrico Scholz  <enrico.scholz@informatik.tu-chemnitz.de>
	* initial release
--- mach/scripts/mach.in~promepoch	2004-01-20 16:55:57.000000000 +0100
+++ mach/scripts/mach.in	2004-02-28 01:20:13.000000000 +0100
@@ -1103,6 +1103,11 @@
         os.system (command)
   
         # create a custom apt.conf file
+        if self.config.get('promoteepoch', 0):
+            promepoch='"--promoteepoch"; '
+        else:
+            promepoch=''
+            
         root = self.rootdir
         state = self.statedir
         conf = '''
@@ -1130,6 +1135,9 @@
     }
 };
 
+// HACK: abuse a bug in apt <= 0.5.15cnc5
+PM::Options {''' + promepoch + '''};
+    
 RPM {
     PM "external";
     Order "true";
@@ -1142,7 +1150,7 @@
     RootDir "''' + root + '''";
     Options "--root ''' + root + '''";
     Install-Options "--root ''' + root + '''";
-    Erase-Options "--root ''' + root + '''";
+    Erase-Options { "--root"; "''' + root + '"; ' + promepoch + '''};
 }
 Dir {
      Bin {
