[Pkg-ocaml-maint-commits] [SCM] mldonkey packaging branch, master, updated. debian/2.9.5-2-80-ga3b1417

Mehdi Dogguy dogguy at pps.jussieu.fr
Sat Mar 14 21:35:55 UTC 2009


The following commit has been merged in the master branch:
commit 973549011392d4b272ab8830f87aeb13aa1ae5fd
Author: Mehdi Dogguy <dogguy at pps.jussieu.fr>
Date:   Sat Mar 14 22:22:29 2009 +0100

    Remove some debconf questions

diff --git a/debian/mldonkey-server.config b/debian/mldonkey-server.config
index 04f47b8..26bde96 100644
--- a/debian/mldonkey-server.config
+++ b/debian/mldonkey-server.config
@@ -9,25 +9,9 @@
 
 CONFIGFILE=/etc/default/mldonkey-server
 if [ -e $CONFIGFILE ]; then
-    MLDONKEY_DIR=/var/lib/mldonkey
-    MLDONKEY_GROUP=mldonkey
-    MLDONKEY_USER=mldonkey
-    MLDONKEY_UMASK=0022
     LAUNCH_AT_STARTUP=
-    MLDONKEY_NICENESS=
-    . $CONFIGFILE || true
-
-    if [ "$MLDONKEY_DIR" != "" ]; then
-        db_set mldonkey-server/mldonkey_dir $MLDONKEY_DIR
-    fi
-
-    if [ "$MLDONKEY_GROUP" != "" ]; then
-        db_set mldonkey-server/mldonkey_group $MLDONKEY_GROUP
-    fi
 
-    if [ "$MLDONKEY_NICENESS" != "" ]; then
-        db_set mldonkey-server/mldonkey_niceness $MLDONKEY_NICENESS
-    fi
+    . $CONFIGFILE || true
 
     if [ "$LAUNCH_AT_STARTUP" != "" ]; then
         if [ "$LAUNCH_AT_STARTUP" = "true" ]; then
@@ -38,17 +22,6 @@ if [ -e $CONFIGFILE ]; then
     fi
 fi
 
-if [ -x /usr/bin/mldonkey_options ] && [ -e $MLDONKEY_DIR/downloads.ini ]; then
-    db_set mldonkey-server/max_hard_upload_rate   `/usr/bin/mldonkey_options -f $MLDONKEY_DIR/downloads.ini -g max_hard_upload_rate`
-    db_set mldonkey-server/max_hard_download_rate `/usr/bin/mldonkey_options -f $MLDONKEY_DIR/downloads.ini -g max_hard_download_rate`
-    # BUG: We should also fetch the default plugin
-fi
-
-#db_version 2.0
-
-db_reset mldonkey-server/reown_file
-db_reset mldonkey-server/mldonkey_move
-
 # If it is the first time we install: set a default hostname
 if [ ! -n "$MLDONKEY_DIR" ] || [ ! -d $MLDONKEY_DIR ] || [ ! -f $MLDONKEY_DIR/downloads.ini ]; then
     client_name=`/bin/hostname`
@@ -61,74 +34,4 @@ db_go
 db_get mldonkey-server/launch_at_startup
 launch_at_startup="$RET"
 
