Download your favorite Linux distribution at LQ ISO.
Go Back > Blogs > rainbowsally
User Name


Rate this Entry

make-based package installer/uninstaller update

Posted 04-09-2012 at 12:06 PM by rainbowsally
Updated 04-10-2012 at 09:39 AM by rainbowsally (info update re. ksmserver crash)

[msg updated apr 10, 2012 -rs]
Here's the link to blog with the download.

Meanwhile, here's how my qt4 project is going so far and I'll include the file that turns version 1.0.1 into 1.0.2 below.

make-based qt4

One problem file was libphonon.* (Temporarily moved back to /opt) Required reinstalling phonon packages (to restore the config, probably).
[Need to unpack the phonon packages and see what configs they write.]

Another was a ksmserver crash. Probably because I was installing using KDE which has qt4 dependencies. Using LXDE, Restored from backups, then repeated the install and no prob.

[Apr 10, 2012:
The ksmserver crash was not solved. It crashed when I rebooted. I was able to 'make restore' to get back to a working KDE, however. This indicates that the problem is not a config, but an executable (bin or lib) file which I now have to identify. I'll start by comparing ldd outputs for <dir>/bin/ksmserver and seeing if there are any obvious differences. -rs]

18,429 qt4 files now moved from /opt to /usr
57 files still in /opt

[Apr 10, 2012: Nope. About 76 to go... -rs]

[If you missed it before, this qt4 installation crashed my system like WOW! Part, if not all of the problem had been that the previous make-based system (alpha) fouled up permissions in the installation destination. Now looking for other possible probs.]

The way files are moved using the make-based system is as follows:

  init (the dat files)
  install (to get the backup fileset)
  restore (from backup fileset)
  move files in the TREE
  rename the backup folder
  repeat from [start].
I used 'make set-user-perms' and 'make set-root-perms' to allow me to move the files as my normal user but to install as root.

The check info dir problem is DISMALLY slow in a shell using sed to filter the names when there are like 20,000 file names. This needs to be rewritten in C.

// infodir-check.c - replacement for shell script in ~/bin/src/new-make/mktools

#include <stdio.h>  // printf()
#include <stdlib.h> // getenv()
#include <string.h> // strrchr()

void dbg(){}

char pad[256];
char HERE[256];

void cd(const char* dir)
  setenv("PWD", (char*)get_current_dir_name(), 1);

void cd_dirname(const char* execpath)
  char* p;
  sprintf(pad, execpath);
  p = strrchr(pad, '/');
    *p = 0; // needs some more checks.

void do_check();

int main(int argc, char** argv)
  sprintf(HERE, getenv("PWD"));
  if(argc == 1 || strcmp(argv[1], "working"))
      "Only run this from the makefile as 'make <app>' where <app>\n"
      "is the name of the function minus the 'mktools' prefix.\n"
      "Press ENTER to abort now.\n"
    return 1;
  return 0;

void do_check()
  int found = 0;
  int err = 1;
    FILE* fp = fopen("files.dat", "r");
    if(!fp) break;
    fseek(fp, 0, SEEK_END);
    size_t fsize = ftell(fp);
    fseek(fp, 0, SEEK_SET);
    char* buf = (char*)malloc(fsize+1);
    fread(buf, 1, fsize, fp);
    buf[fsize] = 0;
    if(strstr(buf, "/share/info/dir"))
    err = 0;
    printf("Can't find 'files.dat' file\n");
  else if(found)
    "   \n"
    "   The file share/info/dir exists in your 'files.dat'.  This file \n"
    "   cannot be processed by the current Makefile install function.\n"
    "   Recommend removing or renaming it for manual addition (using \n"
    "   texitools) after installation, or if you know your user has \n"
    "   texitools, you might want to add mk_post -install and -uninstall \n"
    "   functions to add and remove the directory entries correctly.\n"
That executable MUST be in the mktools directory of the files tree so it is copied every time you execute new.make.

You may not notice much of a speed improvement for smaller packages but this speeds up that info dir check quite a bit. Check this out.

$> time mktools/infodir-check-orig working
real    1m 14.451s

$> time mktools/infodir-check-new working
real    0m 0.020s
Almost 4 thousand times faster than the script. Not 4 thousand percent, 4 thousand times.

Posted in Uncategorized
Views 455 Comments 0
« Prev     Main     Next »
Total Comments 0




All times are GMT -5. The time now is 03:59 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration