mirror of
https://github.com/lilydjwg/archrepo2.git
synced 2025-03-10 12:02:43 +00:00
Add ARM (arm, armv6h, armv7h) and AArch64 support
Also make sure the directory is created before watching it/creating files in it.
This commit is contained in:
parent
a107e8c849
commit
5a28db12f2
2 changed files with 11 additions and 5 deletions
|
@ -32,7 +32,8 @@ path: /home/lilydjwg/tmpfs/test
|
||||||
#auto-rename: on
|
#auto-rename: on
|
||||||
|
|
||||||
# By enabling symlink-any, the server will automatically symlink the package
|
# By enabling symlink-any, the server will automatically symlink the package
|
||||||
# files of 'any' architecture to 'i686' and 'x86_64'
|
# files of 'any' architecture to 'arm', 'armv6h', 'armv7h', 'aarch64',
|
||||||
|
# 'i686' and 'x86_64'
|
||||||
# Default is on.
|
# Default is on.
|
||||||
#symlink-any: on
|
#symlink-any: on
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,11 @@ from . import dbutil
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
# handles only x86_64, i686 and any arch packages
|
# handles only arm*, aarch64, x86_64, i686 and any arch packages
|
||||||
_pkgfile_pat = re.compile(r'(?:^|/).+-[^-]+-[\d.]+-(?:x86_64|i686|any)\.pkg\.tar\.xz(?:\.sig)?$')
|
_supported_archs = ('arm', 'armv6h', 'armv7h', 'aarch64',
|
||||||
|
'i686', 'x86_64', 'any')
|
||||||
|
# assume none of the archs has regex meta characters
|
||||||
|
_pkgfile_pat = re.compile(r'(?:^|/).+-[^-]+-[\d.]+-(?:' + '|'.join(_supported_archs) + r')\.pkg\.tar\.xz(?:\.sig)?$')
|
||||||
|
|
||||||
def same_existent_file(a, b):
|
def same_existent_file(a, b):
|
||||||
try:
|
try:
|
||||||
|
@ -252,9 +255,10 @@ class EventHandler(pyinotify.ProcessEvent):
|
||||||
(filename text unique,
|
(filename text unique,
|
||||||
pkgrepo text)''')
|
pkgrepo text)''')
|
||||||
|
|
||||||
dirs = [os.path.join(base, x) for x in ('any', 'i686', 'x86_64')]
|
dirs = [os.path.join(base, x) for x in _supported_archs]
|
||||||
self.files = files = set()
|
self.files = files = set()
|
||||||
for d in dirs:
|
for d in dirs:
|
||||||
|
os.makedirs(d, exist_ok=True)
|
||||||
for f in os.listdir(d):
|
for f in os.listdir(d):
|
||||||
p = os.path.join(d, f)
|
p = os.path.join(d, f)
|
||||||
if os.path.exists(p): # filter broken symlinks
|
if os.path.exists(p): # filter broken symlinks
|
||||||
|
@ -348,7 +352,7 @@ class EventHandler(pyinotify.ProcessEvent):
|
||||||
d = newd
|
d = newd
|
||||||
|
|
||||||
if self._symlink_any and act.arch == 'any':
|
if self._symlink_any and act.arch == 'any':
|
||||||
for newarch in ('i686', 'x86_64', 'any'):
|
for newarch in _supported_archs:
|
||||||
if newarch == arch:
|
if newarch == arch:
|
||||||
# this file itself
|
# this file itself
|
||||||
continue
|
continue
|
||||||
|
@ -357,6 +361,7 @@ class EventHandler(pyinotify.ProcessEvent):
|
||||||
if action == 'add':
|
if action == 'add':
|
||||||
oldpath = os.path.join('..', arch, file)
|
oldpath = os.path.join('..', arch, file)
|
||||||
if not same_existent_file(oldpath, newpath):
|
if not same_existent_file(oldpath, newpath):
|
||||||
|
os.makedirs(newd, exist_ok=True)
|
||||||
try:
|
try:
|
||||||
self.our_links.add(newpath)
|
self.our_links.add(newpath)
|
||||||
os.symlink(oldpath, newpath)
|
os.symlink(oldpath, newpath)
|
||||||
|
|
Loading…
Add table
Reference in a new issue