Remove running scripts
This commit is contained in:
parent
9abd492a3c
commit
6deab80dbf
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
from typing import Dict, List, Optional
|
from typing import Dict, List
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import contextlib
|
import contextlib
|
||||||
@ -9,7 +9,6 @@ import glob
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import shutil
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@ -30,7 +29,6 @@ class CB:
|
|||||||
self.images_dir = data_dir + 'images/'
|
self.images_dir = data_dir + 'images/'
|
||||||
self.work_dir = data_dir + 'work/'
|
self.work_dir = data_dir + 'work/'
|
||||||
self.out_dir = data_dir + 'out/'
|
self.out_dir = data_dir + 'out/'
|
||||||
self.scripts_dir = data_dir + 'scripts/'
|
|
||||||
self.system_datadir = system_datadir
|
self.system_datadir = system_datadir
|
||||||
|
|
||||||
self.date = datetime.date.today().strftime('%Y%m%d')
|
self.date = datetime.date.today().strftime('%Y%m%d')
|
||||||
@ -107,26 +105,6 @@ class CB:
|
|||||||
self._repository_url)
|
self._repository_url)
|
||||||
return url.format(branch=branch, arch=arch)
|
return url.format(branch=branch, arch=arch)
|
||||||
|
|
||||||
def run_script(self, name: str, args: Optional[List[str]] = None) -> None:
|
|
||||||
path = self.scripts_dir + name
|
|
||||||
if not os.path.exists(path):
|
|
||||||
system_path = f'{self.system_datadir}scripts/{name}'
|
|
||||||
if os.path.exists(system_path):
|
|
||||||
shutil.copyfile(system_path, path)
|
|
||||||
else:
|
|
||||||
msg = f'Required script `{name}` does not exist'
|
|
||||||
self.error(msg)
|
|
||||||
if not os.access(path, os.X_OK):
|
|
||||||
st = os.stat(path)
|
|
||||||
os.chmod(path, st.st_mode | 0o111)
|
|
||||||
|
|
||||||
if args is None:
|
|
||||||
args = [path]
|
|
||||||
else:
|
|
||||||
args = [path] + args
|
|
||||||
|
|
||||||
self.call(args)
|
|
||||||
|
|
||||||
def call(
|
def call(
|
||||||
self,
|
self,
|
||||||
cmd: List[str],
|
cmd: List[str],
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
#!/bin/sh -efu
|
|
||||||
|
|
||||||
# Generate apt.conf and sources.list files for some (listed below) arches and
|
|
||||||
# repositories. Save it in the directory `apt' by default, but it can be
|
|
||||||
# changed using firt command line argument.
|
|
||||||
|
|
||||||
ROOT="file:///space/ALT" # Place with ALT repositories
|
|
||||||
#ROOT="http://ftp.altlinux.org/pub/distributions/ALTLinux"
|
|
||||||
ARCHES="i586 x86_64 aarch64"
|
|
||||||
REPOS="p8 Sisyphus"
|
|
||||||
APT_DIR="${1:-apt}"
|
|
||||||
|
|
||||||
mkdir -p "$APT_DIR"
|
|
||||||
APT_DIR="$(realpath "$APT_DIR")"
|
|
||||||
pushd "$APT_DIR" &> /dev/null
|
|
||||||
|
|
||||||
for ARCH in $ARCHES
|
|
||||||
do
|
|
||||||
for REPO in $REPOS
|
|
||||||
do
|
|
||||||
cat > "$APT_DIR/apt.conf.${REPO}.${ARCH}" <<EOF
|
|
||||||
Dir::Etc::main "/dev/null";
|
|
||||||
Dir::Etc::parts "/var/empty";
|
|
||||||
Dir::Etc::SourceList "$APT_DIR/sources.list.${REPO}.${ARCH}";
|
|
||||||
Dir::Etc::SourceParts "/var/empty";
|
|
||||||
Dir::Etc::preferences "/dev/null";
|
|
||||||
Dir::Etc::preferencesparts "/var/empty";
|
|
||||||
EOF
|
|
||||||
cat > "$APT_DIR/sources.list.${REPO}.${ARCH}" <<EOF
|
|
||||||
rpm $ROOT/$REPO $ARCH classic
|
|
||||||
rpm $ROOT/$REPO noarch classic
|
|
||||||
EOF
|
|
||||||
done
|
|
||||||
done
|
|
||||||
|
|
||||||
popd &> /dev/null
|
|
Loading…
Reference in New Issue
Block a user