buildservice_PYTHON = \
src/buildservice/__init__.py \
src/buildservice/__version__.py \
- src/buildservice/arches.py \
src/buildservice/aws.py \
src/buildservice/base.py \
src/buildservice/bugtracker.py \
import os
import pakfire
-from . import arches
from . import aws
from . import bugtracker
from . import builders
# Global pakfire settings (from database).
self.settings = settings.Settings(self)
- self.arches = arches.Arches(self)
self.aws = aws.AWS(self)
self.builds = builds.Builds(self)
self.cache = cache.Cache(self)
+++ /dev/null
-#!/usr/bin/python
-
-from . import base
-
-_priorities = {
- "noarch" : 0,
-
- # 64 bit
- "x86_64" : 1,
- "aarch64" : 2,
-
- # 32 bit
- "i686" : 3,
- "armv7hl" : 4,
- "armv5tel" : 5,
-}
-
-def priority(arch):
- try:
- return _priorities[arch]
- except KeyError:
- return 99
-
-class Arches(base.Object):
- def __iter__(self):
- res = self.db.query("SELECT name FROM arches \
- WHERE NOT name = ANY(%s)", ["noarch", "src"])
-
- return iter(sorted((a.name for a in res), key=priority))
-
- def exists(self, name):
- # noarch doesn't really exist
- if name == "noarch":
- return False
-
- res = self.db.get("SELECT 1 FROM arches \
- WHERE name = %s", name)
-
- if res:
- return True
-
- return False
-
- def expand(self, arches):
- if arches == "all":
- return list(self)
-
- res = []
- for arch in arches.split():
- if self.exists(arch):
- res.append(arch)
-
- return res
arches = self.supported_arches
# Create a new job for every given archirecture.
- for arch in self.backend.arches.expand(arches):
- # Don't create jobs for src
- if arch == "src":
- continue
-
- job = self.add_job(arch, **kwargs)
- jobs.append(job)
+ #for arch in self.backend.arches.expand(arches):
+ # # Don't create jobs for src
+ # if arch == "src":
+ # continue
+ #
+ # job = self.add_job(arch, **kwargs)
+ # jobs.append(job)
# Return all newly created jobs.
return jobs
log = logging.getLogger("builds")
log.propagate = 1
-from . import arches
from . import base
from . import logs
from . import users
SET default_table_access_method = heap;
---
--- Name: arches; Type: TABLE; Schema: public; Owner: pakfire
---
-
-CREATE TABLE public.arches (
- id integer NOT NULL,
- name text NOT NULL
-);
-
-
-ALTER TABLE public.arches OWNER TO pakfire;
-
---
--- Name: arches_id_seq; Type: SEQUENCE; Schema: public; Owner: pakfire
---
-
-CREATE SEQUENCE public.arches_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-
-ALTER TABLE public.arches_id_seq OWNER TO pakfire;
-
---
--- Name: arches_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: pakfire
---
-
-ALTER SEQUENCE public.arches_id_seq OWNED BY public.arches.id;
-
-
--
-- Name: builder_stats; Type: TABLE; Schema: public; Owner: pakfire
--
ALTER SEQUENCE public.users_permissions_id_seq OWNED BY public.users_permissions.id;
---
--- Name: arches id; Type: DEFAULT; Schema: public; Owner: pakfire
---
-
-ALTER TABLE ONLY public.arches ALTER COLUMN id SET DEFAULT nextval('public.arches_id_seq'::regclass);
-
-
--
-- Name: builders id; Type: DEFAULT; Schema: public; Owner: pakfire
--
ALTER TABLE ONLY public.users_permissions ALTER COLUMN id SET DEFAULT nextval('public.users_permissions_id_seq'::regclass);
---
--- Name: arches arches_name; Type: CONSTRAINT; Schema: public; Owner: pakfire
---
-
-ALTER TABLE ONLY public.arches
- ADD CONSTRAINT arches_name UNIQUE (name);
-
-
--
-- Name: distributions distributions_pkey; Type: CONSTRAINT; Schema: public; Owner: pakfire
--
ADD CONSTRAINT distributions_pkey PRIMARY KEY (id);
---
--- Name: arches idx_2197943_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire
---
-
-ALTER TABLE ONLY public.arches
- ADD CONSTRAINT idx_2197943_primary PRIMARY KEY (id);
-
-
--
-- Name: builders idx_2197954_primary; Type: CONSTRAINT; Schema: public; Owner: pakfire
--
ADD CONSTRAINT filelists_pkg_id FOREIGN KEY (pkg_id) REFERENCES public.packages(id);
---
--- Name: jobs jobs_arch; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
---
-
-ALTER TABLE ONLY public.jobs
- ADD CONSTRAINT jobs_arch FOREIGN KEY (arch) REFERENCES public.arches(name);
-
-
--
-- Name: jobs jobs_build_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
--
ADD CONSTRAINT mirrors_history_user_id FOREIGN KEY (user_id) REFERENCES public.users(id);
---
--- Name: packages packages_arch; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
---
-
-ALTER TABLE ONLY public.packages
- ADD CONSTRAINT packages_arch FOREIGN KEY (arch) REFERENCES public.arches(name);
-
-
--
-- Name: packages packages_commit_id; Type: FK CONSTRAINT; Schema: public; Owner: pakfire
--
if not distro:
raise tornado.web.HTTPError(404, "Distro not found")
- self.render("distro-edit.html", distro=distro,
- arches=self.backend.arches, sources=self.sources)
+ self.render("distro-edit.html", distro=distro, sources=self.sources)
@tornado.web.authenticated
def post(self, name):
# Update the tag.
distro.tag = tag
- # Update architectures.
- arches = []
- for arch in self.get_arguments("arches", []):
- # Check if arch exists
- if not self.backend.arches.exists(arch):
- continue
-
- arches.append(arch)
-
- distro.arches = arches
+ # Update architectures
+ distro.arches = self.get_arguments("arches", [])
self.redirect("/distribution/%s" % distro.sname)
# This is a plaintext file.
self.set_header("Content-Type", "text/plain")
- arch = self.get_argument("arch", None)
- if not arch or not self.backend.arches.exists(arch):
- raise tornado.web.HTTPError(400, "You must specify a valid architecture")
+ # Fetch architecture
+ arch = self.get_argument("arch")
ret = {
"type" : "mirrorlist",