-# Let's begin the conf
-db_input low mldonkey-server/run_as_user || true
-db_go
-
-db_input low mldonkey-server/mldonkey_group || true
-db_go
-
-# Existence and owner test
-if [ -f $MLDONKEY_DIR/downloads.ini ]; then
-    owner=`/usr/bin/stat --format="%U %G" $MLDONKEY_DIR/downloads.ini`
-
-    db_get mldonkey-server/run_as_user
-    new_owner="$RET"
-
-    db_get mldonkey-server/mldonkey_group
-    new_owner="$new_owner $RET"
-
-    if [ "$new_owner" != "$owner" ]; then
-        db_input critical mldonkey-server/reown_file || true
-        db_go
-    fi
-fi
-
-db_input medium mldonkey-server/mldonkey_dir || true
-db_go
-
-db_get mldonkey-server/mldonkey_dir
-NEW_MLDONKEY_DIR="$RET"
-
-if [ "$NEW_MLDONKEY_DIR" != "$MLDONKEY_DIR" ] && [ -f $MLDONKEY_DIR/downloads.ini ]; then
-    db_input medium mldonkey-server/mldonkey_move || true
-    db_go
-fi
-
-db_input low mldonkey-server/mldonkey_niceness || true
-db_go
-
-db_input medium mldonkey-server/max_hard_download_rate || true
-db_go
-
-db_input medium mldonkey-server/max_hard_upload_rate || true
-db_go
-
-#  password="a"
-#  repassword="b"
-#
-#  while [ "$password" != "$repassword" ] ; do
-#
-#    db_input critical mldonkey-server/password || true
-#    db_go
-#
-#    db_get mldonkey-server/password
-#    password="$RET"
-#
-#    db_input critical mldonkey-server/repassword || true
-#    db_go
-#
-#    db_get mldonkey-server/repassword
-#    repassword="$RET"
-#
-#    if [ "$password" != "$repassword" ]; then
-#      db_reset mldonkey-server/false_password
-#      db_input critical mldonkey-server/false_password || true
-#      db_go
-#
-#      db_reset mldonkey-server/password
-#      db_reset mldonkey-server/repassword
-#    fi
-#  done
-
 db_stop
diff --git a/debian/mldonkey-server.postinst b/debian/mldonkey-server.postinst
index 0288d02..f63fb45 100644
--- a/debian/mldonkey-server.postinst
+++ b/debian/mldonkey-server.postinst
@@ -18,37 +18,18 @@ case "$1" in
 
     CONF=/etc/default/mldonkey-server
 
-    ###########################
-    # Handling debconf values #
-    ###########################
+    ##################
+    # Default values #
+    ##################
 
     mldonkey_umask=0022
     umask $mldonkey_umask
 
-    db_get mldonkey-server/run_as_user
-    run_as_user=$RET
-
-    db_get mldonkey-server/mldonkey_group
-    mldonkey_group=$RET
-
-    db_get mldonkey-server/mldonkey_dir
-    new_mldonkey_dir="$RET"
-
-    db_get mldonkey-server/mldonkey_niceness
-    mldonkey_niceness="$RET"
-
+    run_as_user=mldonkey
+    mldonkey_group=mldonkey
+    new_mldonkey_dir="/var/lib/mldonkey"
     client_name=`/bin/hostname`
 
-    db_get mldonkey-server/max_hard_upload_rate
-    max_hard_upload_rate="$RET"
-
-    db_get mldonkey-server/max_hard_download_rate
-    max_hard_download_rate="$RET"
-
-    # db_get mldonkey-server/password
-    # password="$RET"
-    password=""
-
     ###################
     # User management #
     ###################
@@ -76,35 +57,6 @@ case "$1" in
         $DEBUG && echo "done."
     fi
 
-    #########################
-    # Relocation management #
-    #########################
-
-    if [ -e "$CONF" ]; then
-        . "$CONF"
-        if [ -n "$MLDONKEY_DIR" ] && [ -f "$MLDONKEY_DIR/downloads.ini" ]; then
-            db_get mldonkey-server/reown_file
-            if [ "$RET" = "true" ] && ! dpkg-statoverride --list "$MLDONKEY_DIR" >/dev/null; then
-                $DEBUG && echo -n "Reowning file of $MLDONKEY_DIR: "
-                # BUG: should not use chown, should use dpkg-statoverride itself, but the owner is not always
-                # the same. If i use the method suggested in the Debian Policy 10.9.1, i need to dynamically
-                # create a user, but this user should never be changed. The DP method will inject a new rules
-                # in dpkg-statoverride which will made the above test always false for any further
-                # upgrade/configure. With my method, only the user can set dpkg-statoverride rules to stop the
-                # reowning of a file... However i am not sure this is the best method to do so.
-                chown -R $run_as_user:$mldonkey_group "$MLDONKEY_DIR"
-                $DEBUG && echo "done."
-            fi
-
-            db_get mldonkey-server/mldonkey_move
-            if [ "$RET" = "true" ] && [ "$new_mldonkey_dir" != "$MLDONKEY_DIR" ]; then
-                $DEBUG && echo -n "Moving file of $MLDONKEY_DIR to $new_mldonkey_dir: "
-                mv "--target-directory=$new_mldonkey_dir" "$MLDONKEY_DIR/*"
-                $DEBUG && echo "done."
-            fi
-        fi
-    fi
-
     #################
     # Downloads.ini #
     #################
