Browse Source

v5.1.0

tags/v5.1.2
guinux 2 years ago
parent
commit
e9076f605e
6 changed files with 38 additions and 10 deletions
  1. +2
    -1
      src/alpm_config.vala
  2. +1
    -1
      src/manager_window.vala
  3. +19
    -5
      src/system_daemon.vala
  4. +5
    -2
      src/transaction.vala
  5. +3
    -1
      src/tray.vala
  6. +8
    -0
      src/user_daemon.vala

+ 2
- 1
src/alpm_config.vala View File

@@ -138,11 +138,12 @@ class AlpmConfig {
Alpm.Errno error = 0;
Alpm.Handle? handle = null;
if (tmp_db) {
string tmp_dbpath = "/tmp/pamac-checkdbs-%s".printf (Environment.get_user_name ());
string tmp_dbpath = "/tmp/pamac-checkdbs";
try {
Process.spawn_command_line_sync ("mkdir -p %s".printf (tmp_dbpath));
Process.spawn_command_line_sync ("ln -sf %s/local %s".printf (dbpath, tmp_dbpath));
Process.spawn_command_line_sync ("cp -au %s/sync %s".printf (dbpath, tmp_dbpath));
Process.spawn_command_line_sync ("chmod -R 777 %s/sync".printf (tmp_dbpath));
handle = new Alpm.Handle (rootdir, tmp_dbpath, out error);
} catch (SpawnError e) {
stderr.printf ("SpawnError: %s\n", e.message);


+ 1
- 1
src/manager_window.vala View File

@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

const string VERSION = "5.0.0";
const string VERSION = "5.1.0";

namespace Pamac {



+ 19
- 5
src/system_daemon.vala View File

@@ -141,8 +141,8 @@ namespace Pamac {
(alpm_action) => {
alpm_action.run ();
},
// two threads at a time
2,
// only one thread created so alpm action will run one after one
1,
// no exclusive thread
false
);
@@ -168,7 +168,12 @@ namespace Pamac {
alpm_handle.logcb = (Alpm.LogCallBack) cb_log;
lockfile = GLib.File.new_for_path (alpm_handle.lockfile);
files_handle = alpm_config.get_handle (true);
files_handle.eventcb = (Alpm.EventCallBack) cb_event;
files_handle.progresscb = (Alpm.ProgressCallBack) cb_progress;
files_handle.questioncb = (Alpm.QuestionCallBack) cb_question;
files_handle.fetchcb = (Alpm.FetchCallBack) cb_fetch;
files_handle.totaldlcb = (Alpm.TotalDownloadCallBack) cb_totaldownload;
files_handle.logcb = (Alpm.LogCallBack) cb_log;
}
}

@@ -471,21 +476,30 @@ namespace Pamac {
write_log_file ("synchronizing package lists");
cancellable.reset ();
int force = (force_refresh) ? 1 : 0;
// try to copy refresh dbs in tmp
string tmp_dbpath = "/tmp/pamac-checkdbs";
try {
Process.spawn_command_line_sync ("cp -au %s/sync %s".printf (tmp_dbpath, alpm_handle.dbpath));
} catch (SpawnError e) {
stderr.printf ("SpawnError: %s\n", e.message);
}
// update ".db"
bool success = update_dbs (alpm_handle, force);
if (cancellable.is_cancelled ()) {
refresh_finished (false);
return;
}
if (success) {
// update ".files", do not need to know if we succeeded
update_dbs (files_handle, force);
if (cancellable.is_cancelled ()) {
refresh_finished (false);
} else if (success) {
refreshed = true;
refresh_finished (true);
} else {
current_error.message = _("Failed to synchronize any databases");
refresh_finished (false);
}
// update ".files", do it in background, do not need to know if we succeeded
update_dbs (files_handle, force);
}

public void start_refresh (bool force, GLib.BusName sender) {


+ 5
- 2
src/transaction.vala View File

@@ -472,6 +472,9 @@ namespace Pamac {
success = false;
finish_transaction ();
}
} else {
success = false;
finish_transaction ();
}
});
}
@@ -1396,8 +1399,8 @@ namespace Pamac {
rates_nb = 0;
fraction = 0;
timer.start ();
if (filename.has_suffix (".db")) {
string action = dgettext (null, "Refreshing %s").printf (filename.replace (".db", "")) + "...";
if (filename.has_suffix (".db") || filename.has_suffix (".files")) {
string action = dgettext (null, "Refreshing %s").printf (filename) + "...";
reset_progress_box (action);
}
} else if (xfered == total) {


+ 3
- 1
src/tray.vala View File

@@ -220,7 +220,9 @@ namespace Pamac {
}
} else {
if (lockfile.query_exists ()) {
extern_lock = true;
if (!check_pamac_running ()) {
extern_lock = true;
}
}
}
return true;


+ 8
- 0
src/user_daemon.vala View File

@@ -847,6 +847,14 @@ namespace Pamac {
db.update (0);
syncdbs.next ();
}
// refresh file dbs
var tmp_files_handle = alpm_config.get_handle (true, true);
syncdbs = tmp_files_handle.syncdbs;
while (syncdbs != null) {
unowned Alpm.DB db = syncdbs.data;
db.update (0);
syncdbs.next ();
}
string[] local_pkgs = {};
unowned Alpm.List<unowned Alpm.Package> pkgcache = tmp_handle.localdb.pkgcache;
while (pkgcache != null) {


Loading…
Cancel
Save