Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update database entries to match repo-add behavior #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions src/database.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,7 @@ static void compile_desc_entry(struct database_writer *db, struct pkg *pkg)
write_entry(&db->buf, "BUILDDATE", pkg->builddate);
write_entry(&db->buf, "PACKAGER", pkg->packager);
write_entry(&db->buf, "REPLACES", pkg->replaces);
}

static void compile_depends_entry(struct database_writer *db, struct pkg *pkg)
{
write_entry(&db->buf, "DEPENDS", pkg->depends);
write_entry(&db->buf, "CONFLICTS", pkg->conflicts);
write_entry(&db->buf, "PROVIDES", pkg->provides);
Expand Down Expand Up @@ -338,10 +335,6 @@ static void compile_database_entry(struct database_writer *db, struct pkg *pkg)
compile_desc_entry(db, pkg);
commit_entry(db, "desc", folder);
}
if (db->contents & DB_DEPENDS) {
compile_depends_entry(db, pkg);
commit_entry(db, "depends", folder);
}
if (db->contents & DB_FILES) {
compile_files_entry(db, pkg);
commit_entry(db, "files", folder);
Expand Down
2 changes: 1 addition & 1 deletion src/database.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ struct repo;

enum contents {
DB_DESC = 1,
DB_DEPENDS = 1 << 2,
DB_DEPENDS __attribute__ ((deprecated ("Dependency information now included in DB_DESC"))) = 1 << 2,
DB_FILES = 1 << 3,
DB_DELTAS = 1 << 4
};
Expand Down
4 changes: 2 additions & 2 deletions src/repose.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,10 +553,10 @@ int main(int argc, char *argv[])
if (!repo.dirty) {
trace("repo does not need updating\n");
} else {
write_database(&repo, repo.dbname, DB_DESC | DB_DEPENDS);
write_database(&repo, repo.dbname, DB_DESC);

if (repo.filesname) {
write_database(&repo, repo.filesname, DB_FILES);
write_database(&repo, repo.filesname, DB_DESC | DB_FILES);
}

link_db(&repo);
Expand Down
12 changes: 2 additions & 10 deletions tests/test_desc.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@

%PACKAGER%
Simon Gomizelj <[email protected]>
'''


REPOSE_DEPENDS = '''%DEPENDS%
%DEPENDS%
pacman
libarchive
gnupg
Expand Down Expand Up @@ -80,7 +78,7 @@ def pkg():

def test_parse_desc(pkg, parser):
parser.feed(pkg, REPOSE_DESC)
assert parser.entry == lib.PKG_PACKAGER
assert parser.entry == lib.PKG_MAKEDEPENDS

assert pkg.base is None
assert pkg.base64sig is None
Expand All @@ -94,12 +92,6 @@ def test_parse_desc(pkg, parser):
assert pkg.builddate == "Nov 28, 2015, 06:04:29"
assert pkg.packager == 'Simon Gomizelj <[email protected]>'
assert pkg.licenses == ['GPL']


def test_parse_depends(pkg, parser):
parser.feed(pkg, REPOSE_DEPENDS)
assert parser.entry == lib.PKG_MAKEDEPENDS

assert pkg.depends == ['pacman', 'libarchive', 'gnupg']
assert pkg.conflicts == ['repose']
assert pkg.provides == ['repose']
Expand Down