From 972a2aaf380dda40a5f324786d996311f6d1074a Mon Sep 17 00:00:00 2001 From: RedenticDev Date: Fri, 29 May 2020 13:24:52 +0200 Subject: [PATCH 1/2] improvements and fixes --- Packages.bz2 | Bin 389 -> 471 bytes Readme.md | 64 +++- UpdateRepo.sh | 15 +- depictions/.DS_Store | Bin 12292 -> 14340 bytes depictions/com.mdausch.exampletweak/info.xml | 26 +- depictions/css/main.css | 239 +++++++++++---- depictions/index.html | 84 +++--- depictions/js/setDepiction.js | 137 ++++++--- dpkg-gettext.pl | 37 --- dpkg-scanpackages | 292 ------------------- index.html | 24 +- 11 files changed, 432 insertions(+), 486 deletions(-) delete mode 100644 dpkg-gettext.pl delete mode 100755 dpkg-scanpackages diff --git a/Packages.bz2 b/Packages.bz2 index cd1eda17bf6bad5dafa55deac169e7e206a09485..0d97bd498a86e38f9259adbff68f0ffd0f81d434 100644 GIT binary patch literal 471 zcmV;|0Vw`LT4*&fL0KkKSzwh4gFad_lVsI4 zY7Cm0Jg1O{spSsTo0eN|%Q?8mb4KjWYxkiKHsaY`r2errQ-dVWKwf zW!A;9-qN#ExGpDeClT}$io!|!T`gEVa?Oyrc5B1m2vOZe zV##c>=7r(Hc;XYsIp$_+|Jcbh1sc&_ot4(CB3h{1^y^@jkHmTc1o9@w5+BfL)%Z9i z`svF38pnkqokk}>%ras{F}*BO2NI;+AyT3DA`=QuFZ&qjL4#FeZEK!aLCIXj1R-!S z4)lXtHms-+F9r-=*l7R)`YROGn-RC;T4QLTN;^zd#RO+gEjl0rRh&q<5s%GLjakxj N7ji{7P>|4ZFhbCR*o*)G literal 389 zcmV;00eb#IT4*^jL0KkKSwp6%Z2$mE-+%xRKnwr(?;}kBzwh4gFabuJC`u`y(HlZ) zX|gg+Hc&lGCZ4CMfYdTiNQipOGqmHb&Ezrb6uHxcDHj27s=dEW?khAu-3r62UwmEi76{_}*0}(^ zX;jg`o;8dV22f1+|gX7rM){y}1_Iko-6a_*pB4-`PXp+)i-Dt>hD`?JEnCCkb zh{`YLBh8cw*-V3mP diff --git a/Readme.md b/Readme.md index 1ad8989..85aa2ad 100644 --- a/Readme.md +++ b/Readme.md @@ -1,4 +1,5 @@ # Maxwell Dausch's Example Cydia Repository +_Improved by [RedenticDev](https://twitter.com/RedenticDev)_ This is a shell template for creating your own Cydia repository so you can host your own tweaks and themes @@ -8,7 +9,6 @@ I have uploaded a copy of this example repository to [mdausch.github.com](mdausc ## Prerequisites You will need a Mac or Linux system to create the repo on. This is possible using Windows, but is more tedious, and I will not be getting into it right now, this may be added later on though. - ### If you are using a Mac, you will need: * [Homebrew](brew.sh) - This is a package manager for Mac. If you don't have this already, paste the line below into your terminal: ``` @@ -36,6 +36,11 @@ git ``` If you don't have git installed already, you will be prompted to install the command line tools. +* Other utilities: `dpkg-scanpackages`, `bzip2` & `xz`. They are useful to create files `Pckages` and all compressed `Packages.*` files, that will be read by the package manager. You can also install them by running: +``` +brew install dpkg-scanpackages bzip2 xz +``` + ### If you are using Linux, you may need: @@ -88,7 +93,7 @@ git push origin master Now you should be able to navigate to [Your Username Here].github.io and you will be taken to your new Repo! -Be sure to update the index.html with the link to your new repo, and customize the page however you want. +Be sure to update the index.html with the link to your new repo, and customize the page however you want. Provide a `favicon.ico` (size: 64x64 or more) file on the root on the repo and a `CydiaIcon.png` (size: 256x256 or more) file to add nice icons and Cydia icon to your repo. ## Package Configuration @@ -105,6 +110,7 @@ Depends: mobilesubstrate Version: 0.0.2 Architecture: iphoneos-arm Description: An example package for testing out our personal Cydia repository +Icon: https://url-to-your/icon.png Depiction: https://mdausch.github.io/depictions/?p=com.mdausch.exampletweak Maintainer: Maxwell Dausch Author: Maxwell Dausch @@ -118,6 +124,7 @@ Lets break down each of these fields: * **Version:** This is simply the version number. This is how your users will know if there is an update for your package. If a user has version 1.0 installed, and your repo has version 1.0.1 being hosted, Cydia will show them that an update is available. * **Architecture:** You should NOT change this from `iphoneos-arm` This is the type of our package * **Description:** This is just a short description of the package. +* **Icon:** The icon of your package, to give it a nice look in Cydia. * **Depiction:** This is the link to a custom depiction page for the package. This is how people add screenshots and custom styling to the descriptions of packages in Cydia. If you provide a link here, the "Description" field in the control file is no longer displayed * **Maintainer:** This is the person who built the package. Issues with the packaging of the software should be sent to them. You can add their email by placing it in these brackets `<>` For example `` would show up in Cydia as the maintainer for my packages, allowing users to send issues over email. * **Author:** This is the person who originally wrote the software. This is who should be contacted about bugs in the tweak or theme itself. You can add their email similarly to the maintainer field with these brackets `<>` @@ -125,6 +132,8 @@ Lets break down each of these fields: Other fields you may want to add: +* **SileoDepiction:** Use this field to create a Sileo-specific depiction page, written in `json`. More details below. + * **Depends:** Use this field to add the bundle id for any dependencies you may need with your package. Such dependencies may include mobilesubstrate for tweaks or anemone for theming * **Conflicts:** Use this field to add any known tweak's bundle ids that conflict with yours. Maybe you modify the lock screen, and another tweak does the same so springboard will always crash, this makes it so you cant have both installed at once. @@ -155,8 +164,10 @@ part. This is what tells the depiction page to parse the info.xml file, and fill Currently, the depiction implementation that I have provided is pretty bare bones. The info.XML file will look similar to this: ``` + + - com.mdausch.exampletweak + ch.mdaus.exampletweak Example Tweak 0.0.2 @@ -169,7 +180,7 @@ Currently, the depiction implementation that I have provided is pretty bare bone 11.0 - 11.1.2 + 13.5 mobilesubstrate @@ -177,7 +188,7 @@ Currently, the depiction implementation that I have provided is pretty bare bone - V0.0.2 + V0.0.2 An important change Another important change @@ -186,6 +197,26 @@ Currently, the depiction implementation that I have provided is pretty bare bone Initial Release + + 1.png + 2.png + 3.png + 4.png + + + YOUR NAME + PRICE + DATE + DATE + Tweaks + + + GITHUB LINK + TWITTER LINK + mailto:your@mail.com + PAYPAL LINK + REDDIT LINK + ``` The important bits are as follows: @@ -196,19 +227,26 @@ The important bits are as follows: * **miniOS:** This displays the minimum version that your package should be installed on * **maxiOS:** This displays the maximum version that your package should be installed on * **dependency:** Add a new dependency tag for each dependency that your package requires -* **changelog:** This will be a list of all the changes your packages have gone through. To add a new change, create a `change` tag. In this tag, you will add a `changeVersion` tag to let users know which change you are writing about. Then after that tag, add a `changeDescription` tag listing what you have modified, added, or removed from the package. You can add as many of these descriptions as you want. They will automatically be styled as a list. +* **changelog:** This will be a list of all the changes your packages have gone through. To add a new change, create a `change` tag. In this tag, you will add a `changeVersion` tag to let users know which change you are writing about. Then after that tag, add a `changeDescription` tag listing what you have modified, added, or removed from the package. You can add as many of these descriptions as you want. +Only the latest version will be shown in the main page. The others can be found by clicking on `Full Changelog`, where they will automatically be styled as a list. Use the provided example info.xml as a guide for how this should be formatted with your information. -### TODO functionality +* **screenshots:** This display a view containing all the screenshots provided in a `screen` tag. Note that this is a path, so be careful depending on where you put your images. +* **information:** Put here all your information. +* **links:** Put here all your links to your networks. Delete the entry in `setDepiction.js` (line 67 to 71) to not show them in the depiction page. + +The depiction page also includes a ready-to-use version checker based on versions provided in `miniOS` and `maxiOS` and an adaptive dark mode that triggers based on device dark mode state. You can remove it by deleting the end of the `main.css` file mentioning it. + +### Sileo stuff (optional) +Sileo requires two specific files, optimized for it and written both in `json`. These are the depiction and the `sileo-featured.json` file: -Here are a few features I would like to add to the depiction page: +* **Sileo Depiction:** Contains all json objects to create a nice-looking depiction in Sileo. The one provided here is not necessarily the best, you can create your own by following the [official Sileo documentation](https://developer.getsileo.app/native-depictions). -* [ ] Screenshots - Either inline or a separate page for screenshots for your package -* [ ] A Better ChangeLog - Cut down on the clutter and only show the most recent version's changes and then provide a link to another page with the full list of changes -* [ ] Version Checking - Parse the user agent and figure out if a user's device is compatible with the min and max versions specified +* **sileo-featured.json:** This file provides banners overview on your repo's page in Sileo. For each package you want to highlight, just add `banners` sub-object in the file with all information. Documentation [here](https://developer.getsileo.app/sileo-featured). This file works also in other package managers like Zebra. +_N.B.: Note that these two Sileo files are fully optional and won't break neither your repo nor your packages in Sileo. They are just here to add a full compatibility with Sileo._ ## Adding Tweaks @@ -239,9 +277,9 @@ where `Package` is the name of the folder you are compressing ## Updating The Repo -Once all of your debs and depictions have been placed in the proper place it is time to update the repo. To do this run the UpdateRepo.sh file from inside your repo in the terminal by typing ./UpdateRepo.sh If this gives you some sort of permissions error, run +Once all of your debs and depictions have been placed in the proper place it is time to update the repo. To do this run the updateRepo.sh file from inside your repo in the terminal by typing ./updateRepo.sh If this gives you some sort of permissions error, run ``` -chmod +x UpdateRepo.sh && chmod +x dpkg-scanpackages +chmod +x updateRepo.sh && chmod +x dpkg-scanpackages ``` and try running the update script once again. diff --git a/UpdateRepo.sh b/UpdateRepo.sh index 16f7663..63b3fbe 100755 --- a/UpdateRepo.sh +++ b/UpdateRepo.sh @@ -1,6 +1,11 @@ -#!/bin/bash - -rm Packages* -./dpkg-scanpackages -m . /dev/null >Packages -bzip2 Packages +#!/bin/sh +echo "[+] Creating 'Packages'..." +dpkg-scanpackages -m ./debs > Packages +echo "[+] Creating 'Packages.bz2' from 'Packages'..." +bzip2 -5fkv Packages > Packages.bz2 +echo "[+] Creating 'Packages.xz' from 'Packages'..." +xz -5fkev Packages > Packages.xz +echo "[+] Creating 'Packages.lzma' from 'Packages'..." +xz -5fkev --format=lzma Packages > Packages.lzma +echo "Done." \ No newline at end of file diff --git a/depictions/.DS_Store b/depictions/.DS_Store index dcd7a0342a04c0de541e4b5b41941c68984831f9..0ea5d9d6d2a39ef4aeff7d26e43af3e01004c424 100644 GIT binary patch delta 426 zcmZokXem%&U|?W$DortDU@!nOIe-{M3-AC5RR#tHo{0*|ia9_IGY~TZu`q-!z`#(P zQkTP + ch.mdaus.exampletweak Example Tweak @@ -12,7 +14,7 @@ 11.0 - 11.1.2 + 13.5 mobilesubstrate @@ -20,7 +22,7 @@ - V0.0.2 + V0.0.2 An important change Another important change @@ -29,4 +31,24 @@ Initial Release + + 1.png + 2.png + 3.png + 4.png + + + YOUR NAME + PRICE + DATE + DATE + Tweaks + + + GITHUB LINK + TWITTER LINK + mailto:your@mail.com + PAYPAL LINK + REDDIT LINK + diff --git a/depictions/css/main.css b/depictions/css/main.css index 444bce6..0e8ea48 100644 --- a/depictions/css/main.css +++ b/depictions/css/main.css @@ -20,7 +20,6 @@ time, mark, audio, video { padding: 0; border: 0; font-size: 100%; - font: inherit; vertical-align: baseline; } /* HTML5 display-role reset for older browsers */ @@ -48,76 +47,216 @@ table { } body { - margin: 0; + margin: 0; padding: 0; - background-color:#efeff4; - -webkit-font-smoothing: antialiased; - margin: 0; - font:14px -apple-system-font,".Helvetica NeueUI","Helvetica Neue",sans-serif; - width:100%; - padding-bottom:50px; + background-color: #efeff4; + -webkit-font-smoothing: antialiased; + margin: 0; + font: 14px -apple-system-font, ".Helvetica NeueUI", "Helvetica Neue", sans-serif; + width: 100%; + padding-bottom: 50px; } .boxTitle { - margin-top:35px; - margin-bottom:10px; - margin-left:auto; - margin-right:auto; - width:260px; - text-align: left; - font-size: 17px; + margin-top: 35px; + margin-bottom: 10px; + margin-left: auto; + margin-right: auto; + width: 88vw; + max-width: 760px; + text-align: left; + font-size: 17px; } -.box{ - background-color: #fffdfd; - margin-bottom:20px; - width:240px; - border-radius: 10px; - padding:10px; - margin-left:auto; - margin-right:auto; - text-align: center; +.box { + background-color: #fffdfd; + margin-bottom: 20px; + width: 90vw; + max-width: 800px; + border-radius: 10px; + padding: 10px; + margin-left: auto; + margin-right: auto; + text-align: center; } -.box h1{ - display:inline-block; +.box h1 { + display: inline-block; } -#packageTitle{ - margin-bottom:10px; +#description { + text-align: left; + padding-left: 10px; + padding-right: 10px; } -#bundleId{ - float:right; - display:inline-block; - font-size:10px; +#description li { + white-space: pre-line; + padding-top: 5px; + padding-bottom: 10px; } -#version{ - float:left; - display:inline-block; - font-size:10px; +#description li:first-child { + padding-top: 10px; + font-weight: bold; + font-size: 120%; } -#MINIOS,#MAXIOS{ - display:inline-block; +#changelog { + text-align: left; + padding-left: 10px; + padding-right: 10px; } -#description { - text-align: left; - margin: 0px, 10px, 10px, 10px; - padding-top:10px; +#changelog li { + white-space: pre-line; + padding-top: 5px; + padding-bottom: 10px; +} + +#changelog li:first-child { + padding-top: 10px; +} + +#changelog h1 { + margin-bottom: 5px; +} + +#changelog table { + margin-top: 10px; + width: 100%; + border-collapse: collapse; + margin-left: auto; + margin-right: auto; + line-height: 30px; +} + +#changelog table tr { + border-top: 1px solid #ccc; + text-align: left; +} + +.title-container { + position: relative; +} + +.title-container > * { + display: inline-block; +} + +#pill { + font-size: 75%; + margin-left: 10px; + padding: 2px; + padding-left: 7px; + padding-right: 7px; + background-color: lightgrey; + border-radius: 10px; +} + +#changelog-date { + font-size: 75%; + position: absolute; + bottom: 0; + right: 0; + float: right; +} + +#screenshots { + overflow-x: scroll; + white-space: nowrap; + -webkit-overflow-scrolling: touch; + -ms-overflow-style: -ms-autohiding-scrollbar; +} + +#screenshots li { + display: inline; } -#description li{ - margin-bottom:10px; + +#screenshots img { + border-radius: 8px; + max-width: 90%; + max-height: 400px; + padding: 16px; + -webkit-user-drag: none; +} + +table { + width: 95%; + border-collapse: collapse; + margin-left: auto; + margin-right: auto; + line-height: 30px; +} + +tr { + border-bottom: 1px solid #ccc; + text-align: right; +} + +tr:last-child { + border-bottom: 0; +} + +th { + text-align: left; + padding-left: 10px; +} + +td { + padding-right: 10px; } -#changeLog { - text-align:left; - padding-bottom:20px; +#links tr { + text-align: left; } -#changeLog h1{ - margin-top:20px; - margin-bottom:5px; +tr a { + color: #147dfb; + display: block; + padding-left: 10px; + text-decoration: none; +} + +tr a:hover { + color: #023d85; + background-color: rgb(240, 240, 240); + border-radius: 10px; +} + +tr a:after { + content: "›"; + font-weight: 300; + font-size: 30px; + float: right; + margin-right: 5px; + transform: translateY(-2px); +} + +tr a img { + height: 20px; + border-radius: 5px; + vertical-align: -5px; + margin-right: 5px; +} + +/* Dark mode */ +@media (prefers-color-scheme: dark) { + body { + background-color: black; + color: white; + } + + .box { + background-color: dimgrey; + } + + tr a { + color: white; + font-weight: bold; + } + + #pill { + background-color: grey; + } } diff --git a/depictions/index.html b/depictions/index.html index eca803c..ec4de5b 100644 --- a/depictions/index.html +++ b/depictions/index.html @@ -1,47 +1,57 @@ - - - Repo - - - - - - + + + Repo + + + + + + + + + + + - - -

