# Synth profiles and ignoring certain pkgs



## xtaz (Nov 21, 2016)

I have been experimenting to try and make python 3 the default and only use python 2 for the few ports that require it. We all know how difficult this whole farce is to do. I thought one nice way to do it might have been to make two different synth repositories with different make files, one for py3 and one for py2, then I could use pkg to install py2 specific pkgs from the 2nd repository. This does appear to actually work, almost. The problem is when I rebuild either repo it sees the extra packages that have been installed and then it tries to build them itself which fails. So it would do this every time I want to update.

I'm thinking that one way to get around this would be if synth had the ability to mark specific packages as ones to be ignored completely. So I could set one repo to ignore anything installed that starts with py27 and set the other one to ignore anything that starts with py35 for example. I can't see that synth has such a feature though. Is there any possibility of maybe doing such a thing?


----------



## SirDice (Nov 21, 2016)

I'm not sure this is even possible with Synth. With poudriere it's not a problem. I have two setups, a desktop and a server profile. The server profile has X11 turned off. 


```
root@molly:~ # poudriere jail -l
JAILNAME   VERSION          ARCH  METHOD                                    TIMESTAMP           PATH
10-desktop 10.3-RELEASE-p12 amd64 ftp                                       2016-11-05 14:40:49 /usr/local/poudriere/jails/10-desktop
10-server  10.3-RELEASE-p12 amd64 ftp                                       2016-11-05 14:41:52 /usr/local/poudriere/jails/10-server
11-desktop 11.0-STABLE      amd64 url=file:///storage/release/11-stable/ftp 2016-11-05 15:10:53 /usr/local/poudriere/jails/11-desktop
11-server  11.0-STABLE      amd64 url=file:///storage/release/11-stable/ftp 2016-11-05 15:11:45 /usr/local/poudriere/jails/11-server
```

For some machines I need both repositories:

```
Repositories:
  dicelan-desktop: { 
    url             : "file:///usr/local/poudriere/data/packages/11-desktop-default/",
    enabled         : yes,
    priority        : 1
  }
  dicelan-server: { 
    url             : "file:///usr/local/poudriere/data/packages/11-server-default/",
    enabled         : yes,
    priority        : 0
  }
```
Note the different priorities.


----------



## marino (Nov 21, 2016)

brute force:
1. Create two copies of the ports repository (e.g. using a shell script and rsync / cpdup)
2. In each repository, add a "Makefile.local" file in the directory of the ports you want to ignore, e.g with contents "IGNORE= xtaz says so"
3. configure each profile to use the custom ports for each profile.

I'll think if there is a less brute way


----------



## marino (Nov 21, 2016)

SirDice said:


> I'm not sure this is even possible with Synth. With poudriere it's not a problem. I have two setups, a desktop and a server profile. The server profile has X11 turned off..



sure it's possible.
You have two synth profiles that differ in the options directory.
One profile has a certain set of options, the other another.


----------



## marino (Nov 21, 2016)

marino@ said:


> I'll think if there is a less brute way



I could have synth define a variable in make.conf, SYNTHPROFILE, e.g. "SYNTHPROFILE=LiveSystem".
Then you could have a ports directory through svn or git
Then you would add the Makefile.locale something like:

```
.if exists(SYNTHPROFILE) && ${SYNTHPROFILE:MLiveSystem}
IGNORE= exclude python2 stuff
.endif
```

It would require a new release of synth though but it would let you have one ports directory instead of three.


----------



## ASX (Nov 21, 2016)

synth has the ability to use lists of packages, so I guess something like follow could help, may be coupled with a specific synth profile. 

```
synth build list1
synth build list2
```


----------



## xtaz (Nov 21, 2016)

marino@ Trying to get my head about how that would work. I could use that without any kind of synth update couldn't I? I see SYNTHPROFILE is already an environment variable that I can set to pick a profile to use. If I create that config that you suggested and *always* define the SYNTHPROFILE that might work?


----------



## marino (Nov 21, 2016)

no, it requires a synth update.  
Look at any log file, go to the section starting with:

```
--------------------------------------------------
--  /etc/make.conf
--------------------------------------------------
```

That is the generated make.conf the build is using.
SYNTHPROFILE would been defined there.

The environment variable is completely separate; it's what controls synth itself and has nothing to do with building ports.


----------