@@ -120,12 +72,10 @@ case "$1" in
     fi
 
     $DEBUG && echo -n "Writing new values to $new_mldonkey_dir/downloads.ini: "
-    mldonkey_options -f "$new_mldonkey_dir/downloads.ini" <<EOF
+    cat > "$new_mldonkey_dir/downloads.ini" <<EOF
 run_as_useruid=$run_as_useruid
 run_as_user="$run_as_user"
 client_name="$client_name"
-max_hard_upload_rate=$max_hard_upload_rate
-max_hard_download_rate=$max_hard_download_rate
 EOF
     $DEBUG && echo "done."
 
@@ -137,25 +87,15 @@ EOF
 
     if [ -e "$new_mldonkey_dir/files.ini" ] \
         && [ ! -e "$new_mldonkey_dir/files.ini.fasttrack" ] \
-        && mldonkey_files --test Fasttrack -q -f0 "$new_mldonkey_dir/files.ini"; then
+        && /usr/lib/mldonkey/mldonkey_files --test Fasttrack -q -f0 "$new_mldonkey_dir/files.ini"; then
         echo "Correction of the Fasttrack problem (see /usr/share/doc/mldonkey-server/README.Debian)"
         echo -n "Splitting $new_mldonkey_dir/files.ini (backup in $new_mldonkey_dir/files.ini.fasttrack): "
-        mldonkey_files --split Fasttrack -f0 "$new_mldonkey_dir/files.ini" \
+        /usr/lib/mldonkey/mldonkey_files --split Fasttrack -f0 "$new_mldonkey_dir/files.ini" \
         -f1 "$new_mldonkey_dir/files.ini.fasttrack" \
         -f2 "$new_mldonkey_dir/files.ini"
         echo "done."
     fi
 
-    #############
-    # Users.ini #
-    #############
-
-    #        if [ -n "$password" ]; then
-    #            $DEBUG && echo -n "Registering admin password in $new_mldonkey_dir/users.ini: "
-    #            /usr/bin/mlnet -useradd "admin $password"
-    #            $DEBUG && echo "done."
-    #        fi
-
     ####################
     # Files permission #
     ####################
@@ -221,7 +161,6 @@ MLDONKEY_USER=$run_as_user
 MLDONKEY_GROUP=$mldonkey_group
 MLDONKEY_UMASK=$mldonkey_umask
 LAUNCH_AT_STARTUP=$launch_at_startup
-MLDONKEY_NICENESS=$mldonkey_niceness
 EOF
 
         ucf --debconf-ok "$CONF_NEW" "$CONF"
diff --git a/debian/mldonkey-server.templates b/debian/mldonkey-server.templates
index 9419e99..6226d13 100644
--- a/debian/mldonkey-server.templates
+++ b/debian/mldonkey-server.templates
@@ -22,123 +22,3 @@ _Description: Launch MLDonkey at startup?
  .
  Otherwise, you will need to launch MLDonkey yourself each time you want to
  use it.
