1
0
forked from mirrors/pacman

Compare commits

..

17 Commits

Author SHA1 Message Date
Dan McGee
e0f41e0fb4 3.5.4 release preparation
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-09 19:16:19 -05:00
Eric Bélanger
c36dbf9711 Remove -f option from ln for POSIX compliance
Fixes FS#24893.

Conflicts:

	scripts/makepkg.sh.in
	scripts/repo-add.sh.in

Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
(cherry picked from commit 51ed7dff0d)
2011-08-09 19:01:37 -05:00
Dave Reisner
6b57118c15 pacman/util: flush terminal input before reading response
Addresses FS#20538

Conflicts:

	src/pacman/util.c

Signed-off-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
(cherry picked from commit 9477abc359)
2011-08-09 18:59:49 -05:00
Allan McRae
07996bfac7 Document group and providers selection
The format required for selection of packages within the group selection
dialog is not entirely obvious, so provide some documentation.

Fixes FS#24134.

Signed-off-by: Allan McRae <allan@archlinux.org>
(cherry picked from commit 94d22f9309)
2011-08-09 18:55:16 -05:00
Dan McGee
4885a7fa3a Fix divide by zero when downloading zero length files
If someone did a 'touch bogusrepo.db', we had the potential to throw a
SIGFPE or divide by zero, given that the total file size was 0 and
getting passed up to the pacman callback. Fix this so we get weird but
sane output and don't blow up when downloading:

