From ad539b4254a50234c5988a69e8056261da09970c Mon Sep 17 00:00:00 2001 From: r00t Date: Sat, 10 Dec 2016 11:55:20 -0500 Subject: [PATCH] checking in some fixes- testing syncing functions --- bdisk/bsync.py | 12 ++++++++---- extra/dist.build.ini | 15 ++++++++++++--- .../etc/systemd/system/pacmandb.service | 2 +- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/bdisk/bsync.py b/bdisk/bsync.py index 3099731..effa432 100755 --- a/bdisk/bsync.py +++ b/bdisk/bsync.py @@ -10,7 +10,7 @@ import subprocess def http(conf): http = conf['http'] build = conf['build'] - tempdir = conf['tempdir'] + tempdir = build['tempdir'] arch = build['arch'] bdisk = conf['bdisk'] if conf['sync']['http']: @@ -45,7 +45,9 @@ def http(conf): # and now the magic. for k in httpfiles.keys(): destpath = httpfiles[k] - os.makedirs(os.path.split('{0}/{1}'.format(tempdir, destpath))[0], exist_ok = True) + fulldest = '{0}/{1}'.format(httpdir, destpath) + parentdir = os.path.split(fulldest)[0] + os.makedirs(parentdir, exist_ok = True) shutil.copy2('{0}/{1}'.format(tempdir, k), '{0}/{1}'.format(httpdir, httpfiles[k])) for root, dirs, files in os.walk(httpdir): for d in dirs: @@ -57,7 +59,7 @@ def tftp(conf): # TODO: pxelinux cfg tftp = conf['tftp'] build = conf['build'] - tempdir = conf['build'] + tempdir = build['tempdir'] arch = build['arch'] bdisk = conf['bdisk'] if conf['sync']['tftp']: @@ -91,7 +93,9 @@ def tftp(conf): # and now the magic. for k in tftpfiles.keys(): destpath = tftpfiles[k] - os.makedirs(os.path.split('{0}/{1}'.format(tempdir, destpath))[0], exist_ok = True) + fulldest = '{0}/{1}'.format(tftpdir, destpath) + parentdir = os.path.split(fulldest)[0] + os.makedirs(parentdir, exist_ok = True) shutil.copy2('{0}/{1}'.format(tempdir, k), '{0}/{1}'.format(tftpdir, tftpfiles[k])) for root, dirs, files in os.walk(tftpdir): for d in dirs: diff --git a/extra/dist.build.ini b/extra/dist.build.ini index 47e2cc6..3165286 100644 --- a/extra/dist.build.ini +++ b/extra/dist.build.ini @@ -57,6 +57,11 @@ ver = ; 2.) ASCII *only* dev = r00t^2 +; Your email address. +; This is only used for the commit message if you enable +; sync:git. +email = bts@square-r00t.net + ; What this distribution/project is used for. ; 0.) Can contain whitespace ; 1.) Can be mixed-case, uppercase, or lowercase @@ -327,7 +332,9 @@ rsync = no ; 0.) No whitespace ; 1.) If blank, HTTP preparation/generation will not be done ; 2.) If specified, it will be created if it doesn't exist -path = ${build:basedir}/http +; 3.) If it does exist, it will be deleted first- MAKE SURE +; you do not store files here that you want to keep. +path = ${build:tempdir}/http ; What user and group, if applicable, should the HTTP files ; be owned as? This is most likely going to be either 'http', @@ -350,14 +357,16 @@ group = http ; 0.) No whitespace ; 1.) If blank, TFTP preparation/generation will not be done ; 2.) If specified, it will be created if it doesn't exist -path = ${build:basedir}/tftpboot +; 3.) If it does exist, it will be deleted first- MAKE SURE +; you do not store files here that you want to keep. +path = ${build:tempdir}/tftpboot ; What user and group, if applicable, should the TFTP files ; be owned as? This is most likely going to be either 'tftp' ; or 'root'. ; 0.) No whitespace ; 1.) User must exist on system -; 2.) If sync:tftpdir is blank, they will not be used +; 2.) If sync:tftp is blank, they will not be used user = root group = root diff --git a/extra/pre-build.d/etc/systemd/system/pacmandb.service b/extra/pre-build.d/etc/systemd/system/pacmandb.service index edefa06..f5c6162 100644 --- a/extra/pre-build.d/etc/systemd/system/pacmandb.service +++ b/extra/pre-build.d/etc/systemd/system/pacmandb.service @@ -4,7 +4,7 @@ Description=Restoring Installed Packages DB [Service] Type=oneshot #ExecStart=/usr/bin/tar -Jxf /usr/local/pacman.db.tar.xz -C /var/lib/pacman/ -ExecStart=/usr/bin/bash /etc/systemd/system/scripts/pacmandb.sh +ExecStart=/usr/bin/bash /etc/systemd/scripts/pacmandb.sh RemainAfterExit=yes [Install]