[pacman-dev] [PATCH] Added LOGDEST variable
William Giokas
1007380 at gmail.com
Thu Nov 29 01:54:48 EST 2012
On Thu, Nov 29, 2012 at 04:11:22PM +1000, Allan McRae wrote:
> On 26/11/12 14:50, wgiokas wrote:
> > Places logs in a pre-defined location. The logs are always neatly
> > labeled with package names and numbers, and this way can be more easily
> > send to network shares as they're written or compressed/cleaned en
> > masse.
> >
> > Signed-off-by: wgiokas <1007380 at gmail.com>
>
> Idea is good. Small comment below.
>
> > ---
> > doc/makepkg.conf.5.txt | 5 +++++
> > etc/makepkg.conf.in | 2 ++
> > scripts/makepkg.sh.in | 11 ++++++++++-
> > 3 files changed, 17 insertions(+), 1 deletion(-)
> >
> > diff --git a/doc/makepkg.conf.5.txt b/doc/makepkg.conf.5.txt
> > index dcd9417..6c9ed0e 100644
> > --- a/doc/makepkg.conf.5.txt
> > +++ b/doc/makepkg.conf.5.txt
> > @@ -231,6 +231,11 @@ Options
> > in the current directory. Many people like to keep all source package files
> > in a central location for easy cleanup, so this path can be set here.
> >
> > +**LOGDEST=**"/path/to/folder"::
> > + If this value is not set, log files are written to the starting
> > + directory. This can be used to send log files to a network drive or
> > + to a program, and also facilitate the cleaning and compression of logs.
> > +
>
> Not sure about that second sentence (program?). How about just
>
> This allows keeping all the log files in a central location for easy
> cleanup and compression.
>
I'll send in a patch revision RSAP.
> > **PACKAGER=**"John Doe <john at example.com>"::
> > This value is used when querying a package to see who was the builder.
> > It is recommended you change this to your name and email address.
> > diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in
> > index 1319c7a..9a67031 100644
> > --- a/etc/makepkg.conf.in
> > +++ b/etc/makepkg.conf.in
> > @@ -106,6 +106,8 @@ PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)
> > #SRCDEST=/home/sources
> > #-- Source packages: specify a fixed directory where all src packages will be placed
> > #SRCPKGDEST=/home/srcpackages
> > +#-- Log Files: specify a fixed directory where all log files will be placed
> > +#LOGDEST=/home/makepkglogs
> > #-- Packager: name/email of the person or organization building packages
> > #PACKAGER="John Doe <john at doe.com>"
> > #-- Specify a key to use for package signing
> > diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> > index a5ac59a..2fe6605 100644
> > --- a/scripts/makepkg.sh.in
> > +++ b/scripts/makepkg.sh.in
> > @@ -1362,7 +1362,7 @@ run_function() {
> > local ret=0
> > if (( LOGGING )); then
> > local fullver=$(get_full_version)
> > - local BUILDLOG="${startdir}/${pkgbase}-${fullver}-${CARCH}-$pkgfunc.log"
> > + local BUILDLOG="$LOGDEST/${pkgbase}-${fullver}-${CARCH}-$pkgfunc.log"
> > if [[ -f $BUILDLOG ]]; then
> > local i=1
> > while true; do
> > @@ -2532,6 +2532,7 @@ trap 'trap_exit USR1 "$(gettext "An unknown error has occurred. Exiting...")"' E
> > [[ -n ${PKGDEST} ]] && _PKGDEST=$(canonicalize_path ${PKGDEST})
> > [[ -n ${SRCDEST} ]] && _SRCDEST=$(canonicalize_path ${SRCDEST})
> > [[ -n ${SRCPKGDEST} ]] && _SRCPKGDEST=$(canonicalize_path ${SRCPKGDEST})
> > +[[ -n ${LOGDEST} ]] && _LOGDEST=$(canonicalize_path ${LOGDEST})
> > [[ -n ${BUILDDIR} ]] && _BUILDDIR=$(canonicalize_path ${BUILDDIR})
> > [[ -n ${PKGEXT} ]] && _PKGEXT=${PKGEXT}
> > [[ -n ${SRCEXT} ]] && _SRCEXT=${SRCEXT}
> > @@ -2624,6 +2625,14 @@ if (( SOURCEONLY )) && [[ ! -w $SRCPKGDEST ]]; then
> > exit 1
> > fi
> >
> > +LOGDEST=${_LOGDEST:-$LOGDEST}
> > +LOGDEST=${LOGDEST:-$startdir} #default to $startdir if undefined
> > +if (( LOGGING )) && [[ ! -w $LOGDEST ]]; then
> > + error "$(gettext "You do not have write permission to store logs in %s.")" "$LOGDEST"
> > + plain "$(gettext "Aborting...")"
> > + exit 1
> > +fi
> > +
> > PKGEXT=${_PKGEXT:-$PKGEXT}
> > SRCEXT=${_SRCEXT:-$SRCEXT}
> > GPGKEY=${_GPGKEY:-$GPGKEY}
> >
>
>
--
William Giokas | KaiSforza
GnuPG Key: 0xE99A7F0F
Fingerprint: F078 CFF2 45E8 1E72 6D5A 8653 CDF5 E7A5 E99A 7F0F
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://mailman.archlinux.org/pipermail/pacman-dev/attachments/20121129/72701d2e/attachment-0001.asc>
More information about the pacman-dev
mailing list