Newer
Older
# -*- python -*-
# -*- coding: utf-8 -*-
# Installsystems is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# Installsystems is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License
# along with Installsystems. If not, see <http://www.gnu.org/licenses/>.
description = u"""[image]
name = %(name)s
version = %(version)s
description = %(description)s
author = %(author)s
[compressor]
%(compressor)s
build = u"""# -*- python -*-
# -*- coding: utf-8 -*-
# global rebuild object allow you to force rebuild of payloads
# to force rebuild of payload nammed rootfs add it to the rebuild list
# rebuild list is empty by default
#rebuild += ["rootfs"]
# vim:set ts=2 sw=2 noet:
"""
parser = u"""# -*- python -*-
# global image object is a reference to current image
# global parser object is your installsystems subparser (argparse)
# you can use exit() to break the execution of the script
class TargetAction(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
if not os.path.isdir(values):
raise Exception(u"Invalid target directory %s" % values)
parser.add_argument("-n", "--hostname", dest="hostname", type=str, required=True)
parser.add_argument("target", type=str, action=TargetAction,
help="target installation directory")
setup = u"""# -*- python -*-
# global image object is a reference to current image
# namespace object is the persistant, it can be used to store data accross scripts
# you can use exit() to break the execution of the script
arrow(u"hostname: %s" % namespace.hostname)
# uncomment to extract payload named root in namespace.target directory
#image.payload["rootfs"].extract(namespace.target)
CREATE TABLE image (md5 TEXT NOT NULL PRIMARY KEY,
name TEXT NOT NULL,
date INTEGER NOT NULL,
author TEXT,
description TEXT,
size INTEGER NOT NULL,
is_min_version INTEGER NOT NULL,
format INTEGER NOT NULL,
image_md5 TEXT NOT NULL REFERENCES image(md5),
name TEXT NOT NULL,
isdir INTEGER NOT NULL,
size INTEGER NOT NULL,
PRIMARY KEY(md5, image_md5));
CREATE TABLE repository (uuid TEXT NOT NULL PRIMARY KEY,
version FLOAT NOT NULL,
motd TEXT NOT NULL);