euscan: add README, TODO and some scripts
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
This commit is contained in:
17
euscanwww/scripts/euscan.fcgi
Executable file
17
euscanwww/scripts/euscan.fcgi
Executable file
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import sys, os
|
||||
import os.path
|
||||
|
||||
PROJECT = '/path/to/euscanwww'
|
||||
|
||||
sys.path.insert(0, os.path.dirname(PROJECT))
|
||||
sys.path.insert(0, PROJECT)
|
||||
|
||||
os.chdir(PROJECT)
|
||||
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = "euscanwww.settings"
|
||||
os.environ['HOME'] = "/path/to/home"
|
||||
|
||||
from django.core.servers.fastcgi import runfastcgi
|
||||
runfastcgi(method="threaded", daemonize="false", maxspare=1)
|
81
euscanwww/scripts/local-tree/etc/layman/layman.cfg
Normal file
81
euscanwww/scripts/local-tree/etc/layman/layman.cfg
Normal file
@ -0,0 +1,81 @@
|
||||
[MAIN]
|
||||
|
||||
#-----------------------------------------------------------
|
||||
# Defines the directory where overlays should be installed
|
||||
|
||||
storage : /path/to/euscan/local/var/lib/layman
|
||||
|
||||
#-----------------------------------------------------------
|
||||
# Remote overlay lists will be stored here
|
||||
# layman will append _md5(url).xml to each filename
|
||||
|
||||
cache : %(storage)s/cache
|
||||
|
||||
#-----------------------------------------------------------
|
||||
# The list of locally installed overlays
|
||||
|
||||
local_list: %(storage)s/overlays.xml
|
||||
|
||||
#-----------------------------------------------------------
|
||||
# Path to the make.conf file that should be modified by
|
||||
# layman
|
||||
|
||||
make_conf : %(storage)s/make.conf
|
||||
|
||||
#-----------------------------------------------------------
|
||||
# URLs of the remote lists of overlays (one per line) or
|
||||
# local overlay definitions
|
||||
#
|
||||
#overlays : http://www.gentoo.org/proj/en/overlays/repositories.xml
|
||||
# http://dev.gentoo.org/~wrobel/layman/global-overlays.xml
|
||||
# http://mydomain.org/my-layman-list.xml
|
||||
# file:///var/lib/layman/my-list.xml
|
||||
|
||||
overlays : http://www.gentoo.org/proj/en/overlays/repositories.xml
|
||||
|
||||
#-----------------------------------------------------------
|
||||
# Proxy support
|
||||
# If unset, layman will use the http_proxy environment variable.
|
||||
#
|
||||
#proxy : http://[user:pass@]www.my-proxy.org:3128
|
||||
|
||||
#-----------------------------------------------------------
|
||||
# Strict checking of overlay definitions
|
||||
#
|
||||
# Set either to "yes" or "no". If "no" layman will issue
|
||||
# warnings if an overlay definition is missing either
|
||||
# description or contact information.
|
||||
#
|
||||
nocheck : yes
|
||||
|
||||
#-----------------------------------------------------------
|
||||
# Umask settings
|
||||
#
|
||||
# layman should usually work with a umask of 0022. You should
|
||||
# only change this setting if you are absolutely certain that
|
||||
# you know what you are doing.
|
||||
#
|
||||
#umask : 0022
|
||||
|
||||
#-----------------------------------------------------------
|
||||
# Command overrides
|
||||
#
|
||||
# You can have commands point to either a binary at a different
|
||||
# location, e.g.
|
||||
#
|
||||
# /home/you/local/bin/git
|
||||
#
|
||||
# or just the command, e.g.
|
||||
#
|
||||
# git
|
||||
#
|
||||
# to use PATH-based resolution of the binary to call.
|
||||
#
|
||||
#bzr_command : /usr/bin/bzr
|
||||
#cvs_command : /usr/bin/cvs
|
||||
#darcs_command : /usr/bin/darcs
|
||||
#git_command : /usr/bin/git
|
||||
#mercurial_command : /usr/bin/hg
|
||||
#rsync_command : /usr/bin/rsync
|
||||
#svn_command : /usr/bin/svn
|
||||
#tar_command : /bin/tar
|
19
euscanwww/scripts/local-tree/etc/make.conf
Normal file
19
euscanwww/scripts/local-tree/etc/make.conf
Normal file
@ -0,0 +1,19 @@
|
||||
CFLAGS="-march=native -O2 -pipe"
|
||||
CXXFLAGS="${CFLAGS}"
|
||||
CHOST="x86_64-pc-linux-gnu"
|
||||
|
||||
USE=""
|
||||
ACCEPT_LICENSE="*"
|
||||
|
||||
EUSCAN_ROOT="/path/to/euscan/local"
|
||||
|
||||
PORTDIR="${EUSCAN_ROOT}/usr/portage"
|
||||
PORTDIR_OVERLAY="$PORTDIR"
|
||||
|
||||
FEATURES="$FEATURES -strict metadata-transfer"
|
||||
|
||||
## Add overlays here
|
||||
# PORTDIR_OVERLAY="${EUSCAN_ROOT}/usr/local/portage $PORTDIR_OVERLAY"
|
||||
|
||||
## Or use layman
|
||||
# source ${EUSCAN_ROOT}/var/lib/layman/make.conf
|
BIN
euscanwww/scripts/local-tree/var/cache/eix
vendored
Normal file
BIN
euscanwww/scripts/local-tree/var/cache/eix
vendored
Normal file
Binary file not shown.
24
euscanwww/scripts/regen-seq.py
Normal file
24
euscanwww/scripts/regen-seq.py
Normal file
@ -0,0 +1,24 @@
|
||||
import os, sys
|
||||
sys.path.insert(0, '../')
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'euscanwww.settings'
|
||||
|
||||
from django import db
|
||||
|
||||
c = db.connection.cursor()
|
||||
try:
|
||||
c.execute(r"""SELECT c.relname
|
||||
FROM pg_catalog.pg_class c
|
||||
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
|
||||
WHERE c.relkind IN ('S','')
|
||||
AND n.nspname NOT IN ('pg_catalog', 'pg_toast')
|
||||
AND pg_catalog.pg_table_is_visible(c.oid)
|
||||
""")
|
||||
to_update = []
|
||||
for row in c:
|
||||
seq_name = row[0]
|
||||
rel_name = seq_name.split("_id_seq")[0]
|
||||
to_update.append((seq_name, rel_name,))
|
||||
for row in to_update:
|
||||
c.execute(r"SELECT setval('%s', max(id)) FROM %s"%row)
|
||||
finally:
|
||||
c.close()
|
Reference in New Issue
Block a user