Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [higgins-dev] 3rd party dependency download problem in autobuild

I think you misunderstood the proposed fix. The fix is not to strip query params from URL, but to strip it from the filename variable that gets file name from URL. We hope we can get all jars from direct URLs but may not be the case always.

        public String extractFileNameFromURL() {
                String fileName = locationURL
                                .substring(locationURL.lastIndexOf("/") != -1 ? locationURL
                                                .lastIndexOf("/") + 1 : 0);


                //------change start-------------
                if(fileName.indexOf("?") != -1) {
                        fileName = fileName.replaceFirst("\\?.*$", "");
                }
                //------change end--------------


                return fileName;
        }

extractFileNameFromURL() method is used in other places to see whether the lib id is equal to the file name from URL. If not the script assumes the file from URL is a zip and tries to extract the zip which is wrong in cases of URLs with query params.


Thanks,
Jeesmon

-----Original Message-----
From: higgins-dev-bounces@xxxxxxxxxxx [mailto:higgins-dev-bounces@xxxxxxxxxxx] On Behalf Of Peter Kimlach
Sent: Wednesday, October 17, 2007 5:51 AM
To: Higgins (Trust Framework) Project developer discussions
Subject: Re: [higgins-dev] 3rd party dependency download problem in autobuild

1. The URL should be direct to resource. Something like this
http://server/path/package_name.<jar|zip|gz|bz>
    To cut query params is good idea but what if server return error
message instead required         resource? So much better to use direct
links without query params instead of cut them.
2. Today I'll add capability to work with *.tgz packages.



Jeesmon Jacob wrote:
>
> Hi,
>
>
>
> I noticed couple of autobuild issues.
>
>
>
> 1.       If the 3^rd party lib URL contains query params, autobuild
> fails to download the jar. One example from resourceLocation.xml is,
>
>
>
> <lib id="openxdas-0.5.257.jar">
>
> <url>
>
> http://prdownloads.sourceforge.net/openxdas/openxdas-0.5.257.jar?download
>
> </url>
>
> </lib>
>
>
>
> Autobuid treats  downloaded file as zip file if the ending of URL is
> not same as the lib id.
>
>
>
> 2.       .tgz extension is missing when determining the zip type.
> There is one entry in resourceLocation.xml with .tgz extension
>
>
>
> Attaching the patches to fix the above issues. Please apply the
> patches if the fix is correct.
>
>
>
> Thanks,
>
> Jeesmon
>
>
>
>
>
>
>
> ------------------------------------------------------------------------
>
> ### Eclipse Workspace Patch 1.0
> #P org.eclipse.higgins.auto
> Index: src/org/eclipse/higgins/auto/filefilters/HigginsZipFilter.java
> ===================================================================
> RCS file: /cvsroot/technology/org.eclipse.higgins/builds/org.eclipse.higgins.auto/src/org/eclipse/higgins/auto/filefilters/HigginsZipFilter.java,v
> retrieving revision 1.1
> diff -u -r1.1 HigginsZipFilter.java
> --- src/org/eclipse/higgins/auto/filefilters/HigginsZipFilter.java    3 Sep 2007 15:23:46 -0000       1.1
> +++ src/org/eclipse/higgins/auto/filefilters/HigginsZipFilter.java    17 Oct 2007 02:03:03 -0000
> @@ -10,7 +10,7 @@
>               return pathname.isFile()
>                               && (pathname.getName().endsWith(".zip")
>                                               || pathname.getName().endsWith(".gz") || pathname
> -                                             .getName().endsWith(".bz2"));
> +                                             .getName().endsWith(".bz2") || pathname.getName().endsWith(".tgz"));
>       }
>
>  }
>
> ------------------------------------------------------------------------
>
> ### Eclipse Workspace Patch 1.0
> #P org.eclipse.higgins.auto
> Index: runtime/autoBuild.xml
> ===================================================================
> RCS file: /cvsroot/technology/org.eclipse.higgins/builds/org.eclipse.higgins.auto/runtime/autoBuild.xml,v
> retrieving revision 1.76
> diff -u -r1.76 autoBuild.xml
> --- runtime/autoBuild.xml     15 Oct 2007 15:17:38 -0000      1.76
> +++ runtime/autoBuild.xml     17 Oct 2007 02:05:59 -0000
> @@ -573,7 +573,7 @@
>                                               untarPackTask.setSrc(srcFile);
>                                               untarPackTask.setDest(destDir);
>                                               untarPackTask.setOverwrite(false);
> -                                             if(srcFile.getName().endsWith(".gz")){
> +                                             if(srcFile.getName().endsWith(".gz") || srcFile.getName().endsWith(".tgz")){
>                                                       cm.setValue("gzip");
>                                               } else {
>                                                       cm.setValue("bzip2");
>
> ------------------------------------------------------------------------
>
> ### Eclipse Workspace Patch 1.0
> #P org.eclipse.higgins.auto
> Index: src/org/eclipse/higgins/auto/resource/LibPackege.java
> ===================================================================
> RCS file: /cvsroot/technology/org.eclipse.higgins/builds/org.eclipse.higgins.auto/src/org/eclipse/higgins/auto/resource/LibPackege.java,v
> retrieving revision 1.1
> diff -u -r1.1 LibPackege.java
> --- src/org/eclipse/higgins/auto/resource/LibPackege.java     3 Sep 2007 15:23:47 -0000       1.1
> +++ src/org/eclipse/higgins/auto/resource/LibPackege.java     17 Oct 2007 02:04:42 -0000
> @@ -35,6 +35,9 @@
>               String fileName = locationURL
>                               .substring(locationURL.lastIndexOf("/") != -1 ? locationURL
>                                               .lastIndexOf("/") + 1 : 0);
> +             if(fileName.indexOf("?") != -1) {
> +                     fileName = fileName.replaceFirst("\\?.*$", "");
> +             }
>               return fileName;
>       }
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> higgins-dev mailing list
> higgins-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/higgins-dev
>

_______________________________________________
higgins-dev mailing list
higgins-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/higgins-dev


Back to the top