diff options
author | Dan McGee <dan@archlinux.org> | 2008-02-05 19:31:23 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2008-02-05 19:31:23 -0600 |
commit | eca30ed66accd7c1555eb94cbdea60051efcf7f3 (patch) | |
tree | 3ec7f3387dea753bb68968c66597a1aa8e091ab4 | |
parent | 93a3050ed9e9735352013014da52adcdf896f95f (diff) | |
parent | b29838c8250125a22016c16180e941d059d55539 (diff) | |
download | pacman-eca30ed66accd7c1555eb94cbdea60051efcf7f3.tar.xz |
Merge branch 'maint'
Conflicts:
contrib/gensync
contrib/updatesync
-rw-r--r-- | ChangeLog.proto | 16 | ||||
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | doc/makepkg.8.txt | 14 | ||||
-rw-r--r-- | scripts/makepkg.sh.in | 3 | ||||
-rw-r--r-- | scripts/repo-add.sh.in | 4 | ||||
-rw-r--r-- | scripts/repo-remove.sh.in | 4 | ||||
-rw-r--r-- | src/pacman/add.c | 5 | ||||
-rw-r--r-- | src/pacman/query.c | 15 | ||||
-rw-r--r-- | src/pacman/remove.c | 4 | ||||
-rw-r--r-- | src/pacman/sync.c | 2 | ||||
-rw-r--r-- | src/pacman/util.c | 28 | ||||
-rw-r--r-- | src/pacman/util.h | 1 |
12 files changed, 84 insertions, 14 deletions
diff --git a/ChangeLog.proto b/ChangeLog.proto new file mode 100644 index 00000000..87e86e72 --- /dev/null +++ b/ChangeLog.proto @@ -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. diff --git a/Makefile.am b/Makefile.am index 6453555e..dc085429 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,7 +9,7 @@ EXTRA_DIST = HACKING # Sample makepkg prototype files pkgdatadir = ${datadir}/${PACKAGE} -dist_pkgdata_DATA = PKGBUILD.proto proto.install +dist_pkgdata_DATA = PKGBUILD.proto proto.install ChangeLog.proto # run the pactest test suite check-local: src/pacman diff --git a/doc/makepkg.8.txt b/doc/makepkg.8.txt index f3f5d7c9..59108f1b 100644 --- a/doc/makepkg.8.txt +++ b/doc/makepkg.8.txt @@ -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 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 ------- *\--asroot*:: @@ -83,7 +88,7 @@ Options if required and generate integrity checks. The integrity checks generated are determined by the value of the INTEGRITY_CHECK array in 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*:: Output syntax and command line options. @@ -97,6 +102,13 @@ Options Install or upgrade the package after a successful build using 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*:: Disable color in output messages. diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 0997386e..68ad5978 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -810,6 +810,9 @@ create_package() { if [ "$CARCH" != "" ]; then echo "arch = $CARCH" >>.PKGINFO fi + if [ "$(check_option force)" = "y" ]; then + echo "force = true" >> .PKGINFO + fi local it for it in "${license[@]}"; do diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in index c37a12fa..efd3bc03 100644 --- a/scripts/repo-add.sh.in +++ b/scripts/repo-add.sh.in @@ -136,7 +136,7 @@ db_write_entry() # blank out all variables and set pkgfile local pkgfile=$(readlink -f "$1") 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 \ startdir @@ -209,7 +209,7 @@ db_write_entry() [ -n "$builddate" ] && echo -e "%BUILDDATE%\n$builddate\n" >>desc [ -n "$packager" ] && echo -e "%PACKAGER%\n$packager\n" >>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 msg2 "$(gettext "Creating 'depends' db entry...")" diff --git a/scripts/repo-remove.sh.in b/scripts/repo-remove.sh.in index 05bec390..fe230b02 100644 --- a/scripts/repo-remove.sh.in +++ b/scripts/repo-remove.sh.in @@ -25,7 +25,6 @@ export TEXTDOMAINDIR='@localedir@' myver='@PACKAGE_VERSION@' confdir='@sysconfdir@' -FORCE=0 REPO_DB_FILE="" msg() { @@ -169,6 +168,9 @@ if [ $success -eq 1 ]; then esac 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 popd 2>&1 >/dev/null diff --git a/src/pacman/add.c b/src/pacman/add.c index 975d26be..debe5c47 100644 --- a/src/pacman/add.c +++ b/src/pacman/add.c @@ -115,8 +115,9 @@ int pacman_add(alpm_list_t *targets) for(i = targets; i; i = alpm_list_next(i)) { char *targ = alpm_list_getdata(i); if(alpm_trans_addtarget(targ) == -1) { - fprintf(stderr, _("error: failed to add target '%s' (%s)"), targ, - alpm_strerrorlast()); + printf("failed.\n"); + fprintf(stderr, _("error: '%s': %s\n"), + targ, alpm_strerrorlast()); add_cleanup(); return(1); } diff --git a/src/pacman/query.c b/src/pacman/query.c index fd2f7927..e999a328 100644 --- a/src/pacman/query.c +++ b/src/pacman/query.c @@ -70,6 +70,7 @@ static int query_fileowner(alpm_list_t *targets) int found = 0; char *filename = alpm_list_getdata(t); char *bname; + char *dname; char *rpath; struct stat buf; alpm_list_t *i, *j; @@ -88,10 +89,14 @@ static int query_fileowner(alpm_list_t *targets) } 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"), filename, strerror(errno)); + free(rpath); ret++; continue; } @@ -100,7 +105,7 @@ static int query_fileowner(alpm_list_t *targets) pmpkg_t *info = alpm_list_getdata(i); 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", alpm_option_get_root(), (const char *)alpm_list_getdata(j)); @@ -109,10 +114,12 @@ static int query_fileowner(alpm_list_t *targets) continue; } - ppath = resolve_path(path); + pdname = mdirname(path); + ppath = resolve_path(pdname); + free(pdname); 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)); found = 1; } diff --git a/src/pacman/remove.c b/src/pacman/remove.c index 56837fa2..0722057f 100644 --- a/src/pacman/remove.c +++ b/src/pacman/remove.c @@ -108,8 +108,8 @@ int pacman_remove(alpm_list_t *targets) char *targ = alpm_list_getdata(i); if(alpm_trans_addtarget(targ) == -1) { printf("failed.\n"); - fprintf(stderr, _("error: failed to add target '%s' (%s)\n"), targ, - alpm_strerrorlast()); + fprintf(stderr, _("error: '%s': %s\n"), + targ, alpm_strerrorlast()); remove_cleanup(); FREELIST(finaltargs); return(1); diff --git a/src/pacman/sync.c b/src/pacman/sync.c index 582192a4..27218d61 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -568,7 +568,7 @@ static int sync_trans(alpm_list_t *targets, int sync_only) } if(pm_errno != PM_ERR_PKG_NOT_FOUND) { fprintf(stderr, _("error: '%s': %s\n"), - (char *)i->data, alpm_strerrorlast()); + targ, alpm_strerrorlast()); retval = 1; goto cleanup; } diff --git a/src/pacman/util.c b/src/pacman/util.c index 42b0c98d..2dae832f 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -187,6 +187,34 @@ char *mbasename(const char *path) 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 */ void indentprint(const char *str, int indent) diff --git a/src/pacman/util.h b/src/pacman/util.h index 00c88949..0273512e 100644 --- a/src/pacman/util.h +++ b/src/pacman/util.h @@ -41,6 +41,7 @@ int getcols(); int makepath(const char *path); int rmrf(const char *path); char *mbasename(const char *path); +char *mdirname(const char *path); void indentprint(const char *str, int indent); char *strtoupper(char *str); char *strtrim(char *str); |