FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CRUX > CRUX

 
 
LinkBack Thread Tools
 
Old 03-04-2009, 05:08 PM
Johannes Winkelmann
 
Default Testing wanted: pkgmk with --ignore-new option

Hi there,

I've done an update to pkgmk to add symbolic error codes (fairly coarse
for now), and to optionally ignore footprint missmatches if no files are
missing (also see bug #221 for more information on this).

I've prepared an updated pkgutils port; you can get it via
httpup sync http://jw.smts.ch/files/crux/ports#pkgutils pkgutils

To make prt-get use that new feature, edit /etc/prt-get.conf and add the
following line:
makecommand pkgmk -in


Note that it is recommended to avoid using --ignore-new/-in during
packaging, since footprint missmatches should always be looked at in
this phase.


Please let me know if you have comments or feedback!
Cheers, Johannes
--
Johannes Winkelmann mailto:jw@smts.ch
Zurich, Switzerland http://jw.smts.ch
_______________________________________________
CRUX mailing list
CRUX@lists.crux.nu
http://lists.crux.nu/mailman/listinfo/crux
 
Old 03-04-2009, 05:22 PM
Johannes Winkelmann
 
Default Testing wanted: pkgmk with --ignore-new option

On Wed, Mar 04, 2009 at 19:08:28 +0100, Johannes Winkelmann wrote:
> Hi there,
>
> I've done an update to pkgmk to add symbolic error codes (fairly coarse
> for now), and to optionally ignore footprint missmatches if no files are
> missing (also see bug #221 for more information on this).
>
> I've prepared an updated pkgutils port; you can get it via
> httpup sync http://jw.smts.ch/files/crux/ports#pkgutils pkgutils

I've just discovered a problem, I'll upload a new version in a bit and
send another mail... sorry for the noise.

Johannes
--
Johannes Winkelmann mailto:jw@smts.ch
Zurich, Switzerland http://jw.smts.ch
_______________________________________________
CRUX mailing list
CRUX@lists.crux.nu
http://lists.crux.nu/mailman/listinfo/crux
 
Old 03-04-2009, 05:39 PM
Johannes Winkelmann
 
Default Testing wanted: pkgmk with --ignore-new option

On Wed, Mar 04, 2009 at 19:22:10 +0100, Johannes Winkelmann wrote:
[...]
> I've just discovered a problem, I'll upload a new version in a bit and
> send another mail... sorry for the noise.
Fixed; still available from the same place:
http://jw.smts.ch/files/crux/ports/pkgutils/

Make sure you use 5.33.1-pre4.

Thanks, Johannes
--
Johannes Winkelmann mailto:jw@smts.ch
Zurich, Switzerland http://jw.smts.ch
_______________________________________________
CRUX mailing list
CRUX@lists.crux.nu
http://lists.crux.nu/mailman/listinfo/crux
 
Old 03-07-2009, 01:32 PM
Predrag Ivanovic
 
Default Testing wanted: pkgmk with --ignore-new option

On Wed, 04 Mar 2009 19:08:28 +0100
Johannes Winkelmann wrote:

>Hi there,
>
>I've done an update to pkgmk to add symbolic error codes (fairly coarse
>for now), and to optionally ignore footprint missmatches if no files are
>missing (also see bug #221 for more information on this).

Pkgmk that Han Boetes modified few years back (which I use without problems so far),
has something similar wrt footprint mismatches (and a few extra goodies
that made my life when making ports a bit easier )

e.g (output modified for clarity)

=======> WARNING: Footprint mismatch found:
MISSING lrwxrwxrwx root/root usr/lib/libpurple-client.so -> libpurple-client.so.0.5.4
MISSING lrwxrwxrwx root/root usr/lib/libpurple-client.so.0 -> libpurple-client.so.0.5.4
MISSING -rwxr-xr-x root/root usr/lib/libpurple-client.so.0.5.4
NEW lrwxrwxrwx root/root usr/lib/libpurple-client.so -> libpurple-client.so.0.5.5
NEW lrwxrwxrwx root/root usr/lib/libpurple-client.so.0 -> libpurple-client.so.0.5.5
NEW -rwxr-xr-x root/root usr/lib/libpurple-client.so.0.5.5
MISSING lrwxrwxrwx root/root usr/lib/libpurple.so -> libpurple.so.0.5.4
MISSING lrwxrwxrwx root/root usr/lib/libpurple.so.0 -> libpurple.so.0.5.4
MISSING -rwxr-xr-x root/root usr/lib/libpurple.so.0.5.4
NEW lrwxrwxrwx root/root usr/lib/libpurple.so -> libpurple.so.0.5.5
NEW lrwxrwxrwx root/root usr/lib/libpurple.so.0 -> libpurple.so.0.5.5
NEW -rwxr-xr-x root/root usr/lib/libpurple.so.0.5.5
NEW -rw-r--r-- root/root usr/share/purple/ca-certs/AOL_Member_CA.pem
NEW -rw-r--r-- root/root usr/share/purple/ca-certs/America_Online_Root_Certification_Authority_1.pem
NEW -rw-r--r-- root/root usr/share/purple/ca-certs/VeriSign_International_Server_Class_3_CA.pem
[u]pdate footprint/[e]rror/[i]gnore footprint mismatch [u/e/i] u
=======> Footprint updated.
=======> Building `/usr/pkgmk/package/pidgin#2.5.5-1.pkg.tar.gz' succeeded.
=======> Leaving fakeroot environment
[snip]
>
>Please let me know if you have comments or feedback!
>Cheers, Johannes

I always wondered why vanilla pkgmk doesn't have something similar, I'm glad to see
that it might get such a usefull, imho, feature.Default 'throw an error, remove all' behaviour always
seemed a bit abrupt to me, not to mention frustrating when I made a typo in Pkgfile or forgot to remove some junk file, and
pkgmk happily deletes both source and built package that took an hour to compile(that was the default behaviour, iirc).Oh, memories, memories
I'm sure you'll come up with some nice/elegant/usefull solution, Johannes, you have pretty good track record so far

Pedja
--
Zombie processes haunting the computer
_______________________________________________
CRUX mailing list
CRUX@lists.crux.nu
http://lists.crux.nu/mailman/listinfo/crux
 
Old 03-08-2009, 06:21 AM
 
Default Testing wanted: pkgmk with --ignore-new option

On Sat, Mar 07, 2009 at 03:32:37PM +0100, Predrag Ivanovic wrote:
> On Wed, 04 Mar 2009 19:08:28 +0100
> Johannes Winkelmann wrote:
>
> >Hi there,
> >
> >I've done an update to pkgmk to add symbolic error codes (fairly coarse
> >for now), and to optionally ignore footprint missmatches if no files are
> >missing (also see bug #221 for more information on this).
>
> Pkgmk that Han Boetes modified few years back (which I use without problems so far),
> has something similar wrt footprint mismatches (and a few extra goodies
> that made my life when making ports a bit easier )
>
> I always wondered why vanilla pkgmk doesn't have something similar, I'm glad to see
> that it might get such a usefull, imho, feature.Default 'throw an error, remove all' behaviour always
> seemed a bit abrupt to me, not to mention frustrating when I made a typo in Pkgfile or forgot to remove some junk file, and
> pkgmk happily deletes both source and built package that took an hour to compile(that was the default behaviour, iirc).Oh, memories, memories
> I'm sure you'll come up with some nice/elegant/usefull solution, Johannes, you have pretty good track record so far

The reason is simple, unattended installs. The last thing I want is my
package manager sitting around waiting for me to tell it what to
do until it attempts to compile the next package. Failing the way it
does, it the simplest (and imho best) way to do it.

--
Lucas Hazel <lucas@die.net.au>
_______________________________________________
CRUX mailing list
CRUX@lists.crux.nu
http://lists.crux.nu/mailman/listinfo/crux
 
Old 03-08-2009, 09:25 AM
Johannes Winkelmann
 
Default Testing wanted: pkgmk with --ignore-new option

Hi there,

On Sun, Mar 08, 2009 at 18:21:09 +1100, lucas@die.net.au wrote:
> On Sat, Mar 07, 2009 at 03:32:37PM +0100, Predrag Ivanovic wrote:
> > On Wed, 04 Mar 2009 19:08:28 +0100
> > Johannes Winkelmann wrote:
> >
> > >Hi there,
> > >
> > >I've done an update to pkgmk to add symbolic error codes (fairly coarse
> > >for now), and to optionally ignore footprint missmatches if no files are
> > >missing (also see bug #221 for more information on this).
> >
> > Pkgmk that Han Boetes modified few years back (which I use without
> > problems so far), has something similar wrt footprint mismatches
> > (and a few extra goodies that made my life when making ports a bit
> > easier )
> >
> > I always wondered why vanilla pkgmk doesn't have something similar,
> > I'm glad to see that it might get such a usefull, imho,
> > feature.Default 'throw an error, remove all' behaviour always seemed
> > a bit abrupt to me, not to mention frustrating when I made a typo in
> > Pkgfile or forgot to remove some junk file, and pkgmk happily
> > deletes both source and built package that took an hour to
> > compile(that was the default behaviour, iirc).
Well, pkgmk only removes src/pkg files when one asks for it (using the
'-c/--clean' option), so in normal operation this should never happen.
Of course, if there's a build error like the typo in the Pkgfile you
mention, no package is created in the first place. To me, this seems the
right behaviour, since this only happens during the packaging phase,
where we don't want to provide too many shortcuts to avoid problems for
the users later on.

In case of footprint mismatches which this patch addresses, the package
file is always kept and can be pkgadd'ed if the user is "happy" with the
mismatch. The problem so far was that there was no way for tools like
prt-get to know that a footprint mismatch happened, and thus it could
not ask the user to review it, similar to Han's pkgutils. Also, there
was no distinction between "only new files" mismatches (the ones which
are typically caused by optional dependencies) and mixed "new/missing"
mismatches (which should typically be looked at).

Now, the patch did not add this distinction either but added a flag to
treat "only new" mismatches as non-error, but maybe it would be better
to return an error anyway, and let the caller (user or tools) take this
decision. I'll have to think about this a bit more though.


> > Oh, memories, memories
> > I'm sure you'll come up with some nice/elegant/usefull solution,
> > Johannes, you have pretty good track record so far
Thanks for your trust :-)


> The reason is simple, unattended installs. The last thing I want is my
> package manager sitting around waiting for me to tell it what to
> do until it attempts to compile the next package. Failing the way it
> does, it the simplest (and imho best) way to do it.
Yeah, this is important to me as well. However if pkgmk has better
return values, there's still the possibiliy to implement (optional)
interactive modes in tools.


Somehow related, I was wondering if lack of md5sum and footprint files
should be considered an error; I think it should. These files should be
created only during packaging, but not when building packages from a
published ports tree. Opinions?


Cheers, Johannes
--
Johannes Winkelmann mailto:jw@smts.ch
Zurich, Switzerland http://jw.smts.ch
_______________________________________________
CRUX mailing list
CRUX@lists.crux.nu
http://lists.crux.nu/mailman/listinfo/crux
 
Old 03-08-2009, 10:46 AM
Mikhail Kolesnik
 
Default Testing wanted: pkgmk with --ignore-new option

Hello, Johannes.

On Sun, 8 Mar 2009 11:25:02 +0100
Johannes Winkelmann <jw@smts.ch> wrote:

> Somehow related, I was wondering if lack of md5sum and footprint files
> should be considered an error; I think it should. These files should be
> created only during packaging, but not when building packages from a
> published ports tree. Opinions?

Yes and (even if the port's source is fetched from svn/git/whatever
during the build process) having an empty '.md5sum' seems more
consistent than having no file at all.
Could that be enforced on the pkgmk level? Say, having a switch that
would make it fail in attempt to build a package from a port with no
'.footprint' or '.md5sum'. That switch can be used by default in the
prt-get.conf. Port maintainer would create port as usual, but the user
would feel himself a little more safer.

--
Mikhail Kolesnik
JID: mike_k at jabber.org
ICQ: 260259143
IRC: mike_k at freenode/#crux, rusnet/#yalta
_______________________________________________
CRUX mailing list
CRUX@lists.crux.nu
http://lists.crux.nu/mailman/listinfo/crux
 
Old 11-09-2009, 03:50 PM
Juergen Daubert
 
Default Testing wanted: pkgmk with --ignore-new option

On Sat, Sep 12, 2009 at 12:45:36AM +0300, Mikhail Kolesnik wrote:
> Hello, Johannes.
>
> On Wed, 4 Mar 2009 19:39:05 +0100
> Johannes Winkelmann <jw@smts.ch> wrote:
>
> > On Wed, Mar 04, 2009 at 19:22:10 +0100, Johannes Winkelmann wrote:
> > [...]
> > > I've just discovered a problem, I'll upload a new version in a bit and
> > > send another mail... sorry for the noise.
> > Fixed; still available from the same place:
> > http://jw.smts.ch/files/crux/ports/pkgutils/
> >
> > Make sure you use 5.33.1-pre4.
>
> I hope there is still some interest in this functionality. I am
> attaching the patch against pkgutils-5.34.2 (made from the Johannes'
> provided tarball).

Thanks. I've splitted the patch into two, one patch for the new error
codes and one with the --ignore-new stuff.
The later is slightly modified, added the option as comment to
pkgmk.conf, added the option to --help output.


regards
Juergen

--
Juergen Daubert | mailto:jue@jue.li
Korb, Germany | http://jue.li/crux

diff --git a/pkgmk.in b/pkgmk.in
index c7f5432..509822a 100755
--- a/pkgmk.in
+++ b/pkgmk.in
@@ -21,6 +21,18 @@
# USA.
#

+##
+# error codes
+E_GENERAL=1
+E_PKGFILE=2 # invalid Pkgfile
+E_DIR_PERM=3 # (source/build) directory missing or missing read/write permission
+E_DOWNLOAD=4 # error during download
+E_UNPACK=5 # error during unpacking of source file(s)
+E_MD5=6 # md5sum verification failed
+E_FOOTPRINT=7 # footprint check failure
+E_BUILD=8 # error while running 'build()'
+E_INSTALL=9 # error while installing the package via 'pkgadd'
+
info() {
echo "=======> $1"
}
@@ -49,29 +61,29 @@ get_basename() {
check_pkgfile() {
if [ ! "$name" ]; then
error "Variable 'name' not specified in $PKGMK_PKGFILE."
- exit 1
+ exit $E_PKGFILE
elif [ ! "$version" ]; then
error "Variable 'version' not specified in $PKGMK_PKGFILE."
- exit 1
+ exit $E_PKGFILE
elif [ ! "$release" ]; then
error "Variable 'release' not specified in $PKGMK_PKGFILE."
- exit 1
+ exit $E_PKGFILE
elif [ "`type -t build`" != "function" ]; then
error "Function 'build' not specified in $PKGMK_PKGFILE."
- exit 1
+ exit $E_PKGFILE
fi
}

check_directory() {
if [ ! -d $1 ]; then
error "Directory '$1' does not exist."
- exit 1
+ exit $E_DIR_PERM
elif [ ! -w $1 ]; then
error "Directory '$1' not writable."
- exit 1
+ exit $E_DIR_PERM
elif [ ! -x $1 ] || [ ! -r $1 ]; then
error "Directory '$1' not readable."
- exit 1
+ exit $E_DIR_PERM
fi
}

@@ -87,7 +99,7 @@ download_file() {

if [ ! "`type -p wget`" ]; then
error "Command 'wget' not found."
- exit 1
+ exit $E_GENERAL
fi

LOCAL_FILENAME=`get_filename $1`
@@ -129,7 +141,7 @@ download_file() {

if [ $error != 0 ]; then
error "Downloading '$1' failed."
- exit 1
+ exit $E_DOWNLOAD
fi

mv -f "$LOCAL_FILENAME_PARTIAL" "$LOCAL_FILENAME"
@@ -143,13 +155,13 @@ download_source() {
if [ ! -e $LOCAL_FILENAME ]; then
if [ "$LOCAL_FILENAME" = "$FILE" ]; then
error "Source file '$LOCAL_FILENAME' not found (can not be downloaded, URL not specified)."
- exit 1
+ exit $E_DOWNLOAD
else
if [ "$PKGMK_DOWNLOAD" = "yes" ]; then
download_file $FILE
else
error "Source file '$LOCAL_FILENAME' not found (use option -d to download)."
- exit 1
+ exit $E_DOWNLOAD
fi
fi
fi
@@ -177,7 +189,7 @@ unpack_source() {
rm -rf $PKGMK_WORK_DIR
fi
error "Building '$TARGET' failed."
- exit 1
+ exit $E_UNPACK
fi
done
}
@@ -224,11 +236,11 @@ check_md5sum() {

if [ "$PKGMK_CHECK_MD5SUM" = "yes" ]; then
error "Md5sum not ok."
- exit 1
+ exit $E_MD5
fi

error "Building '$TARGET' failed."
- exit 1
+ exit $E_MD5
fi
else
if [ "$PKGMK_CHECK_MD5SUM" = "yes" ]; then
@@ -236,7 +248,7 @@ check_md5sum() {
rm -rf $PKGMK_WORK_DIR
fi
info "Md5sum not found."
- exit 1
+ exit $E_MD5
fi

warning "Md5sum not found, creating new."
diff --git a/pkgmk.8.in b/pkgmk.8.in
index b9fca26..1b60197 100644
--- a/pkgmk.8.in
+++ b/pkgmk.8.in
@@ -43,6 +43,9 @@ Update footprint and treat last build as successful.
.B "-if, --ignore-footprint"
Build package without checking footprint.
.TP
+.B "-in, --ignore-new"
+Build package, ignore new files in a footprint missmatch.
+.TP
.B "-um, --update-md5sum"
Update md5sum using the current source files.
.TP
diff --git a/pkgmk.conf b/pkgmk.conf
index 07b1cbd..30bdd54 100644
--- a/pkgmk.conf
+++ b/pkgmk.conf
@@ -11,6 +11,7 @@ export CXXFLAGS="-O2 -march=i686 -pipe"
# PKGMK_WORK_DIR="$PWD/work"
# PKGMK_DOWNLOAD="no"
# PKGMK_IGNORE_FOOTPRINT="no"
+# PKGMK_IGNORE_NEW="no"
# PKGMK_NO_STRIP="no"
# PKGMK_WGET_OPTS=""

diff --git a/pkgmk.in b/pkgmk.in
index c7f5432..2a1c027 100755
--- a/pkgmk.in
+++ b/pkgmk.in
@@ -318,9 +318,14 @@ check_footprint() {
sed 's/^+/NEW /g' |
sed 's/^-/MISSING /g' > $FILE.footprint.diff
if [ -s $FILE.footprint.diff ]; then
- error "Footprint mismatch found:"
+ if [ "$PKGMK_IGNORE_NEW" = "yes" ] &&
+ [ -z "$(egrep -l ^MISSING $FILE.footprint.diff)" ] ; then
+ info "New files found:"
+ else
+ error "Footprint mismatch found:"
+ BUILD_SUCCESSFUL="no"
+ fi
cat $FILE.footprint.diff >&2
- BUILD_SUCCESSFUL="no"
fi
else
warning "Footprint not found, creating new."
@@ -514,6 +519,7 @@ print_help() {
echo " -utd, --up-to-date do not build, only check if package is up to date"
echo " -uf, --update-footprint update footprint using result from last build"
echo " -if, --ignore-footprint build package without checking footprint"
+ echo " -in, --ignore-new build package, ignore new files in a footprint missmatch"
echo " -um, --update-md5sum update md5sum"
echo " -im, --ignore-md5sum build package without checking md5sum"
echo " -cm, --check-md5sum do not build, only check md5sum"
@@ -548,6 +554,8 @@ parse_options() {
PKGMK_UPDATE_FOOTPRINT="yes" ;;
-if|--ignore-footprint)
PKGMK_IGNORE_FOOTPRINT="yes" ;;
+ -in|--ignore-new)
+ PKGMK_IGNORE_NEW="yes" ;;
-um|--update-md5sum)
PKGMK_UPDATE_MD5SUM="yes" ;;
-im|--ignore-md5sum)
@@ -690,6 +698,7 @@ PKGMK_EXTRACT_ONLY="no"
PKGMK_UP_TO_DATE="no"
PKGMK_UPDATE_FOOTPRINT="no"
PKGMK_IGNORE_FOOTPRINT="no"
+PKGMK_IGNORE_NEW="no"
PKGMK_FORCE="no"
PKGMK_KEEP_WORK="no"
PKGMK_UPDATE_MD5SUM="no"
_______________________________________________
CRUX mailing list
CRUX@lists.crux.nu
http://lists.crux.nu/mailman/listinfo/crux
 

Thread Tools




All times are GMT. The time now is 10:22 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org