summaryrefslogtreecommitdiffstats
path: root/scripts/makeupdates
diff options
context:
space:
mode:
authorWill Woods <wwoods@redhat.com>2012-03-21 20:03:25 -0400
committerBrian C. Lane <bcl@redhat.com>2012-03-21 21:10:08 -0700
commit809bfdf36c9a8d10b272165594d94bb2f190eadc (patch)
tree8c96f7f9f28afecdc9731bf85b745746ae6dcb66 /scripts/makeupdates
parentdebf87daea6f67611334c34cf81252240af66fe0 (diff)
downloadanaconda-809bfdf36c9a8d10b272165594d94bb2f190eadc.tar.gz
anaconda-809bfdf36c9a8d10b272165594d94bb2f190eadc.tar.xz
anaconda-809bfdf36c9a8d10b272165594d94bb2f190eadc.zip
makeupdates: add support for updating systemd services/targets
copy systemd .service/.target files into the appropriate directory. also, some cleanups for makeupdates. whee!
Diffstat (limited to 'scripts/makeupdates')
-rwxr-xr-xscripts/makeupdates32
1 files changed, 19 insertions, 13 deletions
diff --git a/scripts/makeupdates b/scripts/makeupdates
index 96a68eef6..7b96e0064 100755
--- a/scripts/makeupdates
+++ b/scripts/makeupdates
@@ -100,6 +100,13 @@ def copyUpdatedFiles(tag, updates, cwd):
return lst
+ def install_to_dir(fname, relpath):
+ sys.stdout.write("Including %s\n" % fname)
+ outdir = os.path.join(updates, relpath)
+ if not os.path.isdir(outdir):
+ os.makedirs(outdir)
+ shutil.copy2(file, outdir)
+
subdirs = []
# Updates get overlaid onto the runtime filesystem. Anaconda expects them
@@ -127,12 +134,18 @@ def copyUpdatedFiles(tag, updates, cwd):
continue
if file.startswith('pyanaconda/'):
- sys.stdout.write("Including %s\n" % (file,))
- update_filename = os.path.realpath(os.path.join(tmpupdates, file))
- update_dir = os.path.dirname(update_filename)
- if not os.path.isdir(update_dir):
- os.makedirs(update_dir)
- shutil.copy2(file, update_dir)
+ # pyanaconda stuff goes into /tmp/updates/[path]
+ dirname = os.path.join(tmpupdates, os.path.dirname(file))
+ install_to_dir(file, dirname)
+ elif file == 'anaconda':
+ # anaconda itself we just overwrite
+ install_to_dir(file, "usr/sbin")
+ elif file.endswith('.service') or file.endswith(".target"):
+ # same for systemd services
+ install_to_dir(file, "lib/systemd/system")
+ elif file.endswith('/anaconda-generator')
+ # yeah, this should probably be more clever..
+ install_to_dir(file, "lib/systemd/system-generators")
elif file.find('/') != -1:
fields = file.split('/')
subdir = fields[0]
@@ -143,13 +156,6 @@ def copyUpdatedFiles(tag, updates, cwd):
else:
sys.stdout.write("Including %s\n" % (file,))
shutil.copy2(file, tmpupdates)
- elif file == 'anaconda':
- # anaconda itself we just overwrite
- sys.stdout.write("Including anaconda\n")
- sbindir = os.path.join(updates, "usr/sbin")
- if not os.path.isdir(sbindir):
- os.makedirs(sbindir)
- shutil.copy2(file, sbindir)
else:
sys.stdout.write("Including %s\n" % (file,))
shutil.copy2(file, tmpupdates)