checking in some fixes- testing syncing functions

This commit is contained in:
brent s. 2016-12-10 11:55:20 -05:00
parent f81f23cc6d
commit ad539b4254
3 changed files with 21 additions and 8 deletions

View File

@ -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:

View File

@ -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


View File

@ -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]