1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-22 15:58:50 -05:00

Merge branch 'maint'

Conflicts:
	lib/libalpm/trans.c
	src/pacman/query.c
This commit is contained in:
Dan McGee 2011-05-19 17:17:32 -05:00
commit 11fb9c7674
9 changed files with 80 additions and 24 deletions

View File

@ -265,7 +265,7 @@ static void unlink_file(pmpkg_t *info, char *filename, alpm_list_t *skip_remove,
FREE(pkghash);
} else {
char *filehash = alpm_compute_md5sum(file);
int cmp = strcmp(filehash,pkghash);
int cmp = filehash ? strcmp(filehash, pkghash) : 0;
FREE(filehash);
FREE(pkghash);
if(cmp != 0) {

View File

@ -116,15 +116,6 @@ int SYMEXPORT alpm_trans_init(pmtransflag_t flags,
}
}
/* check database version */
db_version = _alpm_db_version(handle->db_local);
if(db_version < required_db_version) {
_alpm_log(PM_LOG_ERROR,
_("%s database version is too old\n"), handle->db_local->treename);
remove_lock(handle);
RET_ERR(PM_ERR_DB_VERSION, -1);
}
trans = _alpm_trans_new();
if(trans == NULL) {
RET_ERR(PM_ERR_MEMORY, -1);
@ -138,6 +129,16 @@ int SYMEXPORT alpm_trans_init(pmtransflag_t flags,
handle->trans = trans;
/* check database version */
db_version = _alpm_db_version(handle->db_local);
if(db_version < required_db_version) {
_alpm_log(PM_LOG_ERROR,
_("%s database version is too old\n"), handle->db_local->treename);
remove_lock(handle);
_alpm_trans_free(trans);
RET_ERR(PM_ERR_DB_VERSION, -1);
}
return 0;
}

View File

@ -8,9 +8,10 @@ msgstr ""
"Project-Id-Version: Arch Linux Pacman package manager\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-04-18 11:23-0500\n"
"PO-Revision-Date: 2011-04-15 17:59+0000\n"
"Last-Translator: apuasi <kaannokset.hellberg@gmail.com>\n"
"Language-Team: Finnish <None>\n"
"PO-Revision-Date: 2011-05-11 14:51+0000\n"
"Last-Translator: Larso <larso@gmx.com>\n"
"Language-Team: Finnish (http://www.transifex.net/projects/p/archlinux-pacman/"
"team/fi/)\n"
"Language: fi\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -349,7 +350,7 @@ msgstr " -c, --cascade poista paketit ja kaikki niiden riippuvuudet\n"
#, c-format
msgid " -n, --nosave remove configuration files\n"
msgstr ""
msgstr " -n, --nosave poista myös asetustiedostot\n"
#, c-format
msgid ""
@ -359,7 +360,7 @@ msgstr ""
#, c-format
msgid " -u, --unneeded remove unneeded packages\n"
msgstr ""
msgstr " -u, --unneeded poista tarpeettomat paketit\n"
#, c-format
msgid " -c, --changelog view the changelog of a package\n"
@ -550,7 +551,7 @@ msgstr ""
msgid ""
" --print print the targets instead of performing the "
"operation\n"
msgstr ""
msgstr " --print listaa paketit, mutta älä suorita operaatiota\n"
#, c-format
msgid ""
@ -950,7 +951,7 @@ msgstr "paketti %s ei ole kelvollinen tai se on vahingoittunut\n"
#, c-format
msgid "Errors occurred, no packages were upgraded.\n"
msgstr "Yhtään pakettia ei ole päivitetty tapahtuneiden virheiden vuoksi.\n"
msgstr "Yhtään pakettia ei päivitetty tapahtuneiden virheiden vuoksi.\n"
#, c-format
msgid ":: Synchronizing package databases...\n"

View File

@ -732,8 +732,9 @@ static void cl_to_log(int argc, char* argv[])
size += strlen(argv[i]) + 1;
}
char *cl_text = malloc(size);
if(!cl_text)
if(!cl_text) {
return;
}
char *p = cl_text;
for(i = 0; i<argc-1; i++) {
strcpy(p, argv[i]);
@ -884,7 +885,7 @@ int main(int argc, char *argv[])
}
/* set up the print operations */
if(config->print) {
if(config->print && !config->op_s_clean) {
config->noconfirm = 1;
config->flags |= PM_TRANS_FLAG_NOCONFLICTS;
config->flags |= PM_TRANS_FLAG_NOLOCK;

View File

@ -77,6 +77,10 @@ static int search_path(char **filename, struct stat *bufptr)
}
fullname = malloc(plen + flen + 2);
if(!fullname) {
free(envpath);
return(-1);
}
sprintf(fullname, "%s/%s", path, *filename);
if(lstat(fullname, bufptr) == 0) {

View File

@ -103,7 +103,7 @@ class pmpkg(object):
# Generate package file system
for f in self.files:
util.mkfile(f, f)
self.size += os.stat(util.getfilename(f))[stat.ST_SIZE]
self.size += os.lstat(util.getfilename(f))[stat.ST_SIZE]
# .PKGINFO
data = ["pkgname = %s" % self.name]

View File

@ -146,6 +146,14 @@ class pmrule(object):
else:
print "FILE rule '%s' not found" % case
success = -1
elif kind == "LINK":
filename = os.path.join(test.root, key)
if case == "EXIST":
if not os.path.islink(filename):
success = 0
else:
print "LINK rule '%s' not found" % case
success = -1
elif kind == "CACHE":
cachedir = os.path.join(test.root, util.PM_CACHEDIR)
if case == "EXISTS":

View File

@ -0,0 +1,43 @@
self.description = "Dead backed-up symlink when removing package (FS#24230)"
# symlink file is changed
lp = pmpkg("dummy")
lp.files = ["etc/brokenlink -> nonexistent",
"etc/exists"]
lp.backup = ["etc/brokenlink*"]
self.addpkg2db("local", lp)
# symlink file is not changed
lp2 = pmpkg("dummy2")
lp2.files = ["etc/brokenlink2 -> nonexistent2",
"etc/exists2"]
lp2.backup = ["etc/brokenlink2"]
self.addpkg2db("local", lp2)
# package is left alone, not uninstalled
lp3 = pmpkg("dummy3")
lp3.files = ["etc/brokenlink3 -> nonexistent3",
"etc/exists3"]
self.addpkg2db("local", lp3)
self.args = "-R %s %s" % (lp.name, lp2.name)
#self.args = "-R"
self.addrule("PACMAN_RETCODE=0")
self.addrule("!PKG_EXIST=dummy")
self.addrule("!LINK_EXIST=etc/brokenlink")
self.addrule("!FILE_EXIST=etc/nonexistent")
self.addrule("!FILE_EXIST=etc/exists")
self.addrule("!PKG_EXIST=dummy2")
self.addrule("!LINK_EXIST=etc/brokenlink2")
self.addrule("!FILE_EXIST=etc/nonexistent2")
self.addrule("!FILE_EXIST=etc/exists2")
self.addrule("PKG_EXIST=dummy3")
self.addrule("LINK_EXIST=etc/brokenlink3")
self.addrule("!FILE_EXIST=etc/nonexistent")
self.addrule("FILE_EXIST=etc/exists3")
self.addrule("FILE_TYPE=etc/brokenlink3|link")
self.addrule("FILE_TYPE=etc/exists3|file")

View File

@ -150,7 +150,6 @@ def getmd5sum(filename):
"""
"""
if not os.path.isfile(filename):
print "file %s does not exist!" % filename
return ""
fd = open(filename, "rb")
checksum = hashlib.md5()
@ -178,9 +177,8 @@ def getmtime(filename):
"""
"""
if not os.path.exists(filename):
print "path %s does not exist!" % filename
return 0, 0, 0
st = os.stat(filename)
return None, None, None
st = os.lstat(filename)
return st[stat.ST_ATIME], st[stat.ST_MTIME], st[stat.ST_CTIME]
#