packagekit/backends/apt/python-backend-common.c

40 lines
1.3 KiB
C
Raw Normal View History

2007-10-10 10:02:47 -07:00
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
* Copyright (C) 2007 Tom Parker <palfrey@tevp.net>
*
* Licensed under the GNU General Public License Version 2
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
2007-10-12 03:34:07 -07:00
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
2007-10-10 10:02:47 -07:00
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <pk-backend.h>
/**
* python_refresh_cache:
**/
void python_refresh_cache(PkBackend * backend, gboolean force)
{
/* check network state */
if (pk_backend_network_is_online(backend) == FALSE)
{
pk_backend_error_code(backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot refresh cache whilst offline");
pk_backend_finished(backend);
return;
}
pk_backend_spawn_helper (backend, "refresh-cache.py", NULL);
}