Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
dbscripts
Commits
9e1e5f1b
Verified
Commit
9e1e5f1b
authored
Sep 01, 2020
by
Eli Schwartz
Committed by
Morten Linderud
Nov 20, 2021
Browse files
debug prints
parent
b862bca8
Changes
4
Hide whitespace changes
Inline
Side-by-side
db-functions
View file @
9e1e5f1b
...
...
@@ -459,6 +459,7 @@ check_repo_permission() {
}
set_repo_permission
()
{
local
-
;
set
-x
local
repo
=
$1
local arch
=
$2
local
dbfile
=
"
${
FTP_BASE
}
/
${
repo
}
/os/
${
arch
}
/
${
repo
}${
DBEXT
}
"
...
...
@@ -476,11 +477,13 @@ set_repo_permission() {
}
arch_repo_modify
()
{
echo
"call: arch_repo_modify
${
@@Q
}
"
local
action
=
$1
local
repo
=
$2
local arch
=
$3
local
pkgs
=(
"
${
@
:4
}
"
)
local
dbfile
=
"
${
FTP_BASE
}
/
${
repo
}
/os/
${
arch
}
/
${
repo
}${
DBEXT
}
"
tree
"
${
FTP_BASE
}
"
if
[[
${
action
}
=
remove
&&
!
-f
${
dbfile
}
]]
;
then
error
"No database found at '%s'"
"
$dbfile
"
...
...
@@ -489,6 +492,7 @@ arch_repo_modify() {
# package files for repo-add might be relative to repo dir
pushd
"
${
dbfile
%/*
}
"
>
/dev/null
ls
/usr/bin/
"repo-
${
action
}
"
-q
"
${
dbfile
}
"
"
${
pkgs
[@]
}
"
\
||
error
'%s'
"repo-
${
action
}
${
dbfile
@Q
}
${
pkgs
[*]@Q
}
"
set_repo_permission
"
${
repo
}
"
"
${
arch
}
"
...
...
db-update
View file @
9e1e5f1b
...
...
@@ -79,6 +79,7 @@ done
for
repo
in
"
${
repos
[@]
}
"
;
do
msg
"Updating [%s]..."
"
$repo
"
tree
"
${
STAGING
}
/
${
repo
}
"
any_pkgs
=(
$(
getpkgfiles
"
${
STAGING
}
/
${
repo
}
/"
*
-any
${
PKGEXTS
}
2>/dev/null
)
)
for
pkgarch
in
"
${
ARCHES
[@]
}
"
;
do
add_pkgs
=()
...
...
@@ -115,6 +116,7 @@ for repo in "${repos[@]}"; do
ln
-s
"../../../
${
currentpool
}
/
${
pkgfile
}
.sig"
"
$FTP_BASE
/
${
currentrepo
}
/os/
${
pkgarch
}
"
fi
done
declare
-p
add_pkgs debug_pkgs
if
((
${#
add_pkgs
[@]
}
>=
1
))
;
then
arch_repo_modify add
"
${
repo
}
"
"
${
pkgarch
}
"
"
${
add_pkgs
[@]
}
"
fi
...
...
test/Dockerfile
View file @
9e1e5f1b
FROM
docker.io/archlinux/archlinux
RUN
pacman
-Syu
--noconfirm
--needed
sudo
fakeroot
awk
subversion make kcov bash-bats gettext
grep
RUN
pacman
-Syu
--noconfirm
--needed
sudo
fakeroot
awk
subversion make kcov bash-bats gettext
grep
tree
RUN
pacman-key
--init
RUN
echo
'%wheel ALL=(ALL) NOPASSWD: ALL'
>
/etc/sudoers.d/wheel
RUN
useradd
-N
-g
users
-G
wheel
-d
/build
-m
tester
...
...
test/cases/db-move.bats
View file @
9e1e5f1b
...
...
@@ -7,15 +7,21 @@ load ../lib/common
local arch
for pkgbase in ${pkgs[@]}; do
echo "releasing to testing: $pkgbase"
releasePackage testing ${pkgbase}
done
echo "db-updating..."
db-update
echo "db-move testing -> extra pkg-simple-a"
db-move testing extra pkg-simple-a
echo checkRemovedPackage testing pkg-simple-a
checkRemovedPackage testing pkg-simple-a
echo checkPackage extra pkg-simple-a 1-1
checkPackage extra pkg-simple-a 1-1
echo checkPackage testing pkg-simple-b 1-1
checkPackage testing pkg-simple-b 1-1
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment