WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Chekinstall & installwatch  (Read 10549 times)

Offline vinnie

  • Hero Member
  • *****
  • Posts: 1187
  • HandMace informatic works
Chekinstall & installwatch
« on: March 22, 2011, 04:31:36 AM »
I found this package in the repository and I wanted to try.
I realized right away that checkinstall only works with programs compiled in the classic way (configure make make install)
Then I switched to installwatch but I did not understand how it works, i do this test:
Code: [Select]
installwatch -r=/home/tc/tec mkdir /home/tc/abc2 file is created in /home/tc/tec but are both empty, none of them contains a list of changes in filesystem.

I ask if anyone knows how it operate or if someone can pass me a simple tutorial (i can't able to find untill now).

Thanks

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: Chekinstall & installwatch
« Reply #1 on: March 22, 2011, 06:00:52 AM »
Here is the result I get from this command:

installwatch -r /tmp/1 mkdir -p dir/{1,2,3,4,5,7,8,9}

the logfile /tmp/1/logfile:
Code: [Select]
0 mkdir /home/tc/dir #success
0 mkdir /home/tc/dir/1 #success
-1 mkdir /home/tc/dir #File exists
0 mkdir /home/tc/dir/2 #success
-1 mkdir /home/tc/dir #File exists
0 mkdir /home/tc/dir/3 #success
-1 mkdir /home/tc/dir #File exists
0 mkdir /home/tc/dir/4 #success
-1 mkdir /home/tc/dir #File exists
0 mkdir /home/tc/dir/5 #success
-1 mkdir /home/tc/dir #File exists
0 mkdir /home/tc/dir/7 #success
-1 mkdir /home/tc/dir #File exists
0 mkdir /home/tc/dir/8 #success
-1 mkdir /home/tc/dir #File exists
0 mkdir /home/tc/dir/9 #success


And to make a list of the created files and dirs, this command may help:

cat /tmp/1/logfile | grep "#success" | cut -f3 > filelist

The resulting file list:

Code: [Select]
/home/tc/dir
/home/tc/dir/1
/home/tc/dir/2
/home/tc/dir/3
/home/tc/dir/4
/home/tc/dir/5
/home/tc/dir/7
/home/tc/dir/8
/home/tc/dir/9





Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: Chekinstall & installwatch
« Reply #2 on: March 22, 2011, 06:19:43 AM »
Actually, scratch the last command to make a file list, as here is the output from installing gtk1, attached.  That creates a much more complicated logfile.

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: Chekinstall & installwatch
« Reply #3 on: March 22, 2011, 07:09:32 AM »
Ok, here is a script to run in the same directory as the installwatch log file that will give a file list out of the logfile.  I tested it with gtk1 and the results were the same as the file list when the DESTDIR option is used.  New directories are less useful info, as files are what we are interested in.  It expects the log file to be named logfile, it is taked from checkinstall.  The "newfiles" file is the file list, "modified" contain those modified, mostly duplicates of the newfiles list.

SCRIPT  DEPRECATED.  refer to

http://forum.tinycorelinux.net/index.php?topic=9087.msg49600#new

« Last Edit: March 27, 2011, 05:46:08 PM by Jason W »

Offline vinnie

  • Hero Member
  • *****
  • Posts: 1187
  • HandMace informatic works
Re: Chekinstall & installwatch
« Reply #4 on: March 22, 2011, 07:34:07 AM »
very thanks jason!
Now I have to go but I think that this evening or tomorrow I will try everything you have generously expained!

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: Chekinstall & installwatch
« Reply #5 on: March 22, 2011, 02:13:48 PM »
I had thought of adding a few more lines that would install the files into a temp directory, but figured that would be duplicating what checkinstall already does.  But as we use symlinks for most files, checkinstall fails with error and doesn't install or make a package of gtk1.  Therefore I will add to it to allow the setting of a DESTDIR like variable to result in the files being installed into a temp directory as if DESTDIR was used.  There the package can be split or whatnot.   I will post it in programming and scripting mainly as an exercise, but as DESTDIR is not in every source package it perhaps could be useful.

I have seen some unexpected results where DESTDIR was not completely obeyed and files were installed outside of the DESTDIR location, happened in gnu backgammon once if I recall.  So even when installing into DESTDIR, installwatch can be a way to make sure everything went as expected though exceptions may be rare.

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: Chekinstall & installwatch
« Reply #6 on: March 23, 2011, 02:22:00 PM »
Actually, checkinstall works fine with gtk1 on another box.  Since checkinstall is modified to work with TC anyway, I would rather fix the issues that may exist in the checkinstall package made for TC than to write and maintain a separate implementation.



Offline vinnie

  • Hero Member
  • *****
  • Posts: 1187
  • HandMace informatic works
Re: Chekinstall & installwatch
« Reply #7 on: March 23, 2011, 10:41:29 PM »
I have 3 problem (I use watchinstall in the package you've created checkinstall-tc)

1) -r /dir must point to a directory that already exists or completely omit it creates a randomly named directory in tmp
Code: [Select]
tc@box:~$ installwatch -r /tmp/1 mkdir -p dir/{1,2,3,4,5,7,8,9}
The root directory is mandatory .
...

2)mkdir-p dir /{1,2,3,4,5,7,8,9} creates a folder with name "1.2.3.4,5,6,7,8,9" and not ninesubdirectory of  . /dir/
Code: [Select]
tc@box:~$ installwatch mkdir -p dir/{1,2,3,4,5,7,8,9}
INFO : Using a default root directory : /tmp/tmp.llmbEU
tc@box:~$ ls ./dir/
{1,2,3,4,5,7,8,9}/

