Creating a test package

In order to test urpkg's feature, we are going to create a test package, with some files and an installation command that will try everything it can to mess up with the system. We will then install this package using urpkg, play a little bit with it, and finally uninstall it.

Creating the destination directories

We will create two destination directories. One where the program will be allowed to be installed, and one where it should not write any files. We will create those directories in /usr/urpkg-test, or any other directory you wish (just be sure that it is not listed in the EXCLUDE variable of the find command). We will assume /usr/urpkg-test/ has been chosen.

    $ cd /usr
    $ sudo mkdir urpkg-test
    $ cd urpkg-test
    $ sudo mkdir allowed
    $ sudo mkdir restricted
  

Now we put some files in the two directories. Those files should not be overwritten by our test package.

    $ sudo touch allowed/{file1,file2}
    $ sudo touch restricted/{file1,file2}
  

Creating the source files

Let's name our package foo, and create some files in it.

    $ sudo mkdir foo
    $ sudo touch foo/{foo1,file2}
    $ cd foo
  

Let's say that foo1 is specific to the package foo, while file2 is a more recent version of allowed/file2. So we would like to overwrite allowed/file2 with foo/file2 . The installation command will be given to urpkg in the next chapter.