Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
pamac
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
155
Issues
155
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
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
Applications
pamac
Commits
13f51597
Commit
13f51597
authored
Oct 07, 2018
by
guinux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes
parent
c09096ef
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
45 additions
and
35 deletions
+45
-35
src/alpm_config.vala
src/alpm_config.vala
+2
-2
src/alpm_utils.vala
src/alpm_utils.vala
+12
-6
src/cli.vala
src/cli.vala
+6
-4
src/database.vala
src/database.vala
+6
-10
src/manager_window.vala
src/manager_window.vala
+8
-7
src/transaction.vala
src/transaction.vala
+2
-2
src/tray.vala
src/tray.vala
+9
-4
No files found.
src/alpm_config.vala
View file @
13f51597
...
...
@@ -143,10 +143,10 @@ internal class AlpmConfig {
var
file
=
GLib
.
File
.
new_for_path
(
tmp_dbpath
);
if
(!
file
.
query_exists
())
{
Process
.
spawn_command_line_sync
(
"mkdir -p %s/sync"
.
printf
(
tmp_dbpath
));
Process
.
spawn_command_line_sync
(
"chmod -R
777 %s/sync
"
.
printf
(
tmp_dbpath
));
Process
.
spawn_command_line_sync
(
"chmod -R
ugo+w %s
"
.
printf
(
tmp_dbpath
));
}
Process
.
spawn_command_line_sync
(
"ln -sf %slocal %s"
.
printf
(
dbpath
,
tmp_dbpath
));
Process
.
spawn_command_line_sync
(
"cp -
a
u %ssync %s"
.
printf
(
dbpath
,
tmp_dbpath
));
Process
.
spawn_command_line_sync
(
"cp -
r
u %ssync %s"
.
printf
(
dbpath
,
tmp_dbpath
));
handle
=
new
Alpm
.
Handle
(
rootdir
,
tmp_dbpath
,
out
error
);
if
(
error
==
Alpm
.
Errno
.
DB_VERSION
)
{
try
{
...
...
src/alpm_utils.vala
View file @
13f51597
...
...
@@ -174,7 +174,7 @@ namespace Pamac {
var
file
=
GLib
.
File
.
new_for_path
(
tmp_dbpath
);
if
(
file
.
query_exists
())
{
try
{
Process
.
spawn_command_line_sync
(
"cp -
a
u %s/sync %s"
.
printf
(
tmp_dbpath
,
alpm_handle
.
dbpath
));
Process
.
spawn_command_line_sync
(
"cp -
r
u %s/sync %s"
.
printf
(
tmp_dbpath
,
alpm_handle
.
dbpath
));
}
catch
(
SpawnError
e
)
{
stderr
.
printf
(
"SpawnError: %s\n"
,
e
.
message
);
}
...
...
@@ -665,6 +665,12 @@ namespace Pamac {
// emit warnings here
alpm_handle
.
logcb
=
(
Alpm
.
LogCallBack
)
cb_log
;
// fake aur db
string
tmp_dbpath
=
"/tmp/pamac-checkdbs"
;
try
{
Process
.
spawn_command_line_sync
(
"cp %s/sync/aur.db %ssync"
.
printf
(
tmp_dbpath
,
alpm_handle
.
dbpath
));
}
catch
(
SpawnError
e
)
{
stderr
.
printf
(
"SpawnError: %s\n"
,
e
.
message
);
}
alpm_handle
.
register_syncdb
(
"aur"
,
0
);
// add to_build in to_install for the fake trans prepare
foreach
(
unowned
string
name
in
to_build
)
{
...
...
@@ -790,11 +796,6 @@ namespace Pamac {
pkgs_to_remove
.
next
();
}
trans_release
();
try
{
Process
.
spawn_command_line_sync
(
"rm -f %ssync/aur.db"
.
printf
(
alpm_handle
.
dbpath
));
}
catch
(
SpawnError
e
)
{
stderr
.
printf
(
"SpawnError: %s\n"
,
e
.
message
);
}
// get standard handle
refresh_handle
();
// warnings already emitted
...
...
@@ -808,6 +809,11 @@ namespace Pamac {
trans_release
();
}
}
try
{
Process
.
spawn_command_line_sync
(
"rm -f %ssync/aur.db"
.
printf
(
alpm_handle
.
dbpath
));
}
catch
(
SpawnError
e
)
{
stderr
.
printf
(
"SpawnError: %s\n"
,
e
.
message
);
}
if
(!
success
)
{
// get standard handle
refresh_handle
();
...
...
src/cli.vala
View file @
13f51597
...
...
@@ -185,10 +185,12 @@ namespace Pamac {
display_build_help
();
}
else
if
(
args
[
2
]
==
"--builddir"
)
{
init_transaction
();
transaction
.
database
.
config
.
aur_build_dir
=
args
[
3
];
database
.
config
.
enable_aur
=
true
;
database
.
config
.
aur_build_dir
=
args
[
3
];
build_pkgs
(
args
[
4
:
args
.
length
]);
}
else
{
init_transaction
();
database
.
config
.
enable_aur
=
true
;
build_pkgs
(
args
[
2
:
args
.
length
]);
}
}
else
{
...
...
@@ -289,10 +291,10 @@ namespace Pamac {
exit_status
=
1
;
return
;
}
transaction
.
database
.
config
.
enable_aur
=
true
;
transaction
.
database
.
config
.
check_aur_updates
=
true
;
database
.
config
.
enable_aur
=
true
;
database
.
config
.
check_aur_updates
=
true
;
}
else
if
(
arg
==
"--builddir"
)
{
transaction
.
database
.
config
.
aur_build_dir
=
args
[
i
+
1
];
database
.
config
.
aur_build_dir
=
args
[
i
+
1
];
i
++;
}
else
if
(
arg
==
"--force-refresh"
)
{
force_refresh
=
true
;
...
...
src/database.vala
View file @
13f51597
...
...
@@ -69,12 +69,13 @@ namespace Pamac {
public
void
refresh
()
{
alpm_config
=
new
AlpmConfig
(
"/etc/pacman.conf"
);
alpm_handle
=
alpm_config
.
get_handle
();
// use tmp dbs
alpm_handle
=
alpm_config
.
get_handle
(
false
,
true
);
if
(
alpm_handle
==
null
)
{
critical
(
dgettext
(
null
,
"Failed to initialize alpm library"
));
return
;
}
else
{
files_handle
=
alpm_config
.
get_handle
(
true
);
files_handle
=
alpm_config
.
get_handle
(
true
,
true
);
}
refreshed
();
}
...
...
@@ -120,7 +121,7 @@ namespace Pamac {
return
country
;
}
public
string
get
_db_path
()
{
internal
string
get_tmp
_db_path
()
{
return
alpm_handle
.
dbpath
;
}
...
...
@@ -128,10 +129,6 @@ namespace Pamac {
return
alpm_handle
.
checkspace
==
1
?
true
:
false
;
}
public
string
get_lockfile
()
{
return
alpm_handle
.
lockfile
;
}
public
List
<
string
>
get_ignorepkgs
()
{
var
result
=
new
List
<
string
>
();
unowned
Alpm
.
List
<
unowned
string
>
ignorepkgs
=
alpm_handle
.
ignorepkgs
;
...
...
@@ -1407,9 +1404,8 @@ namespace Pamac {
return
get_aur_updates_real
(
yield
aur_multiinfo
(
local_pkgs
));
}
public
async
void
refresh_tmp_files_dbs
()
{
var
tmp_files_handle
=
alpm_config
.
get_handle
(
true
,
true
);
unowned
Alpm
.
List
<
unowned
Alpm
.
DB
>
syncdbs
=
tmp_files_handle
.
syncdbs
;
public
void
refresh_tmp_files_dbs
()
{
unowned
Alpm
.
List
<
unowned
Alpm
.
DB
>
syncdbs
=
files_handle
.
syncdbs
;
while
(
syncdbs
!=
null
)
{
unowned
Alpm
.
DB
db
=
syncdbs
.
data
;
db
.
update
(
0
);
...
...
src/manager_window.vala
View file @
13f51597
...
...
@@ -374,8 +374,6 @@ namespace Pamac {
scroll_to_top
=
false
;
refresh_packages_list
();
});
// refresh files dbs in tmp in background
database
.
refresh_tmp_files_dbs
.
begin
();
transaction
=
new
TransactionGtk
(
database
,
this
);
transaction
.
start_preparing
.
connect
(
on_start_preparing
);
...
...
@@ -424,11 +422,14 @@ namespace Pamac {
// create screenshots tmp dir
string
screenshots_tmp_dir
=
"/tmp/pamac-app-screenshots"
;
try
{
Process
.
spawn_command_line_sync
(
"mkdir -p %s"
.
printf
(
screenshots_tmp_dir
));
Process
.
spawn_command_line_sync
(
"chmod -R 777 %s"
.
printf
(
screenshots_tmp_dir
));
}
catch
(
SpawnError
e
)
{
stderr
.
printf
(
"SpawnError: %s\n"
,
e
.
message
);
var
file
=
GLib
.
File
.
new_for_path
(
screenshots_tmp_dir
);
if
(!
file
.
query_exists
())
{
try
{
Process
.
spawn_command_line_sync
(
"mkdir -p %s"
.
printf
(
screenshots_tmp_dir
));
Process
.
spawn_command_line_sync
(
"chmod -R ugo+w %s"
.
printf
(
screenshots_tmp_dir
));
}
catch
(
SpawnError
e
)
{
stderr
.
printf
(
"SpawnError: %s\n"
,
e
.
message
);
}
}
}
...
...
src/transaction.vala
View file @
13f51597
...
...
@@ -291,8 +291,8 @@ namespace Pamac {
list
.
append
(
name_version
);
list
.
append
(
" "
);
}
Process
.
spawn_command_line_sync
(
"rm -f %ssync/aur.db"
.
printf
(
database
.
get_db_path
()));
Process
.
spawn_command_line_sync
(
"bsdtar -cf %ssync/aur.db -C %s %s"
.
printf
(
database
.
get_db_path
(),
aurdb_path
,
list
.
str
));
Process
.
spawn_command_line_sync
(
"rm -f %ssync/aur.db"
.
printf
(
database
.
get_
tmp_
db_path
()));
Process
.
spawn_command_line_sync
(
"bsdtar -cf %ssync/aur.db -C %s %s"
.
printf
(
database
.
get_
tmp_
db_path
(),
aurdb_path
,
list
.
str
));
}
catch
(
SpawnError
e
)
{
stderr
.
printf
(
"SpawnError: %s\n"
,
e
.
message
);
}
...
...
src/tray.vala
View file @
13f51597
...
...
@@ -28,6 +28,7 @@ namespace Pamac {
[
DBus
(
name
=
"org.manjaro.pamac.system"
)]
interface
SystemDaemon
:
Object
{
public
abstract
void
set_environment_variables
(
HashTable
<
string
,
string
>
variables
)
throws
Error
;
public
abstract
string
get_lockfile
()
throws
Error
;
public
abstract
void
start_download_updates
()
throws
Error
;
[
DBus
(
no_reply
=
true
)]
public
abstract
void
quit
()
throws
Error
;
...
...
@@ -154,7 +155,7 @@ namespace Pamac {
}
// refresh files dbs in tmp
var
database
=
new
Database
(
config
);
database
.
refresh_tmp_files_dbs
.
begin
();
database
.
refresh_tmp_files_dbs
();
}
else
{
set_icon
(
noupdate_icon_name
);
set_tooltip
(
noupdate_info
);
...
...
@@ -304,11 +305,15 @@ namespace Pamac {
Notify
.
init
(
_
(
"Package Manager"
));
start_system_daemon
(
config
.
environment_variables
);
// start and stop daemon just to connect to signal
string
lockfile_str
=
"/var/lib/pacman/db.lck"
;
try
{
lockfile_str
=
system_daemon
.
get_lockfile
();
}
catch
(
Error
e
)
{
stderr
.
printf
(
"Error: %s\n"
,
e
.
message
);
}
stop_system_daemon
();
var
database
=
new
Database
(
config
);
lockfile
=
GLib
.
File
.
new_for_path
(
database
.
get_lockfile
());
lockfile
=
GLib
.
File
.
new_for_path
(
lockfile_str
);
Timeout
.
add
(
200
,
check_extern_lock
);
// wait 30 seconds before check updates
Timeout
.
add_seconds
(
30
,
()
=>
{
...
...
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