Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
atools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Leo
atools
Commits
8afbdcdb
Commit
8afbdcdb
authored
Jun 09, 2019
by
Leo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add expensive_find_repo that is more accurate
parent
9fad6856
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
aports-lint
aports-lint
+49
-0
No files found.
aports-lint
View file @
8afbdcdb
#!/bin/sh
export
LC_ALL
=
C
# Define find_repo using 'apk' which is slow and costly when the
# user wants it.
#
# Times go up from 0.02 for community/gcc6/APKBUILD to 3.26
if
[
"
$EXPENSIVE_FIND_REPO
"
]
;
then
find_repo
()
{
[
-z
"
$1
"
]
||
[
-z
"
$2
"
]
&&
return
0
local
pkgname
=
"
$1
"
# Repo the package we are linting currently is. We want it
# for avoiding checks on repos we don't want
local
targetrepo
=
"
$2
"
# Unmaintained is the top of the ladder, it can depend on any
# of the steps below
if
[
"
$targetrepo
"
=
"unmaintained"
]
;
then
return
0
fi
# Search for the --origin of a package, matching the given name --exactly
pkgname
=
"
$(
apk search
--origin
--exact
"
$pkgname
"
\
| rev
\
|
cut
-d
-f3-
2>/dev/null
\
| rev
)
"
# If we found nothing just ignore it
[
-z
"
$pkgname
"
]
&&
return
0
check_in_repo
()
{
test
-d
"
$1
"
/
"
$2
"
&&
echo
"
$1
"
;
}
case
"
$targetrepo
"
in
testing
)
check_in_repo unmaintained
"
$pkgname
"
;;
community
)
check_in_repo unmaintained
"
$pkgname
"
check_in_repo testing
"
$pkgname
"
;;
main
)
check_in_repo unmaintained
"
$pkgname
"
check_in_repo testing
"
$pkgname
"
check_in_repo community
"
$pkgname
"
;;
esac
}
else
# Finds from which repo a package comes from
# it can return multiple values if it finds multiple matches
find_repo
()
{
...
...
@@ -51,6 +99,7 @@ find_repo() {
;;
esac
}
fi
find_dupe
()
{
local
pkgname
=
"
$1
"
repo
=
"
$2
"
r
=
...
...
Write
Preview
Markdown
is supported
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