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
apk-tools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
61
Issues
61
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
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
alpine
apk-tools
Commits
30965aa8
Commit
30965aa8
authored
Jan 12, 2012
by
Timo Teräs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
solver: print repository tag when committing package changes
parent
f1de353b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
9 deletions
+34
-9
src/apk_database.h
src/apk_database.h
+1
-0
src/database.c
src/database.c
+11
-0
src/solver.c
src/solver.c
+22
-9
No files found.
src/apk_database.h
View file @
30965aa8
...
@@ -167,6 +167,7 @@ typedef union apk_database_or_void {
...
@@ -167,6 +167,7 @@ typedef union apk_database_or_void {
struct
apk_name
*
apk_db_get_name
(
struct
apk_database
*
db
,
apk_blob_t
name
);
struct
apk_name
*
apk_db_get_name
(
struct
apk_database
*
db
,
apk_blob_t
name
);
struct
apk_name
*
apk_db_query_name
(
struct
apk_database
*
db
,
apk_blob_t
name
);
struct
apk_name
*
apk_db_query_name
(
struct
apk_database
*
db
,
apk_blob_t
name
);
int
apk_db_get_tag_id
(
struct
apk_database
*
db
,
apk_blob_t
tag
);
int
apk_db_get_tag_id
(
struct
apk_database
*
db
,
apk_blob_t
tag
);
int
apk_db_get_tag_id_by_repos
(
struct
apk_database
*
db
,
unsigned
int
repos
);
struct
apk_db_dir
*
apk_db_dir_query
(
struct
apk_database
*
db
,
struct
apk_db_dir
*
apk_db_dir_query
(
struct
apk_database
*
db
,
apk_blob_t
name
);
apk_blob_t
name
);
struct
apk_db_file
*
apk_db_file_query
(
struct
apk_database
*
db
,
struct
apk_db_file
*
apk_db_file_query
(
struct
apk_database
*
db
,
...
...
src/database.c
View file @
30965aa8
...
@@ -1475,6 +1475,17 @@ int apk_db_get_tag_id(struct apk_database *db, apk_blob_t tag)
...
@@ -1475,6 +1475,17 @@ int apk_db_get_tag_id(struct apk_database *db, apk_blob_t tag)
return
-
1
;
return
-
1
;
}
}
int
apk_db_get_tag_id_by_repos
(
struct
apk_database
*
db
,
unsigned
int
repos
)
{
int
i
;
for
(
i
=
0
;
i
<
db
->
num_repo_tags
;
i
++
)
{
if
(
db
->
repo_tags
[
i
].
allowed_repos
&
repos
)
return
i
;
}
return
-
1
;
}
static
int
fire_triggers
(
apk_hash_item
item
,
void
*
ctx
)
static
int
fire_triggers
(
apk_hash_item
item
,
void
*
ctx
)
{
{
struct
apk_database
*
db
=
(
struct
apk_database
*
)
ctx
;
struct
apk_database
*
db
=
(
struct
apk_database
*
)
ctx
;
...
...
src/solver.c
View file @
30965aa8
...
@@ -1061,24 +1061,37 @@ static void print_change(struct apk_database *db,
...
@@ -1061,24 +1061,37 @@ static void print_change(struct apk_database *db,
struct
apk_package
*
oldpkg
=
change
->
oldpkg
;
struct
apk_package
*
oldpkg
=
change
->
oldpkg
;
struct
apk_package
*
newpkg
=
change
->
newpkg
;
struct
apk_package
*
newpkg
=
change
->
newpkg
;
const
char
*
msg
=
NULL
;
const
char
*
msg
=
NULL
;
char
status
[
64
]
;
char
status
[
32
],
n
[
512
],
*
nameptr
;
int
r
;
int
r
,
tag
;
snprintf
(
status
,
sizeof
(
status
),
"(%i/%i)"
,
cur
+
1
,
total
);
snprintf
(
status
,
sizeof
(
status
),
"(%i/%i)"
,
cur
+
1
,
total
);
status
[
sizeof
(
status
)
-
1
]
=
'\0'
;
status
[
sizeof
(
status
)
-
1
]
=
0
;
if
(
oldpkg
!=
NULL
)
if
(
newpkg
!=
NULL
)
{
name
=
oldpkg
->
name
;
else
name
=
newpkg
->
name
;
name
=
newpkg
->
name
;
tag
=
apk_db_get_tag_id_by_repos
(
db
,
newpkg
->
repos
);
}
else
{
name
=
oldpkg
->
name
;
tag
=
apk_db_get_tag_id_by_repos
(
db
,
oldpkg
->
repos
);
}
if
(
tag
>
0
)
{
snprintf
(
n
,
sizeof
(
n
),
"%s@"
BLOB_FMT
,
name
->
name
,
BLOB_PRINTF
(
*
db
->
repo_tags
[
tag
].
name
));
n
[
sizeof
(
n
)
-
1
]
=
0
;
nameptr
=
n
;
}
else
{
nameptr
=
name
->
name
;
}
if
(
oldpkg
==
NULL
)
{
if
(
oldpkg
==
NULL
)
{
apk_message
(
"%s Installing %s ("
BLOB_FMT
")"
,
apk_message
(
"%s Installing %s ("
BLOB_FMT
")"
,
status
,
name
->
name
,
status
,
name
ptr
,
BLOB_PRINTF
(
*
newpkg
->
version
));
BLOB_PRINTF
(
*
newpkg
->
version
));
}
else
if
(
newpkg
==
NULL
)
{
}
else
if
(
newpkg
==
NULL
)
{
apk_message
(
"%s Purging %s ("
BLOB_FMT
")"
,
apk_message
(
"%s Purging %s ("
BLOB_FMT
")"
,
status
,
name
->
name
,
status
,
name
ptr
,
BLOB_PRINTF
(
*
oldpkg
->
version
));
BLOB_PRINTF
(
*
oldpkg
->
version
));
}
else
{
}
else
{
r
=
apk_pkg_version_compare
(
newpkg
,
oldpkg
);
r
=
apk_pkg_version_compare
(
newpkg
,
oldpkg
);
...
@@ -1097,7 +1110,7 @@ static void print_change(struct apk_database *db,
...
@@ -1097,7 +1110,7 @@ static void print_change(struct apk_database *db,
break
;
break
;
}
}
apk_message
(
"%s %s %s ("
BLOB_FMT
" -> "
BLOB_FMT
")"
,
apk_message
(
"%s %s %s ("
BLOB_FMT
" -> "
BLOB_FMT
")"
,
status
,
msg
,
name
->
name
,
status
,
msg
,
name
ptr
,
BLOB_PRINTF
(
*
oldpkg
->
version
),
BLOB_PRINTF
(
*
oldpkg
->
version
),
BLOB_PRINTF
(
*
newpkg
->
version
));
BLOB_PRINTF
(
*
newpkg
->
version
));
}
}
...
...
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