3)the two files created by installwatch remain empty
Code: [Select]
tc@box:~$ cat /tmp/tmp.llmbEU/dbgfile
tc@box:~$ cat /tmp/tmp.llmbEU/logfile
tc@box:~$

What am I doing wrong?
« Last Edit: March 23, 2011, 10:44:16 PM by vinnie »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10957
Re: Chekinstall & installwatch
« Reply #8 on: March 24, 2011, 02:18:23 AM »
ash doesn't do 2), that's a bashism.
The only barriers that can stop you are the ones you create yourself.

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: Chekinstall & installwatch
« Reply #9 on: March 24, 2011, 02:25:27 AM »
Correct, I used bash to keep the exercise simple, so #!/bin/bash should be used as shebang.






Offline vinnie

  • Hero Member
  • *****
  • Posts: 1187
  • HandMace informatic works
Re: Chekinstall & installwatch
« Reply #10 on: March 24, 2011, 02:35:47 AM »
uhm, bash is a dependency of chekinstall, so I installed it, I need to launch anything in the terminal before to use bash?

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10957
Re: Chekinstall & installwatch
« Reply #11 on: March 24, 2011, 02:37:42 AM »
The default shell stays ash even after installing other shells. Launch bash specifically ("bash").
The only barriers that can stop you are the ones you create yourself.

Offline vinnie

  • Hero Member
  • *****
  • Posts: 1187
  • HandMace informatic works
Re: Chekinstall & installwatch
« Reply #12 on: March 24, 2011, 02:49:34 AM »
Code: [Select]
tc@box:~$ bash
tc@box:~$
tc@box:~$ installwatch  mkdir -p dir/{1,2,3,4,5,7,8,9}
INFO : Using a default root directory : /tmp/tmp.vobOdO
tc@box:~$
tc@box:~$ ls ./dir/
1/ 2/ 3/ 4/ 5/ 7/ 8/ 9/
tc@box:~$
tc@box:~$ cat /tmp/tmp.vobOdO/dbgfile
tc@box:~$ cat /tmp/tmp.vobOdO/logfile
tc@box:~$

and then the logs are still empty

I tried also with a vanilla tc  3.6.1 on virtualbox and the result is identical, is not my tc box


Offline vinnie

  • Hero Member
  • *****
  • Posts: 1187
  • HandMace informatic works
Re: Chekinstall & installwatch
« Reply #13 on: March 24, 2011, 07:20:30 AM »
Jason, which version you use of tinycore?

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: Chekinstall & installwatch
« Reply #14 on: March 24, 2011, 08:30:20 AM »
I have a couple of them going, 3.5 is one of them.   That command results in logfile entries here, I don't know what may be causing it not to in your case.

I am still interested in a simple parsing command to create a file list out of the installwatch log, and I will perhaps spend time with it later when I have opportunity as it is handy in cases that one does not want to go through the checkinstall process. 
« Last Edit: March 24, 2011, 08:34:34 AM by Jason W »