OSCommerce Contribution Compare

OSCommerce Contribution Compare

11
Basic UserBasic User
11

    Jan 08, 2007#1

    Noobish question...

    A) I have a base file set of OSCommerce 060817, say. And I want to add in a new payment module (some hacks), one time, and generate some kind of script that will apply those same hacks to a future version or installation of OSCommerce. Is this possible?

    The PDF file with the hack instructions is 28 pages, so it takes a few hours.

    I have the hacked version saved into a separate folder, and they are *nearly* identical...

    When I do the folder compare, I think I need to select:
    -Just Differences
    -Recursive compare

    What can I do from there to save/dump/export a patch set of some kind that I can apply to future versions?

    I see all kinds of MERGE options, but I think I need a DIFF set first, so that I can MERGE it later, for future installations.

    Ideally, this would consist of some kind of file by file merge, so that as the base application improves, I get to keep those benefits, and just push in the enhancements.

    B) If this set of hacks was supposed to have actually been applied after another set (the base payment module), does this diff set still have value?

    Specifically, I was supposed to apply the base payment module, then the enhanced payment module, but I skipped a step, applying the enhanced directly. Is there a patching mechanism that can apply the same patch set to OSC+Base module? I am thinking that the logic is like "Plus or minus 100 lines from line X, replace FOO with BAR, and insert RE".

    Is there a simple tutorial on this subject area, especially specific to UC? Dare I ask if there might be a better tool?

    Thanks,
    Ken

      Jan 09, 2007#2

      "
      Hello Ken,

      Thanks for your message. Sorry, I'm not aware of an easy way to do
      what
      you have described. If you do a Folder Compare in UltraCompare you can
      create a Result file that would show the differences between the
      compared directories, but this wouldn't create a "patch set" that you
      could use to create the modified folders in the future.
      Thanks, Troy
      "

      What can I do? I have the printed report, but its 1MB in size.

      I am still trying to understand how to use Ultra Compare to advantage, if it doesn't do what I am asking.

      I guess that *real* programmers have to examine every found diff and evaluate whether to take the first version, the second, or some merge of the two, but that's not what is needed in this scenario.

      Where do I put in a Feature Request?

      Are there any other GUI programs that do what I am after?

      I don't think I'm being stupid here....I can't just take my patched set of files and use it to overwrite the same files in the next OSCommerce release, because I would lose the fixes in that version....I think that I really do need some kind of intelligent merge.

      Thanks,
      Ken

      79
      Advanced UserAdvanced User
      79

        Jan 09, 2007#3

        You may be able to use the diff utility from the GNU toolset (Win32 version here: http://unxutils.sourceforge.net/). However, diff only works with text files, so I'm not sure it'll work for PDFs.

        Docs: http://www.gnu.org/software/diffutils/manual/diff.html

        Here are some pointers to binary diff utilities that I have never used so cannot say how well they work:

        http://sites.inka.de/tesla/f_others.html#bsdiff

        http://sourceforge.net/projects/jojodiff/

        11
        Basic UserBasic User
        11

          Jan 09, 2007#4

          Yeah, I was thinking diff, but most of my hosting, I don't have command line access...hmmm....maybe I could actually use cron to feed in the diff command....

          Anyway, the SourceForge project seems to have no released files, but this did remind me that there was a product called WinDiff at one time...

          From Google, I found http://www.wincvs.org/ which looks good, and there
          and there are 6 different merge tools, at least two of which appear to be Open Source.

          I still wish UE/UC did diffs and merges, but I do notice that many Compare tools don't do merge, so where UC is seems a reasonable place to stop.

          Anyway, it appears that the latest WinMerge.org claims this feature:
          -Creating patch file from multiple files (selected in folder compare)

          I will try to report back my findings...

          Thanks,
          K

          79
          Advanced UserAdvanced User
          79

            Jan 10, 2007#5

            kenlyle wrote:but most of my hosting, I don't have command line access...
            I'm not sure I understand; regardless of what interface you have on the host, if you're running a windows program it doesn't matter whether or not it's command-line or GUI. Either one needs to be able to access the files on the host, but that's not a limitation of the interface.

            Maybe what you mean is that the diff program needs to be able to access files using FTP...

            If that's the issue, you might be able to solve it using NetDrive (maps an FTP server to a drive letter): http://www.engadget.com/2005/10/25/how- ... tp-server/

            Once again, this is not something I've had a need for, so I can't say how well it works.

            Or have a batch file use command-line ftp to copy the file locally, produce the diff then delete the local temp file.

            11
            Basic UserBasic User
            11

              Jan 10, 2007#6

              I just meant that I can't run the native diff command on the two sets of file, as they are, in place, on the server, because I can't get to a command prompt.

              FTP is easy, I use SmartFTP, mostly.

              I've produced a patch file with WinMerge, but can't find a way to apply it.

              The format doesn't appear to be typical diff/compare output, for example:

              *** admin/includes/boxes/catalog.php Mon Mar 27 12:49:35 2006
              --- admin/includes/boxes/catalog.php Sun Jan 07 17:59:45 2007
              ***************
              *** 21,33 ****
              'link' => tep_href_link(FILENAME_CATEGORIES, 'selected_box=catalog'));

              if ($selected_box == 'catalog') {
              ! $contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS . '</a><br>' .
              ! '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES . '</a><br>' .
              ! '<a href="' . tep_href_link(FILENAME_MANUFACTURERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_MANUFACTURERS . '</a><br>' .
              ! '<a href="' . tep_href_link(FILENAME_REVIEWS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_REVIEWS . '</a><br>' .
              ! '<a href="' . tep_href_link(FILENAME_SPECIALS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_SPECIALS . '</a><br>' .
              ! '<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a>');
              ! }

              $box = new box;
              echo $box->menuBox($heading, $contents);
              --- 21,58 ----
              'link' => tep_href_link(FILENAME_CATEGORIES, 'selected_box=catalog'));

              if ($selected_box == 'catalog') {
              !
              ! $contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, '', 'NONSSL') . '"
              !
              ! class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS . '</a><br>' .
              !
              ! '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, '', 'NONSSL') . '"
              !
              ! class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES . '</a><br>' .
              !
              ! '<a href="' . tep_href_link(FILENAME_MANUFACTURERS, '', 'NONSSL') . '"
              !
              ! class="menuBoxContentLink">' . BOX_CATALOG_MANUFACTURERS . '</a><br>' .
              !
              ! '<a href="' . tep_href_link(FILENAME_REVIEWS, '', 'NONSSL') . '"
              !
              ! class="menuBoxContentLink">' . BOX_CATALOG_REVIEWS . '</a><br>' .
              !
              ! '<a href="' . tep_href_link(FILENAME_SPECIALS, '', 'NONSSL') . '"
              !
              ! class="menuBoxContentLink">' . BOX_CATALOG_SPECIALS . '</a><br>' .
              !
              ! '<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '"
              !
              ! class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a><br>'.
              !
              ! '<a href="' .
              !
              ! tep_href_link(FILENAME_RECURRING_SCHEME, '', 'NONSSL') . '" class="menuBoxContentLink">' .
              !
              ! BOX_CATALOG_RECURRING_SCHEME . '</a>');
              !
              ! }

              $box = new box;
              echo $box->menuBox($heading, $contents);
              ==============================================

              I have only investigated some 2 of the formats in which WinMerge will produce the diff, and haven't found one that includes BOTH the filenames AND the diff commands, like r21,58-c21,33 or whatever. The first didn't include the filenames, so would have had to have tested every patch against every file when applied, which would be ridiculous, and this one is close, but doesn't seem quite right.

              I am going to keep working on this, but as a background task.

              K

              79
              Advanced UserAdvanced User
              79

                Jan 11, 2007#7

                kenlyle wrote:I just meant that I can't run the native diff command on the two sets of file, as they are, in place, on the server, because I can't get to a command prompt.
                I'm probably just dense, but I still don't understand... you mean that you want to run the diff/merge/whatever program on a server, but you can't run command-line programs on the server, only GUI programs?

                And you can run arbitrary GUI programs?

                If you can run any GUI program, then why can't you run a console program? Is this a security issue?

                In case this helps (but I suspect it won't because I'm off the mark on the problem), there are several GUI programs that encapsulate Windows console-mode programs:

                Console2: http://sourceforge.net/projects/console/

                JPSoft's TakeCommand or TCI: http://www.jpsoft.com

                PromptPal: http://www.promptpal.com/

                11
                Basic UserBasic User
                11

                  Jan 11, 2007#8

                  mwb1100 wrote: I'm probably just dense, but I still don't understand... you mean that you want to run the diff/merge/whatever program on a server, but you can't run command-line programs on the server, only GUI programs?
                  No, is that even possible? Maybe If I had X-Window access, maybe?

                  I don't have SSH access to the server. I can't get to a command line. This is standard in shared hosting. I can't run text mode, GUI, or semi-GUI, or any arbitrary programs. The only way that I can enter a command line seems to be through the cron interface in cPanel.

                  OBVIOUSLY, it would be most efficient to diff the files ON THE SERVER where I can stamp out new sets of OSCommerce with Fantastico, and where I have my hacked version running.

                  But I can't.

                  So I have to pull them down to my Windows PC and run a Windows program.

                  Thanks for that other stuff, but I am not seeing how it really helps. I am not afraid of typing in diff commands if necessary, but the results seem to read much better in a GUI, that it seems logical to start there.

                  K