This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=7984b5f201345efb5a1377117bdb8ac23eea2ccc

commit 7984b5f201345efb5a1377117bdb8ac23eea2ccc
Author: Guillem Jover <[email protected]>
AuthorDate: Fri Sep 12 02:32:58 2025 +0200

    dpkg-split: Obsolete --msdos option which no longer does anything
    
    This is a relic from the past, where distributions had to possibly
    support installation from MS-DOS systems, or transport binary packages
    in FAT formatted media.
    
    This has not been the case for a very long time. And front-ends like
    apt do not even support handling MSDOS-Filename in repositories, and
    VFAT support is wide-spread nowadays.
---
 man/dpkg-split.pod     | 15 +-------------
 src/split/dpkg-split.h |  1 -
 src/split/main.c       |  4 +---
 src/split/split.c      | 55 ++++----------------------------------------------
 4 files changed, 6 insertions(+), 69 deletions(-)

diff --git a/man/dpkg-split.pod b/man/dpkg-split.pod
index d05d29b3b..6f81311c2 100644
--- a/man/dpkg-split.pod
+++ b/man/dpkg-split.pod
@@ -219,20 +219,7 @@ spurious messages.
 
 =item B<--msdos>
 
-Forces the output filenames generated by
-B<--split>
-to be MSDOS-compatible.
-
-This mangles the prefix - either the default derived from the input
-filename or the one supplied as an argument: alphanumerics are
-lowercased, plus signs are replaced by
-B<x>'s
-and all other characters are discarded.
-
-The result is then truncated as much as is necessary, and filenames of
-the form
-I<prefixN>B<of>I<M>B<.deb>
-are generated.
+Obsolete option without effect (since dpkg 1.23.0).
 
 =back
 
diff --git a/src/split/dpkg-split.h b/src/split/dpkg-split.h
index f53e0c5a4..1cbe475a8 100644
--- a/src/split/dpkg-split.h
+++ b/src/split/dpkg-split.h
@@ -62,7 +62,6 @@ extern off_t opt_maxpartsize;
 extern const char *opt_depotdir;
 extern const char *opt_outputfile;
 extern int opt_npquiet;
-extern int opt_msdos;
 
 void read_fail(int rc, const char *filename, const char *what) DPKG_ATTR_NORET;
 void print_info(const struct partinfo *pi);
diff --git a/src/split/main.c b/src/split/main.c
index 729f1c50b..73be7697a 100644
--- a/src/split/main.c
+++ b/src/split/main.c
@@ -89,7 +89,6 @@ usage(const char *const *argv)
 "  -o, --output <file>              Filename, for -j (default is\n"
 "                                     <package>_<version>_<arch>.deb).\n"
 "  -Q, --npquiet                    Be quiet when -a is not a part.\n"
-"      --msdos                      Generate 8.3 filenames.\n"
 "\n"), ADMINDIR, PARTSDIR, ADMINDIR, "/");
 
   printf(_(
@@ -110,7 +109,6 @@ off_t opt_maxpartsize = SPLITPARTDEFMAX;
 const char *opt_depotdir;
 const char *opt_outputfile = NULL;
 int opt_npquiet = 0;
-int opt_msdos = 0;
 
 void DPKG_ATTR_NORET
 read_fail(int rc, const char *filename, const char *what)
@@ -156,7 +154,7 @@ static const struct cmdinfo cmdinfos[]= {
   { "partsize",     'S',  1,  NULL, NULL,             set_part_size       },
   { "output",       'o',  1,  NULL, &opt_outputfile,  NULL                },
   { "npquiet",      'Q',  0,  &opt_npquiet, NULL,     NULL,           1   },
-  { "msdos",         0,   0,  &opt_msdos, NULL,       NULL,           1   },
+  { "msdos",         0,   0,  NULL, NULL,             setobsolete,        },
   {  NULL,              0                                              }
 };
 
diff --git a/src/split/split.c b/src/split/split.c
index b4d3aee5e..0b190831f 100644
--- a/src/split/split.c
+++ b/src/split/split.c
@@ -107,29 +107,8 @@ parse_timestamp(const char *value)
        return timestamp;
 }
 
-/* Cleanup filename for use in crippled msdos systems. */
-static char *
-clean_msdos_filename(char *filename)
-{
-       char *d, *s;
-
-       for (s = d = filename; *s; d++, s++) {
-               if (*s == '+')
-                       *d = 'x';
-               else if (c_isupper(*s))
-                       *d = c_tolower(*s);
-               else if (c_islower(*s) || c_isdigit(*s))
-                       *d = *s;
-               else
-                       s++;
-       }
-
-       return filename;
-}
-
 static int
-mksplit(const char *file_src, const char *prefix, off_t maxpartsize,
-        bool msdos)
+mksplit(const char *file_src, const char *prefix, off_t maxpartsize)
 {
        struct pkginfo *pkg;
        struct dpkg_error err;
@@ -142,7 +121,6 @@ mksplit(const char *file_src, const char *prefix, off_t 
maxpartsize,
        int nparts, curpart;
        off_t partsize;
        off_t cur_partsize, last_partsize;
-       char *prefixdir = NULL, *msdos_prefix = NULL;
        struct varbuf file_dst = VARBUF_INIT;
        struct varbuf partmagic = VARBUF_INIT;
        struct varbuf partname = VARBUF_INIT;
@@ -179,34 +157,12 @@ mksplit(const char *file_src, const char *prefix, off_t 
maxpartsize,
                  "Splitting package %s into %d parts: ", nparts),
               pkg->set->name, nparts);
 
-       if (msdos) {
-               char *t;
-
-               t = m_strdup(prefix);
-               prefixdir = m_strdup(dirname(t));
-               free(t);
-
-               msdos_prefix = m_strdup(path_basename(prefix));
-               prefix = clean_msdos_filename(msdos_prefix);
-       }
-
        for (curpart = 1; curpart <= nparts; curpart++) {
                struct dpkg_ar *ar;
 
                /* Generate output filename. */
-               if (msdos) {
-                       char *refname;
-                       int prefix_max;
-
-                       refname = str_fmt("%dof%d", curpart, nparts);
-                       prefix_max = max(8 - strlen(refname), 0);
-                       varbuf_set_fmt(&file_dst, "%s/%.*s%.8s" DEBEXT,
-                                      prefixdir, prefix_max, prefix, refname);
-                       free(refname);
-               } else {
-                       varbuf_set_fmt(&file_dst, "%s.%dof%d" DEBEXT,
-                                      prefix, curpart, nparts);
-               }
+               varbuf_set_fmt(&file_dst, "%s.%dof%d" DEBEXT,
+                              prefix, curpart, nparts);
 
                if (curpart == nparts)
                        cur_partsize = last_partsize;
@@ -250,9 +206,6 @@ mksplit(const char *file_src, const char *prefix, off_t 
maxpartsize,
        varbuf_destroy(&partname);
        varbuf_destroy(&partmagic);
 
-       free(prefixdir);
-       free(msdos_prefix);
-
        close(fd_src);
 
        printf(_("done\n"));
@@ -280,7 +233,7 @@ do_split(const char *const *argv)
                prefix = nfstrnsave(sourcefile, sourcefile_len);
        }
 
-       mksplit(sourcefile, prefix, opt_maxpartsize, opt_msdos);
+       mksplit(sourcefile, prefix, opt_maxpartsize);
 
        return 0;
 }

-- 
Dpkg.Org's dpkg

Reply via email to