Compatibility

-
-

-

-

-

-
+ +

Compatibility

+
+

+
-

Description

-
-
    -
-
+

Description

+
+
    +
    -

    ChangeLog

    -
    -
      -
      +
      +

      Changelog

      +

      +
      +
      +
        +
        -

        Dependencies

        -
        -
        +

        Dependencies

        +
        +
          +
          - +

          Screenshots

          +
          +
            +
            +

            Information

            +
            +
            +
            - +

            Links

            +
            + +
            + diff --git a/depictions/js/setDepiction.js b/depictions/js/setDepiction.js index a281ebe..a1b9ea5 100644 --- a/depictions/js/setDepiction.js +++ b/depictions/js/setDepiction.js @@ -1,62 +1,85 @@ - -$(function(){ +$(function() { var bundle = getQueryVariable('p'); - if(bundle != undefined){ - //Now fetch the appropriate file from this query string + if (bundle == undefined) { + console.log("Package not found. Aborting."); + return; } + var shouldShowNoScreenshots = true; + var changelogExport = ""; - console.log(getQueryVariable('p')); + console.log("Package: " + getQueryVariable('p')); console.log("Fetching XML"); var getUrl = window.location; - var baseUrl = getUrl .protocol + "//" + getUrl.host + "/" + getUrl.pathname.split('/')[1]; - console.log(baseUrl + "/"+ bundle + "/info.xml"); + var baseUrl = getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname.split('/')[1]; + var pathTo = baseUrl + "/" + bundle; $.ajax({ type: "GET", - url: baseUrl + "/" + bundle + "/info.xml", + url: pathTo + "/info.xml", dataType: "xml", - success: function (xml) { + success: function(xml) { console.log("Beginning XML Parsing"); // Parse the xml file and get data - $(xml).find('packageInfo').each(function(){ - // document.getElementById("packageTitle").innerHTML = $(this).find("name").text(); - //document.getElementById("bundleId").innerHTML = $(this).find("bundleId").text(); - //document.getElementById("version").innerHTML = $(this).find("version").text(); - document.getElementById("miniOS").innerHTML = $(this).find("miniOS").text(); - document.getElementById("maxiOS").innerHTML = $(this).find("maxiOS").text(); - - $(xml).find('description').each(function(){ - $("#description" ).append('
          • ' +$(this).text()+ '
          • '); - }); - - $(xml).find('dependency').each(function(){ - $("#dependencies" ).append('
          • ' +$(this).text()+ '
          • '); - }); - - $(xml).find('linkName').each(function(){ - $("#dependencies" ).append('
          • ' +$(this).text()+ '
          • '); - }); - - $(xml).find('change').each(function(){ - $("#changeLog" ).append('
          • ' + '

            ' + $(this).find("changeVersion").text() + '

            '); - $(this).find('changeDescription').each(function(){ - $("#changeLog" ).append('

            ' + $(this).text()+ '

            '); - }); - $("#changeLog" ).append('
          • '); - }); - - + $(xml).find("packageInfo").each(function() { + document.title = $(this).find("name").text().trim(); + + compatible($(this).find("miniOS").text().trim(), $(this).find("maxiOS").text().trim()); + + $(xml).find("description").each(function() { + $("#description").append("
          • " + $(this).text().trim() + "
          • "); + }); + + $(xml).find("dependency").each(function() { + $("#dependencies").append("
          • " + $(this).text().trim() + "
          • "); + }); + + $(xml).find("change:first").each(function() { + $("#pill").append($(this).find("changeVersion").text().trim()); + changelogExport += "
          • "; + $(this).find("changeDescription").each(function() { + changelogExport += "

            - " + $(this).text().trim() + "

            "; + }); + changelogExport += "
          • "; + }); + $("#changelog-date").append($(this).find("lastupdate").text().trim()); + $("#changelog").append(changelogExport + '
            Full changelog
            '); + + $(xml).find("screen").each(function() { + shouldShowNoScreenshots = false; + $("#screenshots").append('
          • '); + }); + + if (shouldShowNoScreenshots) { + $("#screenshots").append('
          • No screenshots provided.
          • '); + } + + $("#infoTable").append('Developer' + $(this).find("developer").text().trim() + ''); + $("#infoTable").append('Price' + $(this).find("price").text().trim() + ''); + $("#infoTable").append('Version' + $(this).find("version").text().trim() + ''); + $("#infoTable").append('iOS VersioniOS ' + $(this).find("miniOS").text().trim() + ' to ' + $(this).find("maxiOS").text().trim() + ''); + $("#infoTable").append('Last update' + $(this).find("lastupdate").text().trim() + ''); + $("#infoTable").append('Release date' + $(this).find("release").text().trim() + ''); + $("#infoTable").append('Category' + $(this).find("category").text().trim() + ''); + + $("#links").append('Github'); + $("#links").append('Twitter'); + $("#links").append('Mail'); + $("#links").append('Paypal'); + $("#links").append('Reddit'); }); - } }); - - }); +$("img").bind("dragstart", function() { + return false; +}); +$("img").bind("mousedown", function() { + return false; +}); function getQueryVariable(variable) { var query = window.location.search.substring(1); @@ -67,5 +90,37 @@ function getQueryVariable(variable) { return decodeURIComponent(pair[1]); } } - console.log('Query variable %s not found', variable); + console.log("Query variable %s not found", variable); +} + +// Inspired by repo.conorthedev.me/depiction/web +function compatible(works_min, works_max) { + let currentiOS = parseFloat(('' + (/CPU.*OS ([0-9_]{1,})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent) || [0,''])[1]).replace('undefined', '3_2').replace('_', '.').replace('_', '')); + works_min = numerize(works_min); + works_max = numerize(works_max); + let text = document.getElementById("compatibility"); + let text_container = document.getElementById("compatibility-box"); + if (currentiOS < works_min) { + text.innerHTML = "Your version of iOS is too old for this package. This package works from iOS " + works_min + "to iOS " + works_max + "."; + text.style.color = "red"; + text_container.style.backgroundColor = "lightpink"; + text_container.style.border = "1px solid red"; + } else if (currentiOS > works_max) { + text.innerHTML = "This package has not been tested with your iOS version. This package works from iOS " + works_min + "to iOS " + works_max + "."; + text.style.color = "goldenrod"; + text_container.style.backgroundColor = "lightyellow"; + text_container.style.border = "1px solid goldenrod"; + } else if (String(currentiOS) != "NaN") { + text.innerHTML = "This package works on your device!"; + text.style.color = "green"; + text_container.style.backgroundColor = "lightgreen"; + text_container.style.border = "1px solid green"; + } else { + text.innerHTML = "Cannot determine your version. Open this page on an iPhone/iPad/iPod to check compatibility."; + text.style.fontStyle = "italic"; + } +} + +function numerize(x) { + return x.substring(0, x.indexOf(".")) + "." + x.substring(x.indexOf(".") + 1).replace(".", ""); } diff --git a/dpkg-gettext.pl b/dpkg-gettext.pl deleted file mode 100644 index 9ce985a..0000000 --- a/dpkg-gettext.pl +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/perl -w -use strict; -use warnings; -# Copied from /usr/share/perl5/Debconf/Gettext.pm - -use strict; - -BEGIN { - eval 'use Locale::gettext'; - if ($@) { - eval q{ - sub _g { - return shift; - } - sub textdomain { - } - sub ngettext { - if ($_[2] == 1) { - return $_[0]; - } else { - return $_[1]; - } - } - }; - } else { - eval q{ - sub _g { - return gettext(shift); - } - }; - } -} - -use base qw(Exporter); -our @EXPORT=qw(_g textdomain ngettext); - -1; diff --git a/dpkg-scanpackages b/dpkg-scanpackages deleted file mode 100755 index e5c1609..0000000 --- a/dpkg-scanpackages +++ /dev/null @@ -1,292 +0,0 @@ -#!/usr/bin/perl - -use warnings; -use strict; - -use IO::Handle; -use IO::File; - -my $version="1.13.25"; # This line modified by Makefile -my $dpkglibdir="/usr/lib/dpkg"; # This line modified by Makefile - -($0) = $0 =~ m:.*/(.+):; - -push(@INC,$dpkglibdir); -require './dpkg-gettext.pl'; -textdomain("dpkg-dev"); - -my %kmap= (optional => 'suggests', - recommended => 'recommends', - class => 'priority', - package_revision => 'revision', - ); - -my @fieldpri= ('Package', - 'Source', - 'Version', - 'Priority', - 'Section', - 'Essential', - 'Maintainer', - 'Pre-Depends', - 'Depends', - 'Recommends', - 'Suggests', - 'Conflicts', - 'Provides', - 'Replaces', - 'Enhances', - 'Architecture', - 'Filename', - 'Size', - 'Installed-Size', - 'MD5sum', - 'Description', - 'Origin', - 'Bugs', - 'Name', - 'Author', - 'Homepage', - 'Website', - 'Depiction', - 'Icon' - ); - -# This maps the fields into the proper case -my %field_case; -@field_case{map{lc($_)} @fieldpri} = @fieldpri; - -use Getopt::Long qw(:config bundling); - -my %options = (help => sub { &usage; exit 0; }, - version => \&version, - udeb => 0, - arch => undef, - multiversion => 0, - ); - -my $result = GetOptions(\%options,'help|h|?','version','udeb|u!','arch|a=s','multiversion|m!'); - -sub version { - printf _g("Debian %s version %s.\n"), $0, $version; - exit; -} - -sub usage { - printf _g( -"Usage: %s [