<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>18119</bug_id>
          
          <creation_ts>2008-12-06 05:58:38 +0300</creation_ts>
          <short_desc>symlinks for managing sources.list.d/ (on/off)</short_desc>
          <delta_ts>2008-12-06 19:43:20 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>apt-conf-sisyphus</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ivan Zakharyaschev">imz</reporter>
          <assigned_to name="Gleb F-Malinovskiy">glebfm</assigned_to>
          <cc>glebfm</cc>
    
    <cc>iv</cc>
    
    <cc>ldv</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>82326</commentid>
    <comment_count>0</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2008-12-06 05:58:38 +0300</bug_when>
    <thetext>apt-conf-sisyphus-5.0-alt2

I suggest to manage the on/off status of mirrors in /etc/apt/sources.list.d/ with symlinks, as it is done in apache2-common-2.2.5-alt1:

$ l /etc/httpd2/conf/mods-enabled/
total 1
drwxr-xr-x  2 root root 448 Ноя 29 22:04 ./
lrwxrwxrwx  1 root root  26 Ноя 29 22:04 cgi.load -&gt; ../mods-available/cgi.load
drwxr-xr-x 16 root root 592 Ноя 29 20:55 ../
lrwxrwxrwx  1 root root  31 Авг 23  2007 setenvif.conf -&gt; ../mods-available/setenvif.conf
lrwxrwxrwx  1 root root  31 Авг 23  2007 setenvif.load -&gt; ../mods-available/setenvif.load
lrwxrwxrwx  1 root root  28 Июл 14  2007 alias.load -&gt; ../mods-available/alias.load
lrwxrwxrwx  1 root root  33 Июл 14  2007 authz_host.load -&gt; ../mods-available/authz_host.load
lrwxrwxrwx  1 root root  32 Июл 14  2007 autoindex.load -&gt; ../mods-available/autoindex.load
lrwxrwxrwx  1 root root  26 Июл 14  2007 dir.load -&gt; ../mods-available/dir.load
lrwxrwxrwx  1 root root  30 Июл 14  2007 include.load -&gt; ../mods-available/include.load
lrwxrwxrwx  1 root root  33 Июл 14  2007 log_config.load -&gt; ../mods-available/log_config.load
lrwxrwxrwx  1 root root  28 Июл 14  2007 logio.load -&gt; ../mods-available/logio.load
lrwxrwxrwx  1 root root  27 Июл 14  2007 mime.conf -&gt; ../mods-available/mime.conf
lrwxrwxrwx  1 root root  27 Июл 14  2007 mime.load -&gt; ../mods-available/mime.load
lrwxrwxrwx  1 root root  34 Июл 14  2007 negotiation.load -&gt; ../mods-available/negotiation.load
$ l /etc/httpd2/conf/mods-available/ | head
total 271
drwxr-xr-x 16 root root  592 Ноя 29 20:55 ../
drwxr-xr-x  2 root root 2200 Авг 23  2007 ./
-rw-r--r--  1 root root   66 Авг 19  2007 actions.load
-rw-r--r--  1 root root   62 Авг 19  2007 alias.load
-rw-r--r--  1 root root   60 Авг 19  2007 asis.load
-rw-r--r--  1 root root   72 Авг 19  2007 auth_basic.load
-rw-r--r--  1 root root   74 Авг 19  2007 auth_digest.load
-rw-r--r--  1 root root   72 Авг 19  2007 authn_anon.load
-rw-r--r--  1 root root   70 Авг 19  2007 authn_dbd.load
$ 

W.r.t. apt, that would mean that there is a /etc/apt/available-sources.list.d/ , which contains all the possible mirrors (uncommented), and the one that is actually used is pointed to by a symlink like:

/etc/apt/sources.list.d/alt_ftp.list -&gt; /etc/apt/available-sources.list.d/alt_ftp.list

Doing symlinks is less distressing than commenting/uncommenting.

Also, the symlink-approach can be extended to switch between branches independently of mirror sites. E.g., 

/etc/apt/sources.list.d/alt_ftp.list -&gt; /etc/apt/available-sources.list.d/selected-branch/alt_ftp.list

where

/etc/apt/available-sources.list.d/selected-branch -&gt; /etc/apt/available-sources.list.d/Sisyphus/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82339</commentid>
    <comment_count>1</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2008-12-06 19:37:11 +0300</bug_when>
    <thetext>Even if the second part of the suggestion is not implemented (/etc/apt/available-sources.list.d/selected-branch -&gt; /etc/apt/available-sources.list.d/Sisyphus/), then the suggested approach still gives an advantage of easy switching between branches:

apt-conf-whatever contains all the possible URLs for the selected branch in /etc/apt/available-sources.list.d/* . You choose some of the sites by putting a symlink to /etc/apt/sources.list.d/ , say:

/etc/apt/sources.list.d/alt_ftp.list -&gt; /etc/apt/available-sources.list.d/alt_ftp.list 

. Then switching to another branch is as easy as installing another apt-conf-aBranch package: it will replace the contents of /etc/apt/available-sources.list.d/*, but your symlink /etc/apt/sources.list.d/alt_ftp.list will still be valid and working.

(Compare this one action to the current process for switching to another branch:

1) install another apt-conf-aBranch;
2) merge the new files with your old uncommented ones (inconvenient!).)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82340</commentid>
    <comment_count>2</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2008-12-06 19:43:20 +0300</bug_when>
    <thetext>I&apos;d even prefer this second way of making the switching of branches easier, because it&apos;s simpler and clearer, than the initial suggestion of stacked symlinks.

(In reply to comment #1)
&gt; . Then switching to another branch is as easy as installing another apt-conf-aBranch package: it will replace the contents of
&gt; /etc/apt/available-sources.list.d/*, but your symlink /etc/apt/sources.list.d/alt_ftp.list will still be valid and working.
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>