-
-Template: mldonkey-server/run_as_user
-Type: string
-Default: mldonkey
-_Description: MLDonkey user:
- Define the user who will run the MLDonkey server process.
- .
- Please do not choose a real user. For security reasons it is better if this
- user does not own any other data than the MLDonkey share.
- .
- You will use this user account to share and get data from the peer-to-peer
- networks.
- .
- This user will be a system user (if created). You won't be able to login into
- your system with this user name.
-
-Template: mldonkey-server/mldonkey_group
-Type: string
-Default: mldonkey
-_Description: MLDonkey group:
- Define the group which will run the MLDonkey server process.
- .
- Please do not choose a real group. For security reasons it is better if this
- group does not own any other data than the MLDonkey share.
- .
- Users of this group can start and stop the MLDonkey server and can also access
- the files fetched from the peer-to-peer networks.
-
-Template: mldonkey-server/reown_file
-Type: boolean
-Default: false
-_Description: Change the owner of old files?
- You have changed the MLDonkey user. You can change the ownership of your files
- to the new user.
- .
- PS: the former user won't be deleted from /etc/passwd, you will have to do it
- yourself later (e.g. with deluser(8)), or you keep it along with the old
- configuration.
-
-Template: mldonkey-server/mldonkey_dir
-Type: string
-Default: /var/lib/mldonkey
-_Description: MLDonkey directory:
- Define the directory to which the MLDonkey server will be chdired and chrooted.
- .
- The .ini configuration files, incoming and shared directories will be in this
- directory.
- .
- Chroot support is not complete. For now, chroot is not possible, but it may be
- enabled in the near future.
-
-Template: mldonkey-server/mldonkey_move
-Type: boolean
-Default: false
-_Description: Move the old configuration?
- You have changed the mldonkey directory. You can move the old files to this new
- directory.
- .
- If you choose no, the old directory won't be deleted. You will have to do it
- yourself.
-
-Template: mldonkey-server/mldonkey_niceness
-Type: string
-Default: 0
-_Description: Niceness of MLDonkey:
- MLDonkey uses heavy calculation from time to time (like hashing very big
- files). It should be a good idea to set a very kind level of niceness,
- depending on what ressources you want to give to MLDonkey.
- .
- You can set values from -20 to 20. The bigger the niceness, the lower the
- priority of MLDonkey processes.
-
-Template: mldonkey-server/max_hard_download_rate
-Type: string
-Default: 0
-_Description: Maximal download speed (kB/s):
- Set the maximal download rate. It can be useful to limit this rate, in order to
- always have a minimal bandwidth for other internet applications.
- .
- It has also been noticed that a full use of the bandwidth could cause problems
- with DSL connection handling. This is not a rule, it is just based on a few
- experiments.
- .
- 0 means no limit.
-
-Template: mldonkey-server/max_hard_upload_rate
-Type: string
-Default: 0
-_Description: Maximal upload speed (kB/s):
- Set the maximal upload rate. You must keep in mind that a peer-to-peer
- network is based on sharing. Do not use a very low rate.
- .
- Some networks calculate the download credit by the upload rate. More
- upload speed means more download speed.
- .
- As for the download speed, you should limit this rate so that you
- can still use the internet even when MLDonkey is running.
- .
- 0 means no limit.
-
-Template: mldonkey-server/password
-Type: password
-_Description: Password of admin user:
- As of version 2.04rc1, a new user management appears. The password is encrypted
- and stored in downloads.ini.
- .
- If you want to add a new user for MLDonkeys user management or want to change
- the password, refer to /usr/share/doc/mldonkey-server/README.Debian.
-
-Template: mldonkey-server/repassword
-Type: password
-_Description: Retype password of the admin user:
- Please confirm your admin's password.
-
-Template: mldonkey-server/false_password
-Type: note
-_Description: Passwords do not match
- The two password you enter must be the same.
- .
- You will be asked until you can provide the same password twice.

-- 
mldonkey packaging



More information about the Pkg-ocaml-maint-commits mailing list