great work Dan, just like to say that first :D

My take on this is as follows

number one I think it needs to be an error or a warning with blinking lights :) number two patch file checking when using Patch: is easy and done, PatchScript checking as you say is a little more tough, we need to parse it and I think search for %a, no matter what we need to use %a to call patch. So we parse PatchScript for /sw then check for %a to find the patch file and parse it. I'm gonna have a look at this unless you get to it first.

I'd like to say with all this new work recently Fink sure is moving ahead and looking good. Thanks Dan.
---
TS
http://southofheaven.org
Chaos is the beginning and end, try dealing with the rest.

On 21-Dec-03, at 11:15 PM, Daniel Macks wrote:

Update of /cvsroot/fink/fink/perlmod/Fink
In directory sc8-pr-cvs1:/tmp/cvs-serv5583

Modified Files:
        ChangeLog Validation.pm
Log Message:
Warn on hardcoded /sw in .patch in Patch (not in PatchScript).

Index: ChangeLog
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/ChangeLog,v
retrieving revision 1.477
retrieving revision 1.478
diff -u -d -r1.477 -r1.478
--- ChangeLog   22 Dec 2003 02:06:28 -0000      1.477
+++ ChangeLog   22 Dec 2003 06:15:54 -0000      1.478
@@ -1,3 +1,8 @@
+2003-12-22  Daniel Macks <[EMAIL PROTECTED]>
+
+       * Validation.pm: Check for hardcoded /sw in patch file (as loaded
+       by Patch, not as by PatchScript).
+
 2003-12-21  Daniel Macks <[EMAIL PROTECTED]>

* Services.pm: Gave prompt_selection_new more flexible default-

Index: Validation.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/Validation.pm,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -d -r1.79 -r1.80
--- Validation.pm       19 Dec 2003 12:33:41 -0000      1.79
+++ Validation.pm       22 Dec 2003 06:15:54 -0000      1.80
@@ -254,7 +254,7 @@

# Should check/verifies the following in .info files:
# + the filename matches %f.info
-# + patch file is present
+# + patch file (from Patch, not PatchScript) is present
# + all required fields are present
# + warn if obsolete fields are encountered
# + warn about missing Description/Maintainer/License fields
@@ -264,7 +264,8 @@
# + warn if fields seem to contain the package name/version, and suggest %n/%v should be used
# (excluded from this are fields like Description, Homepage etc.)
# + warn if unknown fields are encountered
-# + warn if /sw is hardcoded in the script or set fields
+# + warn if /sw is hardcoded in the script or set fields or patch file
+# (from Patch, not PatchScript)
# + correspondence between source* and source*-md5 fields
# + if type is bundle/nosource - warn about usage of "Source" etc.
#
@@ -272,6 +273,7 @@
# - better validation of splitoffs
# - validate dependencies, e.g. "foo (> 1.0-1)" should generate an error since
# it uses ">" instead of ">>".
+# - checks against patch files used in PatchScript (not just Patch)
# - ... other things, make suggestions ;)
#
sub validate_info_file {
@@ -598,6 +600,11 @@
}
elsif ($patch_file_content =~ m/\r/s) {
print "Error: Patch file has Mac line endings. ($value)\n";
+ $looks_good = 0;
+ }
+ # Check for hardcoded /sw.
+ if ($patch_file_content =~ /\/sw([\s\/]|$)/) {
+ print "Warning: Patch file appears to contain a hardcoded /sw. ($value)\n";
$looks_good = 0;
}
}




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Fink-commits mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-commits

Attachment: PGP.sig
Description: This is a digitally signed message part



Reply via email to