Re: [PATCH f17-branch] makeupdates: add support for updating systemd services/targets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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\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)
> -- 
> 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)

Attachment: pgpa5LbdIwLhg.pgp
Description: PGP signature

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux