List Info

Thread: Classifying files by suffix




Classifying files by suffix
user name
2006-11-24 15:30:48
Ah there's the bug. I've been looking for this bug (a bit
idly,
PLD the first distro I know of to try to use these
dependencies)
for a couple of months.

A patch from FreeBSD-PLD made me finally notice the
cut-n-paste errors.

Thanks for the patch!

73 de Jeff
_______________________________________________
Rpm-devel mailing list
Rpm-devellists.dulug.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/rpm-devel
Classifying files by suffix
user name
2006-11-24 16:56:53
On Fri, November 24, 2006 10:30 am, Jeff Johnson wrote:
> Ah there's the bug. I've been looking for this bug (a
bit idly,
> PLD the first distro I know of to try to use these
dependencies)
> for a couple of months.

Well, it's more a result of not factoring this code out in a
function:

- else if (slen >= sizeof(".jar") &&
!strcmp(s+slen-(sizeof(".jar")-1),
".pm"))
+ else if (slen >= sizeof(".jar") &&
!strcmp(s+slen-(sizeof(".jar")-1),
".jar"))

how about just:

  else if (file_has_ext(s, ".jar"))

Or some such.

-- 
Dimi Paun <dimilattica.com>
Lattica, Inc.


_______________________________________________
Rpm-devel mailing list
Rpm-devellists.dulug.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/rpm-devel
Classifying files by suffix
user name
2006-11-25 01:23:41
On 11/24/06, Dimi Paun <dimilattica.com> wrote:
>
> On Fri, November 24, 2006 10:30 am, Jeff Johnson wrote:
> > Ah there's the bug. I've been looking for this bug
(a bit idly,
> > PLD the first distro I know of to try to use these
dependencies)
> > for a couple of months.
>
> Well, it's more a result of not factoring this code out
in a function:
>
> - else if (slen >= sizeof(".jar")
&& !strcmp(s+slen-(sizeof(".jar")-1),
> ".pm"))
> + else if (slen >= sizeof(".jar")
&& !strcmp(s+slen-(sizeof(".jar")-1),
> ".jar"))
>
> how about just:
>
>   else if (file_has_ext(s, ".jar"))
>
> Or some such.

Yah, "some such" is _suffix hacked in almost
immediately afterwards.

FWIW, classifying files by suffix is intrinsically broken
and stupid.
I write ugly code when I'm trying to stay in denial.

73 de Jeff
_______________________________________________
Rpm-devel mailing list
Rpm-devellists.dulug.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/rpm-devel
Classifying files by suffix
user name
2006-11-25 01:46:20
On Fri, 2006-11-24 at 20:23 -0500, Jeff Johnson wrote:
> On 11/24/06, Dimi Paun <dimilattica.com> wrote:
> >
> > On Fri, November 24, 2006 10:30 am, Jeff Johnson
wrote:
> > > Ah there's the bug. I've been looking for
this bug (a bit idly,
> > > PLD the first distro I know of to try to use
these dependencies)
> > > for a couple of months.
> >
> > Well, it's more a result of not factoring this
code out in a function:
> >
> > - else if (slen >= sizeof(".jar")
&& !strcmp(s+slen-(sizeof(".jar")-1),
> > ".pm"))
> > + else if (slen >= sizeof(".jar")
&& !strcmp(s+slen-(sizeof(".jar")-1),
> > ".jar"))
> >
> > how about just:
> >
> >   else if (file_has_ext(s, ".jar"))
> >
> > Or some such.
> 
> Yah, "some such" is _suffix hacked in almost
immediately afterwards.
> 
> FWIW, classifying files by suffix is intrinsically
broken and stupid.

But was necessary because of bug in libmagic. BTW fixed now
by arekm

http://cvs.pld-linux.org/cgi-bin/cvsweb
/SOURCES/file-offset.patch?rev=1.2

Regards
    Tomek



_______________________________________________
Rpm-devel mailing list
Rpm-devellists.dulug.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/rpm-devel
Classifying files by suffix
user name
2006-11-25 02:29:55
On Fri, November 24, 2006 8:23 pm, Jeff Johnson wrote:
> FWIW, classifying files by suffix is intrinsically
broken and stupid.

Maybe, but it's besides the point. For example, .jar files
are
.zip files, the only differentiating factor being the
extension.

> I write ugly code when I'm trying to stay in denial.

Fair enough 

-- 
Dimi Paun <dimilattica.com>
Lattica, Inc.


_______________________________________________
Rpm-devel mailing list
Rpm-devellists.dulug.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/rpm-devel
Classifying files by suffix
user name
2006-11-25 12:07:49
On 11/24/06, Dimi Paun <dimilattica.com> wrote:
>
> On Fri, November 24, 2006 8:23 pm, Jeff Johnson wrote:
> > FWIW, classifying files by suffix is intrinsically
broken and stupid.
>
> Maybe, but it's besides the point. For example, .jar
files are
> .zip files, the only differentiating factor being the
extension.
>

And the contents.

You're totally missing the point of classifying .jar files.

73 de Jeff
_______________________________________________
Rpm-devel mailing list
Rpm-devellists.dulug.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/rpm-devel
Classifying files by suffix
user name
2006-11-30 23:42:35
On Saturday 25 November 2006 02:46, Tomasz Trojanowski
wrote:

> But was necessary because of bug in libmagic. BTW fixed
now by arekm
>
> http://cvs.pld-linux.org/cgi-bin/cvsweb
/SOURCES/file-offset.patch?rev=1.2

Upstream fix will be close to:
http://cvs.pld-linux.org/cgi-bin/cvsweb
/SOURCES/file-offset.patch?rev=1.3
(it's taken from not yet released new version of file
package)

> Regards
>     Tomek

-- 
Arkadiusz Mi¶kiewicz        PLD/Linux Team
arekm / maven.pl            http://ftp.pld-linux.org/
_______________________________________________
Rpm-devel mailing list
Rpm-devellists.dulug.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/rpm-devel
[1-7]

about | contact  Other archives ( Real Estate discussion Medical topics )