FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Infrastructure

 
 
LinkBack Thread Tools
 
Old 03-20-2012, 07:10 PM
Will Woods
 
Default makeupdates: add support for updating systemd services/targets

copy systemd .service/.target files into the appropriate directory.

also, some cleanups for makeupdates. whee!
---
scripts/makeupdates | 29 ++++++++++++++++-------------
1 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/scripts/makeupdates b/scripts/makeupdates
index 96a68ee..c51c4ed 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
" % 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,15 @@ def copyUpdatedFiles(tag, updates, cwd):
continue

if file.startswith('pyanaconda/'):
- sys.stdout.write("Including %s
" % (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.find('/') != -1:
fields = file.split('/')
subdir = fields[0]
@@ -143,13 +153,6 @@ def copyUpdatedFiles(tag, updates, cwd):
else:
sys.stdout.write("Including %s
" % (file,))
shutil.copy2(file, tmpupdates)
- elif file == 'anaconda':
- # anaconda itself we just overwrite
- sys.stdout.write("Including anaconda
")
- 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
" % (file,))
shutil.copy2(file, tmpupdates)
--
1.7.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 03-21-2012, 11:03 PM
Will Woods
 
Default makeupdates: add support for updating systemd services/targets

copy systemd .service/.target files into the appropriate directory.

also, some cleanups for makeupdates. whee!
---
scripts/makeupdates | 32 +++++++++++++++++++-------------
1 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/scripts/makeupdates b/scripts/makeupdates
index 96a68ee..7b96e00 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
" % 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
" % (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
" % (file,))
shutil.copy2(file, tmpupdates)
- elif file == 'anaconda':
- # anaconda itself we just overwrite
- sys.stdout.write("Including anaconda
")
- 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
" % (file,))
shutil.copy2(file, tmpupdates)
--
1.7.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 03-21-2012, 11:21 PM
"Brian C. Lane"
 
Default makeupdates: add support for updating systemd services/targets

On Wed, Mar 21, 2012 at 08:03:25PM -0400, Will Woods wrote:
> copy systemd .service/.target files into the appropriate directory.
>
> also, some cleanups for makeupdates. whee!
> ---
> scripts/makeupdates | 32 +++++++++++++++++++-------------
> 1 files changed, 19 insertions(+), 13 deletions(-)
>
> diff --git a/scripts/makeupdates b/scripts/makeupdates
> index 96a68ee..7b96e00 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
" % 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
" % (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
" % (file,))
> shutil.copy2(file, tmpupdates)
> - elif file == 'anaconda':
> - # anaconda itself we just overwrite
> - sys.stdout.write("Including anaconda
")
> - 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
" % (file,))
> shutil.copy2(file, tmpupdates)
> --
> 1.7.7.6

I don't like the accumulation of hard-coded script names, but that's
what we need to do, so Ack.

--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 07:06 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org