:: Synchronizing package databases...
 core             35.7K  306.7K/s 00:00:00 [###################] 100%
 bogusrepo         0.0K    0.0K/s 00:00:00 [###################] 100%

Exception as seen in gdb:

Program received signal SIGFPE, Arithmetic exception.
0x000000000040cc73 in cb_dl_progress (filename=0x619dfc "bogusrepo.db", file_xfered=0, file_total=0) at callback.c:584
584             file_percent = (file_xfered * 100) / file_total;

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-08 18:18:09 -05:00
Dan McGee
67445334e7 Update translations from transifex
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-08 16:39:04 -05:00
Florian Pritz
4c37d74ae5 doc/PKGBUILD: fix pkgver for -git packages
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-08 13:28:40 -05:00
Dan McGee
88644e181d Fix group selection entry for large inputs
Hardcoding anything always ends up burning you, and the arbitrary length
of 64 here did just that. Add the ability to reallocate the readline
buffer for longer inputs if necessary, and add other error checking as
approprate. This also plugs one small memory leak of the group
processing code selection array.

Addresses FS#24253.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-25 10:07:48 -05:00
Lukas Fleischer
005eab0a08 libalpm: Set ret correctly in download_internal()
Immediately jump to the cleanup code after setting the return code to -1
in case rename() fails. Otherwise, it will be reset to 0 right after we
leave the if branch.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-25 08:48:02 -05:00
Allan McRae
297cd7897b makepkg: fix issue with filenames with spaces and noextract
Specifying a filename with spaces in a PKGBUILDs noextract array fails
due to a lack of quoting.

Fixes FS#25100.

Reported-by: Thomas Weißschuh <thomas_weissschuh@lavabit.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-18 10:41:27 -05:00
Dan McGee
e378170c25 Ensure a file can be replaced by a directory
This addresses FS#24904. In a normal upgrade case, this replacement
seems to work just fine. However, when doing a sync "replace" type
upgrade, we weren't properly handling this edge case due to path
comparison not ignoring trailing slashes. Fix this by pruning any
trailing slashes past a certain point of file conflict resolution where
we no longer need them, which allows us to safely detect cases such as
now tested in the new pactest.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-27 09:15:31 -05:00
Dan McGee
f8f4c2a6f3 File conflict code cleanups
While researching the root cause of FS#24904, I couldn't help but clean
up some of the cruft in here. A few whitespace/line-wrapping issues, but
also fix shadowed variables and add some const where applicable.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-27 09:15:28 -05:00
Dan McGee
6eee3f6781 list_display: fix incorrect assignment
Commit 895a888865 erroneously left this around.

Noticed-by: Jakob Gruber <jakob.gruber@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15 09:11:47 -05:00
Allan McRae
4664a095a4 Fix man page generation for out of tree build
Fix failure at man page generation when building outside the source tree.
There may still be issues with other documentation types...

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-15 08:49:39 -05:00
Eric Bélanger
07e97a5f2c Added check option to BUILDENV array in makepkg.conf man page
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-13 20:48:00 -05:00
Dan McGee
895a888865 Fix list_display on non-ttys and other output fixes
commit c1f742d775 broke what was one of the tenants of out output-
if piping pacman output somewhere else, we shouldn't ever try to
line-wrap and indent print our output. This makes it easier for tools to
use output from pacman -Ss, -Qs, -Qi, etc. list_display() unfortunately
was given a default value of 80 rather than 0, so fix this.

Next, make some additional changes that ensure we don't insert an
unnecessary blank line if for some crazy reason the indent level (such
as on -Qi output) is greater than the number of columns. Accomplish this
by printing the first item unconditionally as we do in
list_display_linebreak().

Finally, teach indentprint to not wrap if the number of columns is less
than the indent level, this prevents some forms of ridiculous output
such as the following:

    Install Date   : Wed
                     08
                     Jun
                     2011
                     04:39:19
                     AM
                     CDT

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-13 17:04:35 -05:00
Dan McGee
b059040011 Add late-breaking 3.5.3 NEWS
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-07 15:05:37 -05:00
20 changed files with 226 additions and 81 deletions

12
NEWS
View File

@@ -1,12 +1,22 @@
VERSION DESCRIPTION
-----------------------------------------------------------------------------
3.5.4 - fix display of lists on non-TTYs and other output fixes
- fix group selection entry for large inputs (FS#24253)
- fix divide by zero when downloading zero length files
- flush terminal input before reading response (FS#20538)
- allow files to be replaced by directories (FS#24904)
- makepkg: fix filenames with spaces and noextract (FS#25100)
- scripts: remove ln -f option for POSIX compliance (FS24893)
- various small documentation updates
- minor translation updates: de, fi
3.5.3 - segfault when creating lock in non-existent dir (FS#24292)
- segfault when uninstalling broken backed-up symlink (FS#24230)
- --print should not enable --noconfirm (FS#24287)
- fix default path substitution in documentation
- makepkg: quote variables that may contain spaces (FS#24002)
- makepkg: fix creation of source package with -p (FS#24567)
- repo-add: include dotfiles in filelists (FS#24534)
- minor translation updates: de, fi, sk
- minor translation updates: de, fi, fr, sk, zh_CN
3.5.2 - ensure we show correct missing dependency info (FS#23424)
- pacman usage/--help updates (FS#23433, FS#23369)
- ensure stdout/stderr are flushed before prompts (FS#23492)

View File

@@ -42,12 +42,12 @@ AC_PREREQ(2.62)
# pacman_version_micro += 1
m4_define([lib_current], [6])
m4_define([lib_revision], [3])
m4_define([lib_revision], [4])
m4_define([lib_age], [0])
m4_define([pacman_version_major], [3])
m4_define([pacman_version_minor], [5])
m4_define([pacman_version_micro], [3])
m4_define([pacman_version_micro], [4])
m4_define([pacman_version],
[pacman_version_major.pacman_version_minor.pacman_version_micro])
@@ -171,7 +171,8 @@ AM_CONDITIONAL([HAVE_LIBFETCH], [test "x$ac_cv_lib_fetch_fetchParseURL" = "xyes"
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h glob.h libintl.h locale.h mntent.h string.h \
sys/ioctl.h sys/mount.h sys/param.h sys/statvfs.h \
sys/time.h sys/types.h sys/ucred.h syslog.h wchar.h])
sys/time.h sys/types.h sys/ucred.h syslog.h termios.h \
wchar.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
@@ -190,7 +191,7 @@ AC_FUNC_GETMNTENT
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_FUNC_MKTIME
AC_CHECK_FUNCS([geteuid getmntinfo realpath regcomp strcasecmp \
strndup strrchr strsep swprintf \
strndup strrchr strsep swprintf tcflush \
wcwidth uname])
# For the diskspace code
FS_STATS_TYPE

View File

@@ -95,7 +95,7 @@ website: html
pkgdatadir = ${datadir}/${PACKAGE}
ASCIIDOC_OPTS = \
-f asciidoc.conf \
-f $(srcdir)/asciidoc.conf \
-a pacman_version="$(REAL_PACKAGE_VERSION)" \
-a pacman_date="`date +%Y-%m-%d`" \
-a pkgdatadir=$(pkgdatadir) \
@@ -106,11 +106,12 @@ A2X_OPTS = \
--no-xmllint \
-d manpage \
-f manpage \
--xsltproc-opts='-param man.endnotes.list.enabled 0 -param man.endnotes.are.numbered 0'
--xsltproc-opts='-param man.endnotes.list.enabled 0 -param man.endnotes.are.numbered 0' \
--destination-dir='./'
# These rules are due to the includes and files of the asciidoc text
$(ASCIIDOC_MANS): asciidoc.conf footer.txt
a2x $(A2X_OPTS) --asciidoc-opts="$(ASCIIDOC_OPTS)" $@.txt
a2x $(A2X_OPTS) --asciidoc-opts="$(ASCIIDOC_OPTS) --out-file=./$@.xml" $(srcdir)/$@.txt
%.html: %.txt
asciidoc $(ASCIIDOC_OPTS) $*.txt

View File

@@ -384,8 +384,7 @@ from.
The SVN module to fetch.
*Git*::
The generated pkgver will be one formatted by the 'git-describe'
command, with '-' characters converted to '_' characters.
The generated pkgver will be the date the package is built.
*_gitroot*;;
The URL (all protocols supported) to the GIT repository.

View File

@@ -63,6 +63,8 @@ Releases
`------------`-------
Date Version
---------------------
2011-08-10 v3.5.4
2011-06-07 v3.5.3
2011-04-18 v3.5.2
2011-03-23 v3.5.1
2011-03-16 v3.5.0

View File

@@ -70,7 +70,7 @@ Options
This is often used to set the number of jobs used, for example, `-j2`.
Other flags that make accepts can also be passed.
**BUILDENV=(**fakeroot !distcc color !ccache**)**::
**BUILDENV=(**fakeroot !distcc color !ccache check**)**::
This array contains options that affect the build environment, the defaults
are shown here. All options should always be left in the array; to enable
or disable an option simply remove or place an ``!'' at the front of the

View File

@@ -13,7 +13,6 @@ Synopsis
--------
'pacman' <operation> [options] [targets]
Description
-----------
Pacman is a package management utility that tracks installed packages on a Linux
@@ -69,13 +68,18 @@ Operations
interprets ">" as redirection to file.)
+
In addition to packages, groups can be specified as well. For example, if
gnome is a defined package group, then `pacman -S gnome` will install every
package in the gnome group, as well as the dependencies of those packages.
gnome is a defined package group, then `pacman -S gnome` will provide a
prompt allowing you to select which packages to install from a numbered list.
The package selection is specified using a space separated list of package
numbers. Sequential packages may be selected by specifying the first and last
package numbers separated by a hyphen (`-`). Excluding packages is achieved by
prefixing a number or range of numbers with a caret (`^`).
+
Packages that provide other packages are also handled. For example, `pacman -S
foo` will first look for a foo package. If foo is not found, packages that
provide the same functionality as foo will be searched for. If any package is
found, it will be installed.
found, it will be installed. A selection prompt is provided if multiple packages
providing foo are found.
+
You can also use `pacman -Su` to upgrade all packages that are out of date. See
<<SO,Sync Options>> below. When upgrading, pacman performs version comparison

View File

@@ -296,14 +296,14 @@ static alpm_list_t *chk_filedifference(alpm_list_t *filesA, alpm_list_t *filesB)
return(ret);
}
/* Adds pmfileconflict_t to a conflicts list. Pass the conflicts list, type (either
* PM_FILECONFLICT_TARGET or PM_FILECONFLICT_FILESYSTEM), a file string, and either
* two package names or one package name and NULL. This is a wrapper for former
* functionality that was done inline.
/* Adds pmfileconflict_t to a conflicts list. Pass the conflicts list, type
* (either PM_FILECONFLICT_TARGET or PM_FILECONFLICT_FILESYSTEM), a file
* string, and either two package names or one package name and NULL. This is
* a wrapper for former functionality that was done inline.
*/
static alpm_list_t *add_fileconflict(alpm_list_t *conflicts,
pmfileconflicttype_t type, const char *filestr,
const char* name1, const char* name2)
const char *name1, const char *name2)
{
pmfileconflict_t *conflict;
MALLOC(conflict, sizeof(pmfileconflict_t), RET_ERR(PM_ERR_MEMORY, NULL));
@@ -334,7 +334,7 @@ void _alpm_fileconflict_free(pmfileconflict_t *conflict)
FREE(conflict);
}
static int dir_belongsto_pkg(char *dirpath, pmpkg_t *pkg)
static int dir_belongsto_pkg(const char *dirpath, pmpkg_t *pkg)
{
struct dirent *ent = NULL;
struct stat sbuf;
@@ -433,7 +433,6 @@ alpm_list_t *_alpm_db_find_fileconflicts(pmdb_t *db, pmtrans_t *trans,
/* declarations for second check */
struct stat lsbuf, sbuf;
char *filestr = NULL;
/* CHECK 2: check every target against the filesystem */
_alpm_log(PM_LOG_DEBUG, "searching for filesystem conflicts: %s\n", p1->name);
@@ -452,7 +451,9 @@ alpm_list_t *_alpm_db_find_fileconflicts(pmdb_t *db, pmtrans_t *trans,
}
for(j = tmpfiles; j; j = j->next) {
filestr = j->data;
const char *filestr = j->data, *relative_path;
/* have we acted on this conflict? */
int resolved_conflict = 0;
snprintf(path, PATH_MAX, "%s%s", handle->root, filestr);
@@ -462,7 +463,7 @@ alpm_list_t *_alpm_db_find_fileconflicts(pmdb_t *db, pmtrans_t *trans,
}
stat(path, &sbuf);
if(path[strlen(path)-1] == '/') {
if(path[strlen(path) - 1] == '/') {
if(S_ISDIR(lsbuf.st_mode)) {
_alpm_log(PM_LOG_DEBUG, "%s is a directory, not a conflict\n", path);
continue;
@@ -471,16 +472,22 @@ alpm_list_t *_alpm_db_find_fileconflicts(pmdb_t *db, pmtrans_t *trans,
"%s is a symlink to a dir, hopefully not a conflict\n", path);
continue;
}
/* if we made it to here, we want all subsequent path comparisons to
* not include the trailing slash. This allows things like file ->
* directory replacements. */
path[strlen(path) - 1] = '\0';
}
_alpm_log(PM_LOG_DEBUG, "checking possible conflict: %s\n", path);
int resolved_conflict = 0; /* have we acted on this conflict? */
_alpm_log(PM_LOG_DEBUG, "checking possible conflict: %s\n", path);
relative_path = path + strlen(handle->root);
/* Check remove list (will we remove the conflicting local file?) */
for(k = remove; k && !resolved_conflict; k = k->next) {
pmpkg_t *rempkg = k->data;
if(rempkg && alpm_list_find_str(alpm_pkg_get_files(rempkg), filestr)) {
_alpm_log(PM_LOG_DEBUG, "local file will be removed, not a conflict: %s\n", filestr);
if(alpm_list_find_str(alpm_pkg_get_files(rempkg), relative_path)) {
_alpm_log(PM_LOG_DEBUG,
"local file will be removed, not a conflict: %s\n",
relative_path);
resolved_conflict = 1;
}
}
@@ -498,8 +505,11 @@ alpm_list_t *_alpm_db_find_fileconflicts(pmdb_t *db, pmtrans_t *trans,
/* skip removal of file, but not add. this will prevent a second
* package from removing the file when it was already installed
* by its new owner (whether the file is in backup array or not */
trans->skip_remove = alpm_list_add(trans->skip_remove, strdup(filestr));
_alpm_log(PM_LOG_DEBUG, "file changed packages, adding to remove skiplist: %s\n", filestr);
trans->skip_remove = alpm_list_add(trans->skip_remove,
strdup(filestr));
_alpm_log(PM_LOG_DEBUG,
"file changed packages, adding to remove skiplist: %s\n",
filestr);
resolved_conflict = 1;
}
}
@@ -518,19 +528,19 @@ alpm_list_t *_alpm_db_find_fileconflicts(pmdb_t *db, pmtrans_t *trans,
if(!resolved_conflict && dbpkg) {
char *rpath = calloc(PATH_MAX+1, sizeof(char));
const char *relative_rpath;
if(!realpath(path, rpath)) {
FREE(rpath);
free(rpath);
continue;
}
char *filestr = rpath + strlen(handle->root);
if(alpm_list_find_str(alpm_pkg_get_files(dbpkg),filestr)) {
relative_rpath = rpath + strlen(handle->root);
if(alpm_list_find_str(alpm_pkg_get_files(dbpkg), relative_rpath)) {
resolved_conflict = 1;
}
free(rpath);
}
if(!resolved_conflict) {
_alpm_log(PM_LOG_DEBUG, "file found in conflict: %s\n", path);
conflicts = add_fileconflict(conflicts, PM_FILECONFLICT_FILESYSTEM,
path, p1->name, NULL);
}

View File

@@ -308,6 +308,7 @@ static int download_internal(const char *url, const char *localpath,
_alpm_log(PM_LOG_ERROR, _("could not rename %s to %s (%s)\n"),
tempfile, destfile, strerror(errno));
ret = -1;
goto cleanup;
}
ret = 0;

View File

@@ -1,16 +1,21 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# <larso@gmx.com>, 2011.
# Larso <larso@gmx.com>, 2011.
# Jesse Jaara <jesse.jaara@gmail.com>, 2011.
# apuasi <kaannokset.hellberg@gmail.com>, 2011.
# Dan McGee <dpmcgee@gmail.com>, 2011.
msgid ""
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-18 11:10+0000\n"
"Last-Translator: apuasi <kaannokset.hellberg@gmail.com>\n"
"Language-Team: Finnish <None>\n"
"POT-Creation-Date: 2011-08-08 16:37-0500\n"
"PO-Revision-Date: 2011-07-28 22:14+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"
@@ -327,7 +332,7 @@ msgstr "toimenpidettä ei ole alustettu"
#, c-format
msgid "duplicate target"
msgstr ""
msgstr "kohde on useampaan kertaan"
#, c-format
msgid "transaction not prepared"

View File

@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: pacman 3.5.2\n"
"Project-Id-Version: pacman 3.5.3\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-04-18 11:23-0500\n"
"POT-Creation-Date: 2011-08-08 16:37-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@@ -1,16 +1,20 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Mineo <themineo+transifex@googlemail.com>, 2011.
# Simon Schneider <SPAM.schneida@gmail.com>, 2011.
# Matthias Gorissen <matthias@archlinux.de>, 2011.
# Dan McGee <dpmcgee@gmail.com>, 2011.
msgid ""
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-28 09:05+0000\n"
"Last-Translator: Mineo <themineo+transifex@googlemail.com>\n"
"Language-Team: German <None>\n"
"POT-Creation-Date: 2011-08-08 16:32-0500\n"
"PO-Revision-Date: 2011-06-30 08:35+0000\n"
"Last-Translator: jakob <jakob.matthes@gmail.com>\n"
"Language-Team: German (http://www.transifex.net/projects/p/archlinux-pacman/"
"team/de/)\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -179,7 +183,7 @@ msgstr ""
#, c-format
msgid "%s: install reason has been set to 'explicitly installed'\n"
msgstr ""
"%s: Installations-Grund wurde auf \"Ausdrücklich installiert\" gesetzt?\n"
"%s: Installations-Grund wurde auf \"Ausdrücklich installiert\" gesetzt\n"
#, c-format
msgid "Explicitly installed"
@@ -1448,7 +1452,7 @@ msgid ""
" --holdver Prevent automatic version bumping for development %ss"
msgstr ""
" --holdver Verhindert die automatische Erhöhung der Versionsnummer "
"für die Entwickler-Vesrion %ss"
"für die Entwickler-Version %ss"
msgid " --nocheck Do not run the check() function in the %s"
msgstr " --nocheck Unterdrückt die check()-Funktion in %s"

View File

@@ -1,15 +1,18 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Pacman Development Team <pacman-dev@archlinux.org>
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Larso <larso@gmx.com>, 2011.
# Jesse Jaara <jesse.jaara@gmail.com>, 2011.
# apuasi <kaannokset.hellberg@gmail.com>, 2011.
# Dan McGee <dpmcgee@gmail.com>, 2011.
msgid ""
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-05-11 14:51+0000\n"
"Last-Translator: Larso <larso@gmx.com>\n"
"POT-Creation-Date: 2011-08-08 16:32-0500\n"
"PO-Revision-Date: 2011-06-14 11:10+0000\n"
"Last-Translator: Huulivoide <jesse.jaara@gmail.com>\n"
"Language-Team: Finnish (http://www.transifex.net/projects/p/archlinux-pacman/"
"team/fi/)\n"
"Language: fi\n"
@@ -839,7 +842,7 @@ msgstr "Säilytettävät paketit:\n"
#, c-format
msgid " All locally installed packages\n"
msgstr " Kaikki paikalliset paketit\n"
msgstr " Kaikki asennetut paketit\n"
#, c-format
msgid " All current sync database packages\n"

View File

@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: pacman 3.5.2\n"
"Project-Id-Version: pacman 3.5.3\n"
"Report-Msgid-Bugs-To: http://bugs.archlinux.org/index.php?project=3\n"
"POT-Creation-Date: 2011-04-18 11:23-0500\n"
"POT-Creation-Date: 2011-08-08 16:32-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@@ -509,7 +509,8 @@ download_sources() {
local file=$(get_filepath "$netfile" || true)
if [[ -n "$file" ]]; then
msg2 "$(gettext "Found %s")" "${file##*/}"
ln -sf "$file" "$srcdir/"
rm -f "$srcdir/$file"
ln -s "$file" "$srcdir/"
continue
fi
@@ -674,7 +675,7 @@ extract_sources() {
local netfile
for netfile in "${source[@]}"; do
local file=$(get_filename "$netfile")
if in_array "$file" ${noextract[@]}; then
if in_array "$file" "${noextract[@]}"; then
#skip source files in the noextract=() array
# these are marked explicitly to NOT be extracted
continue
@@ -877,8 +878,8 @@ tidy_install() {
# update symlinks to this manpage
find ${MAN_DIRS[@]} -lname "$file" 2>/dev/null |
while read link ; do
rm -f "$link"
ln -sf "${file}.gz" "${link}.gz"
rm -f "$link" "${link}.gz"
ln -s "${file}.gz" "${link}.gz"
done
# check file still exists (potentially already compressed due to hardlink)
@@ -1087,7 +1088,8 @@ create_package() {
fi
if (( ! ret )) && [[ ! "$PKGDEST" -ef "${startdir}" ]]; then
ln -sf "${pkg_file}" "${pkg_file/$PKGDEST/$startdir}"
rm -f "${pkg_file/$PKGDEST/$startdir}"
ln -s "${pkg_file}" "${pkg_file/$PKGDEST/$startdir}"
ret=$?
fi
@@ -1169,7 +1171,8 @@ create_srcpackage() {
fi
if (( ! ret )) && [[ ! "$SRCPKGDEST" -ef "${startdir}" ]]; then
ln -sf "${pkg_file}" "${pkg_file/$SRCPKGDEST/$startdir}"
rm -f "${pkg_file/$SRCPKGDEST/$startdir}"
ln -s "${pkg_file}" "${pkg_file/$SRCPKGDEST/$startdir}"
ret=$?
fi

View File

@@ -525,8 +525,9 @@ if (( success )); then
[[ -f $tmpdir/$filename ]] && mv "$tmpdir/$filename" "$REPO_DB_FILE"
dblink="${REPO_DB_FILE%.tar.*}"
target=${REPO_DB_FILE##*/}
ln -sf "$target" "$dblink" 2>/dev/null || \
ln -f "$target" "$dblink" 2>/dev/null || \
rm -f "$dblink"
ln -s "$target" "$dblink" 2>/dev/null || \
ln "$target" "$dblink" 2>/dev/null || \
cp "$REPO_DB_FILE" "$dblink"
else
msg "$(gettext "No packages modified, nothing to do.")"

View File

@@ -27,6 +27,7 @@
#include <sys/types.h> /* off_t */
#include <unistd.h>
#include <wchar.h>
#include <limits.h> /* UINT_MAX */
#include <alpm.h>
@@ -561,10 +562,13 @@ void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total)
diff_sec = current_time.tv_sec - initial_time.tv_sec;
diff_usec = current_time.tv_usec - initial_time.tv_usec;
timediff = diff_sec + (diff_usec / 1000000.0);
rate = xfered / (timediff * 1024.0);
/* round elapsed time to the nearest second */
eta_s = (int)(timediff + 0.5);
if(timediff > 0.0) {
rate = xfered / (timediff * 1024.0);
/* round elapsed time to the nearest second */
eta_s = (unsigned int)(timediff + 0.5);
} else {
eta_s = 0;
}
} else {
/* compute current average values */
timediff = get_update_timediff(0);
@@ -576,12 +580,20 @@ void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total)
rate = (xfered - xfered_last) / (timediff * 1024.0);
/* average rate to reduce jumpiness */
rate = (rate + 2 * rate_last) / 3;
eta_s = (total - xfered) / (rate * 1024.0);
if(rate > 0.0) {
eta_s = (total - xfered) / (rate * 1024.0);
} else {
eta_s = UINT_MAX;
}
rate_last = rate;
xfered_last = xfered;
}
file_percent = (file_xfered * 100) / file_total;
if(file_total) {
file_percent = (file_xfered * 100) / file_total;
} else {
file_percent = 100;
}
if(totaldownload) {
total_percent = ((list_xfered + file_xfered) * 100) /
@@ -658,6 +670,7 @@ void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total)
}
/* 1 space + filenamelen + 1 space + 7 for size + 1 + 7 for rate + 2 for /s + 1 space + 8 for eta */
/* TODO: if eta_h > 99, formatting gets all messed up */
printf(" %ls%-*s %6.1f%c %#6.1f%c/s %02u:%02u:%02u", wcfname,
padwid, "", f_xfered, xfered_size,
rate, rate_size, eta_h, eta_m, eta_s);

View File

@@ -644,7 +644,15 @@ static int process_group(alpm_list_t *dbs, char *group)
group);
select_display(pkgs);
char *array = malloc(count);
multiselect_question(array, count);
if(!array) {
ret = 1;
goto cleanup;
}
if(multiselect_question(array, count)) {
ret = 1;
free(array);
goto cleanup;
}
int n = 0;
for(i = pkgs; i; i = alpm_list_next(i)) {
if(array[n++] == 0)
@@ -657,6 +665,7 @@ static int process_group(alpm_list_t *dbs, char *group)
goto cleanup;
}
}
free(array);
} else {
for(i = pkgs; i; i = alpm_list_next(i)) {
pmpkg_t *pkg = alpm_list_getdata(i);

View File

@@ -37,6 +37,9 @@
#include <unistd.h>
#include <limits.h>
#include <wchar.h>
#ifdef HAVE_TERMIOS_H
#include <termios.h> /* tcflush */
#endif
#include <alpm.h>
#include <alpm_list.h>
@@ -100,6 +103,18 @@ int needs_root(void)
}
}
/* discard unhandled input on the terminal's input buffer */
static int flush_term_input(void) {
#ifdef HAVE_TCFLUSH
if(isatty(fileno(stdin))) {
return(tcflush(fileno(stdin), TCIFLUSH));
}
#endif
/* fail silently */
return 0;
}
/* gets the current screen column width */
int getcols(int def)
{
@@ -216,8 +231,9 @@ void indentprint(const char *str, int indent)
return;
}
/* if we're not a tty, print without indenting */
if(cols == 0) {
/* if we're not a tty, or our tty is not wide enough that wrapping even makes
* sense, print without indenting */
if(cols == 0 || indent > cols) {
printf("%s", str);
return;
}
@@ -450,12 +466,16 @@ void list_display(const char *title, const alpm_list_t *list)
if(!list) {
printf("%s\n", _("None"));
} else {
int cols;
const int maxcols = getcols(80);
for(i = list, cols = len; i; i = alpm_list_next(i)) {
char *str = alpm_list_getdata(i);
const int maxcols = getcols(0);
int cols = len;
const char *str = alpm_list_getdata(list);
printf("%s", str);
cols += string_length(str);
for(i = alpm_list_next(list); i; i = alpm_list_next(i)) {
const char *str = alpm_list_getdata(i);
int s = string_length(str);
if(cols + s + 2 >= maxcols) {
/* wrap only if we have enough usable column space */
if(maxcols > len && cols + s + 2 >= maxcols) {
int j;
cols = len;
printf("\n");
@@ -791,8 +811,9 @@ static int multiselect_parse(char *array, int count, char *response)
int multiselect_question(char *array, int count)
{
char response[64];
char *response, *lastchar;
FILE *stream;
size_t response_len = 64;
if(config->noconfirm) {
stream = stdout;
@@ -801,19 +822,47 @@ int multiselect_question(char *array, int count)
stream = stderr;
}
response = malloc(response_len);
if(!response) {
return -1;
}
lastchar = response + response_len - 1;
/* sentinel byte to later see if we filled up the entire string */
*lastchar = 1;
while(1) {
memset(array, 1, count);
fprintf(stream, "\n");
fprintf(stream, _("Enter a selection (default=all)"));
fprintf(stream, ": ");
fflush(stream);
if(config->noconfirm) {
fprintf(stream, "\n");
break;
}
if(fgets(response, sizeof(response), stdin)) {
flush_term_input();
if(fgets(response, response_len, stdin)) {
const size_t response_incr = 64;
/* handle buffer not being large enough to read full line case */
while(*lastchar == '\0' && lastchar[-1] != '\n') {
response_len += response_incr;
response = realloc(response, response_len);
if(!response) {
return -1;
}
lastchar = response + response_len - 1;
/* sentinel byte */
*lastchar = 1;
if(fgets(response + response_len - response_incr - 1,
response_incr + 1, stdin) == 0) {
free(response);
return -1;
}
}
strtrim(response);
if(strlen(response) > 0) {
if(multiselect_parse(array, count, response) == -1) {
@@ -821,9 +870,14 @@ int multiselect_question(char *array, int count)
continue;
}
}
break;
} else {
free(response);
return -1;
}
break;
}
free(response);
return(0);
}
@@ -850,6 +904,8 @@ int select_question(int count)
break;
}
flush_term_input();
if(fgets(response, sizeof(response), stdin)) {
strtrim(response);
if(strlen(response) > 0) {
@@ -897,6 +953,8 @@ static int question(short preset, char *fmt, va_list args)
}
fflush(stream);
flush_term_input();
if(fgets(response, sizeof(response), stdin)) {
strtrim(response);
if(strlen(response) == 0) {

View File

@@ -0,0 +1,21 @@
self.description = "Fileconflict file -> dir on package replacement (FS#24904)"
lp = pmpkg("dummy")
lp.files = ["dir/filepath",
"dir/file"]
self.addpkg2db("local", lp)
p1 = pmpkg("replace")
p1.provides = ["dummy"]
p1.replaces = ["dummy"]
p1.files = ["dir/filepath/",
"dir/filepath/file",
"dir/file",
"dir/file2"]
self.addpkg2db("sync", p1)
self.args = "-Su"
self.addrule("PACMAN_RETCODE=0")
self.addrule("!PKG_EXIST=dummy")
self.addrule("PKG_EXIST=replace")