Commit bc8ac537 authored by Bernhard Link's avatar Bernhard Link

rename listdistros command to _listcodenames

parent 8bc1c044
2018-08-12 Bernhard R. Link <brlink@debian.org>
* add _listcodenames command (based on work from Benjamin Drung)
2017-03-02 Bernhard R. Link <brlink@debian.org>
* handle .asc files in source files better
(thanks to Marc Laue)
......
......@@ -536,9 +536,6 @@ For a format of the \fB.outlog\fP files generated for this script see the
\fBmanual.html\fP shiped with reprepro.
.SH COMMANDS
.TP
.BR listdistros
Print the codenames of all configured distributions.
.TP
.BR export " [ " \fIcodenames\fP " ]"
Generate all index files for the specified distributions.
......@@ -1141,6 +1138,9 @@ List what compressions format can be uncompressed and how.
Use builtin or external uncompression to uncompress the specified
file of the specified format into the specified target.
.TP
.BR _listcodenames
Print - on per line - the codenames of all configured distributions.
.TP
.B _listconfidentifiers \fIidentifier\fP \fR[\fP \fIdistributions...\fP \fR]\fP
Print - one per line - all identifiers of subdatabases as derived from the
configuration.
......
......@@ -306,7 +306,6 @@ _reprepro()
includedsc\
includeudeb\
list\
listdistros\
listfilter\
listmatched\
ls\
......@@ -352,6 +351,7 @@ _reprepro()
_fakeemptyfilelist\
_forget\
_listchecksums\
_listcodenames\
_listconfidentifiers\
_listdbidentifiers\
_listmd5sums\
......@@ -416,7 +416,7 @@ _reprepro()
fi
;;
collectnewchecksums|cleanlists|listdistros)
collectnewchecksums|cleanlists|_listcodenames)
return 0
;;
......
......@@ -273,6 +273,7 @@ hiddencommands=(
_fakeemptyfilelist:"create an empty fake filelist cache item for a filekey"
_forget:"forget a file specified by filekey."
_listchecksums:"print a list of filekeys and their checksums"
_listcodenames:"list configured codenames"
_listconfidentifiers:"list parts of the repository in the configuration"
_listdbidentifiers:"list parts of the repository in the database"
_listmd5sums:"print a list of filekeys and their md5 hashes"
......@@ -388,7 +389,7 @@ case "$state" in
fi
;;
(cleanlists|clearvanished|dumpreferences|dumpunreferened|deleteunreferenced|_listmd5sums|_listchecksums|_addmd5sums|_addchecksums|__dumpuncompressors|transatelegacychecksums)
(cleanlists|clearvanished|dumpreferences|dumpunreferened|deleteunreferenced|_listmd5sums|_listchecksums|_addmd5sums|_addchecksums|__dumpuncompressors|transatelegacychecksums|_listcodenames)
;;
(_dumpcontents|_removereferences)
if [[ "$state" = "first argument" ]] ; then
......
......@@ -1172,11 +1172,15 @@ ACTION_B(y, n, y, buildneeded) {
}
}
ACTION_C(n, n, n, listdistros) {
for (struct distribution *d = alldistributions ; d != NULL ; d = d->next) {
printf("%s\n", d->codename);
ACTION_C(n, n, n, listcodenames) {
retvalue r = RET_NOTHING;
struct distribution *d;
for (d = alldistributions ; d != NULL ; d = d->next) {
puts(d->codename);
r = RET_OK;
}
return RET_OK;
return r;
}
static retvalue list_in_target(struct target *target, const char *packagename) {
......@@ -3916,8 +3920,6 @@ static const struct action {
1, 1, "[-C <component>] [-A <architecture>] [-T <type>] ls <package-name>"},
{"lsbycomponent", A_ROBact(lsbycomponent),
1, 1, "[-C <component>] [-A <architecture>] [-T <type>] lsbycomponent <package-name>"},
{"listdistros", A_C(listdistros),
0, 0, "listdistros"},
{"list", A_ROBact(list),
1, 2, "[-C <component>] [-A <architecture>] [-T <type>] list <codename> [<package-name>]"},
{"listfilter", A_ROBact(listfilter),
......@@ -4016,6 +4018,8 @@ static const struct action {
0, -1, "_listconfidentifiers"},
{"_listdbidentifiers", A_ROB(listdbidentifiers)|MAY_UNUSED,
0, -1, "_listdbidentifiers"},
{"_listcodenames", A_C(listcodenames),
0, 0, "_listcodenames"},
{"clearvanished", A_D(clearvanished)|MAY_UNUSED,
0, 0, "[--delete] clearvanished"},
{"processincoming", A_D(processincoming)|NEED_DELNEW,
......
set -u
. "$TESTSDIR"/test.inc
testrun - -b . _listcodenames 3<<EOF
return 254
stderr
*=Error opening config file './conf/distributions': No such file or directory(2)
-v0*=There have been errors!
stdout
EOF
mkdir -p conf
touch conf/distributions
testrun - -b . _listcodenames 3<<EOF
return 249
stderr
*=No distribution definitions found in ./conf/distributions!
-v0*=There have been errors!
stdout
EOF
cat > conf/distributions <<EOF
Codename: foo/updates
Suite: suitename
Components: a bb ccc dddd
UDebComponents: a dddd
Architectures: x source
EOF
testrun - -b . _listcodenames 3<<EOF
stderr
stdout
*=foo/updates
EOF
testrun - -b . --nothingiserror _listcodenames 3<<EOF
stderr
stdout
*=foo/updates
EOF
dodo test ! -d db
dodo test ! -d pool
dodo test ! -d dists
rm -r -f conf
testsuccess
......@@ -264,6 +264,7 @@ else
runtest onlysmalldeletes
runtest override
runtest includeasc
runtest listcodenames
fi
echo "$number_tests tests, $number_success succeded, $number_failed failed, $number_skipped skipped, $number_missing missing"
exit 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment