Use a template system for tree scrubbing
This commit is contained in:
parent
69c69d0e13
commit
b028a210a5
1
etc/tree/scrubs.alpha
Symbolic link
1
etc/tree/scrubs.alpha
Symbolic link
@ -0,0 +1 @@
|
||||
scrubs.i386
|
5
etc/tree/scrubs.i386
Normal file
5
etc/tree/scrubs.i386
Normal file
@ -0,0 +1,5 @@
|
||||
# remove unnecessary directories from root
|
||||
remove @instroot@/boot
|
||||
remove @instroot@/home
|
||||
remove @instroot@/root
|
||||
remove @instroot@/tmp
|
1
etc/tree/scrubs.ia64
Symbolic link
1
etc/tree/scrubs.ia64
Symbolic link
@ -0,0 +1 @@
|
||||
scrubs.i386
|
1
etc/tree/scrubs.ppc
Symbolic link
1
etc/tree/scrubs.ppc
Symbolic link
@ -0,0 +1 @@
|
||||
scrubs.i386
|
1
etc/tree/scrubs.ppc64
Symbolic link
1
etc/tree/scrubs.ppc64
Symbolic link
@ -0,0 +1 @@
|
||||
scrubs.ppc
|
1
etc/tree/scrubs.s390
Symbolic link
1
etc/tree/scrubs.s390
Symbolic link
@ -0,0 +1 @@
|
||||
scrubs.i386
|
1
etc/tree/scrubs.s390x
Symbolic link
1
etc/tree/scrubs.s390x
Symbolic link
@ -0,0 +1 @@
|
||||
scrubs.s390
|
1
etc/tree/scrubs.sparc
Symbolic link
1
etc/tree/scrubs.sparc
Symbolic link
@ -0,0 +1 @@
|
||||
scrubs.i386
|
1
etc/tree/scrubs.x86_64
Symbolic link
1
etc/tree/scrubs.x86_64
Symbolic link
@ -0,0 +1 @@
|
||||
scrubs.i386
|
@ -28,6 +28,10 @@ import re
|
||||
|
||||
from utils.fileutils import copy, move, remove, replace, touch
|
||||
|
||||
import actions
|
||||
import actions.base
|
||||
from template import Template
|
||||
|
||||
|
||||
class InstallTree(object):
|
||||
|
||||
@ -505,6 +509,25 @@ class InstallTree(object):
|
||||
os.unlink(link)
|
||||
os.symlink(newtarget, link)
|
||||
|
||||
def process_scrubs_from_template(self):
|
||||
# get supported actions
|
||||
supported_actions = actions.getActions(verbose=self.conf.debug)
|
||||
|
||||
# variables supported in templates
|
||||
vars = { "instroot": self.conf.treedir }
|
||||
|
||||
# parse the template file
|
||||
scrubs = os.path.join(self.conf.confdir, "tree",
|
||||
"scrubs.%s" % (self.conf.buildarch,))
|
||||
|
||||
if os.path.exists(scrubs):
|
||||
self.template = Template()
|
||||
self.template.preparse(scrubs)
|
||||
self.template.parse(supported_actions, vars)
|
||||
|
||||
for action in self.template.actions:
|
||||
action.execute()
|
||||
|
||||
def scrub(self):
|
||||
self.copy_stubs()
|
||||
self.create_dogtail_conf()
|
||||
@ -526,7 +549,8 @@ class InstallTree(object):
|
||||
self.remove_locales()
|
||||
self.remove_unnecessary_files()
|
||||
self.remove_python_stuff()
|
||||
|
||||
self.remove_unnecessary_directories()
|
||||
#self.remove_unnecessary_directories()
|
||||
|
||||
self.move_bins()
|
||||
|
||||
self.process_scrubs_from_template()
|
||||
|
Loading…
Reference in New Issue
Block a user