Merge branch 'maint'

Conflicts:

	contrib/gensync
	contrib/updatesync
This commit is contained in:
Dan McGee 2008-02-05 19:31:23 -06:00
commit eca30ed66a
12 changed files with 84 additions and 14 deletions

16
ChangeLog.proto Normal file
View file

@ -0,0 +1,16 @@
2007-12-01 Your Name <youremail@domain.com>
* pkgver-pkgrel :
new upstream release.
Reason we changed stuff.
Another reason we changed stuff.
* gcc-4.1.patch :
Removed, no longer needed.
2007-11-01 Your Name <youremail@domain.com>
* 1.0-5 :
added ChangeLog.
the last line should end with just one newline.
you can cat the file to check it displays fine.

View file

@ -9,7 +9,7 @@ EXTRA_DIST = HACKING
# Sample makepkg prototype files # Sample makepkg prototype files
pkgdatadir = ${datadir}/${PACKAGE} pkgdatadir = ${datadir}/${PACKAGE}
dist_pkgdata_DATA = PKGBUILD.proto proto.install dist_pkgdata_DATA = PKGBUILD.proto proto.install ChangeLog.proto
# run the pactest test suite # run the pactest test suite
check-local: src/pacman check-local: src/pacman

View file

@ -28,6 +28,11 @@ build the package, install the package into a temporary root, make
customizations, generate meta-info, and package the whole thing up for pacman customizations, generate meta-info, and package the whole thing up for pacman
to use. to use.
NOTE: makepkg uses your current locale by default and does not unset it when
building packages. If you wish to share your build output with others when
seeking help or for other purposes, you may wish to run "`LC_ALL=C makepkg`" so
your logs and output are not localized.
Options Options
------- -------
*\--asroot*:: *\--asroot*::
@ -83,7 +88,7 @@ Options
if required and generate integrity checks. The integrity checks if required and generate integrity checks. The integrity checks
generated are determined by the value of the INTEGRITY_CHECK array in generated are determined by the value of the INTEGRITY_CHECK array in
linkman:makepkg.conf[5]. This output can be redirected into your linkman:makepkg.conf[5]. This output can be redirected into your
PKGBUILD for source validation (`makepkg -g >> PKGBUILD`). PKGBUILD for source validation using "`makepkg -g >> PKGBUILD`".
*-h, \--help*:: *-h, \--help*::
Output syntax and command line options. Output syntax and command line options.
@ -97,6 +102,13 @@ Options
Install or upgrade the package after a successful build using Install or upgrade the package after a successful build using
linkman:pacman[8]. linkman:pacman[8].
*-L, \--log*::
Enable makepkg build logging. This will use the *tee* program to send
output of the `build()` function to both the console and to a text file in
the build directory named `pkgname-pkgver-pkgrel-arch.log`. As mentioned
above, the build log will be localized so you may want to set your locale
accordingly if sharing the log output with others.
*-m, \--nocolor*:: *-m, \--nocolor*::
Disable color in output messages. Disable color in output messages.

View file

