Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 71850 - dispatch-conf should create /etc/config-archive if it doesn't already exist
Summary: dispatch-conf should create /etc/config-archive if it doesn't already exist
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All All
: Highest enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2004-11-20 08:50 UTC by Ben Anderson
Modified: 2005-07-14 06:58 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Anderson 2004-11-20 08:50:19 UTC
Many, many people have been confused by the "/etc/config-archive does not exist" error that dispatch-conf generates. If this directory doesn't exist, dispatch-conf should create it and print out a warning about it (if this directory is deleted for some reason, foul play is probably involved).
Comment 1 Robert 2005-04-08 17:13:52 UTC
Very simple patch that solves this:

--- dispatch_conf.py    2005-04-09 02:05:31.000000000 +0200
+++ dispatch_conf_mkdir.py      2005-04-09 02:12:34.000000000 +0200
@@ -35,9 +35,12 @@
         if not opts.has_key(key):
             print >> sys.stderr, 'dispatch-conf: Missing option "%s" in /etc/dispatch-conf.conf; fatal' % (key,)

-    if not (os.path.exists(opts['archive-dir']) and os.path.isdir(opts['archive-dir'])):
-        print >> sys.stderr, 'dispatch-conf: Config archive dir [%s] must exist; fatal' % (opts['archive-dir'],)
-        sys.exit(1)
+    if not os.path.exists(opts['archive-dir']):
+       os.mkdir(opts['archive-dir'])
+    else:
+        if not os.path.isdir(opts['archive-dir']):
+            print >> sys.stderr, 'dispatch-conf: Config archive dir [%s] must exist; fatal' % (opts['archive-dir'],)
+            sys.exit(1)

     return opts

Comment 2 Jason Stubbs (RETIRED) gentoo-dev 2005-07-14 05:47:52 UTC
Fixed on or before 2.0.51.22-r1 
Comment 3 Jason Stubbs (RETIRED) gentoo-dev 2005-07-14 06:58:37 UTC
Looking through the batch of bugs, I'm not sure that some of these are 
actually fixed in stable. Others, the requirements have possibly changed after 
the initial fix was committed. 
 
If you think this bug has been closed incorrectly, please reopen or ask that 
it be reopened.