@ -810,6 +810,9 @@ create_package() {
if [ "$CARCH" != "" ]; then if [ "$CARCH" != "" ]; then
echo "arch = $CARCH" >>.PKGINFO echo "arch = $CARCH" >>.PKGINFO
fi fi
if [ "$(check_option force)" = "y" ]; then
echo "force = true" >> .PKGINFO
fi
local it local it
for it in "${license[@]}"; do for it in "${license[@]}"; do

View file

@ -136,7 +136,7 @@ db_write_entry()
# blank out all variables and set pkgfile # blank out all variables and set pkgfile
local pkgfile=$(readlink -f "$1") local pkgfile=$(readlink -f "$1")
local pkgname pkgver pkgdesc url builddate packager csize size \ local pkgname pkgver pkgdesc url builddate packager csize size \
group depend backup license replaces provides conflict \ group depend backup license replaces provides conflict force \
_groups _depends _backups _licenses _replaces _provides _conflicts \ _groups _depends _backups _licenses _replaces _provides _conflicts \
startdir startdir
@ -209,7 +209,7 @@ db_write_entry()
[ -n "$builddate" ] && echo -e "%BUILDDATE%\n$builddate\n" >>desc [ -n "$builddate" ] && echo -e "%BUILDDATE%\n$builddate\n" >>desc
[ -n "$packager" ] && echo -e "%PACKAGER%\n$packager\n" >>desc [ -n "$packager" ] && echo -e "%PACKAGER%\n$packager\n" >>desc
write_list_entry "REPLACES" "$_replaces" "desc" write_list_entry "REPLACES" "$_replaces" "desc"
[ $FORCE -eq 1 ] && echo -e "%FORCE%\n" >>desc [ $FORCE -eq 1 -o -n "$force" ] && echo -e "%FORCE%\n" >>desc
# create depends entry # create depends entry
msg2 "$(gettext "Creating 'depends' db entry...")" msg2 "$(gettext "Creating 'depends' db entry...")"

View file

@ -25,7 +25,6 @@ export TEXTDOMAINDIR='@localedir@'
myver='@PACKAGE_VERSION@' myver='@PACKAGE_VERSION@'
confdir='@sysconfdir@' confdir='@sysconfdir@'
FORCE=0
REPO_DB_FILE="" REPO_DB_FILE=""
msg() { msg() {
@ -169,6 +168,9 @@ if [ $success -eq 1 ]; then
esac esac
bsdtar -c${TAR_OPT}f "$REPO_DB_FILE" * bsdtar -c${TAR_OPT}f "$REPO_DB_FILE" *
else
error "$(gettext "All packages have been removed from the database. Deleting '%s'.")" "$REPO_DB_FILE"
rm "$REPO_DB_FILE"
fi fi
popd 2>&1 >/dev/null popd 2>&1 >/dev/null

View file

@ -115,8 +115,9 @@ int pacman_add(alpm_list_t *targets)
for(i = targets; i; i = alpm_list_next(i)) { for(i = targets; i; i = alpm_list_next(i)) {
char *targ = alpm_list_getdata(i); char *targ = alpm_list_getdata(i);
if(alpm_trans_addtarget(targ) == -1) { if(alpm_trans_addtarget(targ) == -1) {
fprintf(stderr, _("error: failed to add target '%s' (%s)"), targ, printf("failed.\n");
alpm_strerrorlast()); fprintf(stderr, _("error: '%s': %s\n"),
targ, alpm_strerrorlast());
add_cleanup(); add_cleanup();
return(1); return(1);
} }

View file

@ -70,6 +70,7 @@ static int query_fileowner(alpm_list_t *targets)
int found = 0; int found = 0;
char *filename = alpm_list_getdata(t); char *filename = alpm_list_getdata(t);
char *bname; char *bname;
char *dname;
char *rpath; char *rpath;
struct stat buf; struct stat buf;
alpm_list_t *i, *j; alpm_list_t *i, *j;
@ -88,10 +89,14 @@ static int query_fileowner(alpm_list_t *targets)
} }
bname = mbasename(filename); bname = mbasename(filename);
dname = mdirname(filename);
rpath = resolve_path(dname);
free(dname);
if(!(rpath = resolve_path(filename))) { if(!rpath) {
fprintf(stderr, _("error: cannot determine real path for '%s': %s\n"), fprintf(stderr, _("error: cannot determine real path for '%s': %s\n"),
filename, strerror(errno)); filename, strerror(errno));
free(rpath);
ret++; ret++;
continue; continue;
} }
@ -100,7 +105,7 @@ static int query_fileowner(alpm_list_t *targets)
pmpkg_t *info = alpm_list_getdata(i); pmpkg_t *info = alpm_list_getdata(i);
for(j = alpm_pkg_get_files(info); j && !found; j = alpm_list_next(j)) { for(j = alpm_pkg_get_files(info); j && !found; j = alpm_list_next(j)) {
char path[PATH_MAX], *ppath; char path[PATH_MAX], *ppath, *pdname;
snprintf(path, PATH_MAX, "%s%s", snprintf(path, PATH_MAX, "%s%s",
alpm_option_get_root(), (const char *)alpm_list_getdata(j)); alpm_option_get_root(), (const char *)alpm_list_getdata(j));
@ -109,10 +114,12 @@ static int query_fileowner(alpm_list_t *targets)
continue; continue;
} }
ppath = resolve_path(path); pdname = mdirname(path);
ppath = resolve_path(pdname);
free(pdname);
if(ppath && strcmp(ppath, rpath) == 0) { if(ppath && strcmp(ppath, rpath) == 0) {
printf(_("%s is owned by %s %s\n"), rpath, printf(_("%s is owned by %s %s\n"), filename,
alpm_pkg_get_name(info), alpm_pkg_get_version(info)); alpm_pkg_get_name(info), alpm_pkg_get_version(info));
found = 1; found = 1;
} }

View file

@ -108,8 +108,8 @@ int pacman_remove(alpm_list_t *targets)
char *targ = alpm_list_getdata(i); char *targ = alpm_list_getdata(i);
if(alpm_trans_addtarget(targ) == -1) { if(alpm_trans_addtarget(targ) == -1) {
printf("failed.\n"); printf("failed.\n");
fprintf(stderr, _("error: failed to add target '%s' (%s)\n"), targ, fprintf(stderr, _("error: '%s': %s\n"),
alpm_strerrorlast()); targ, alpm_strerrorlast());
remove_cleanup(); remove_cleanup();
FREELIST(finaltargs); FREELIST(finaltargs);
return(1); return(1);

View file

@ -568,7 +568,7 @@ static int sync_trans(alpm_list_t *targets, int sync_only)
} }
if(pm_errno != PM_ERR_PKG_NOT_FOUND) { if(pm_errno != PM_ERR_PKG_NOT_FOUND) {
fprintf(stderr, _("error: '%s': %s\n"), fprintf(stderr, _("error: '%s': %s\n"),
(char *)i->data, alpm_strerrorlast()); targ, alpm_strerrorlast());
retval = 1; retval = 1;
goto cleanup; goto cleanup;
} }

View file

@ -187,6 +187,34 @@ char *mbasename(const char *path)
return (char *)p; return (char *)p;
} }
/** Parse the dirname of a program from a path.
* The path returned should be freed.
* @param path path to parse dirname from
*
* @return everything preceding the final '/'
*/
char *mdirname(const char *path)
{
char *ret, *last;
/* null or empty path */
if(path == NULL || path == '\0') {
return(strdup("."));
}
ret = strdup(path);
last = strrchr(ret, '/');
if(last != NULL) {
/* we found a '/', so terminate our string */
*last = '\0';
return(ret);
}
/* no slash found */
free(ret);
return(strdup("."));
}
/* output a string, but wrap words properly with a specified indentation /* output a string, but wrap words properly with a specified indentation
*/ */
void indentprint(const char *str, int indent) void indentprint(const char *str, int indent)

View file

@ -41,6 +41,7 @@ int getcols();
int makepath(const char *path); int makepath(const char *path);
int rmrf(const char *path); int rmrf(const char *path);
char *mbasename(const char *path); char *mbasename(const char *path);
char *mdirname(const char *path);
void indentprint(const char *str, int indent); void indentprint(const char *str, int indent);
char *strtoupper(char *str); char *strtoupper(char *str);
char *strtrim(char *str); char *strtrim(char *str);